Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 08:55:46 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Feed rate override switch
Pages: 1   Go Down
Print
Author Topic: Feed rate override switch  (Read 558 times)
0 Members and 2 Guests are viewing this topic.
Aeroshade
Active Member

Offline Offline

Posts: 138


View Profile
« on: October 26, 2011, 11:35:27 AM »

Hello all, I have searched for an answer to this for awhile and have come up empty.

I have posted this in Brains and VB to get both opinions.

I have a 16 position binary switch ( 4 pins - 1,2,4,8). I have the pins set to Input #1,2,3 and 4. The way this switch works is pin 1 = 1, pin 2 = 2, pin 1 and pin 2 = 3 and so on tell you get 16 (counting all pins off as a position).

I need to find a way to have this control my feedrate over ride, plus my rapid override at the same time. I'm not sure if the best way would be with a Brain or in VB - Macropump. The most important thing is that the switch works fast.

I don't have a problem writing it up in my Macropump, just need a little guidance on the code.

This is what I was think for the layout, just not sure about the DRO for the FRO:

If IsActive(INPUT1) = False And
IsActive(INPUT2) = False And
IsActive(INPUT3) = False
IsActive(INPUT4) = False Then
SetOEMDRO(0, 0) <--- Needs to set the DRO to 0%
End If

If IsActive(INPUT1) And
IsActive(INPUT2) = False And
IsActive(INPUT3) = False
IsActive(INPUT4) = False Then
SetOEMDRO(0, 0) <--- Needs to set the DRO to 10%
End If


So on and so forth, tell I get all 16 positions set.


Any help would be GREAT!!


Thanks,

Aero
Logged
BR549
Active Member

Offline Offline

Posts: 2,557


View Profile
« Reply #1 on: October 26, 2011, 11:46:28 AM »

FOr that I would do it in the Brains. The Brians are much faster in the actual code side. AND seeing as it is a basic ladder type coding it would work best.

Now the brains CAN be painfull to build long ladders. IF you mess up somewhere you have to start all over from scratch to rebuild the Rungs of the ladder.

Just a thought, (;-) TP
Logged
Aeroshade
Active Member

Offline Offline

Posts: 138


View Profile
« Reply #2 on: October 26, 2011, 11:46:53 AM »

I could prob. do something like this:

CurrentFeedrate = FeedRate()

If IsActive(INPUT1) = False And
IsActive(INPUT2) = False And
IsActive(INPUT3) = False
IsActive(INPUT4) = False Then
CurrentFeedrate= 0
SetFeedrate(CurrentFeedrate)
End If

If IsActive(INPUT1) And
IsActive(INPUT2) = False And
IsActive(INPUT3) = False
IsActive(INPUT4) = False Then
CurrentFeedrate= CurrentFeedrate/10
SetFeedrate(CurrentFeedrate)
End If

And so on, not sure if the language is correct, but you get my point.
Logged
Aeroshade
Active Member

Offline Offline

Posts: 138


View Profile
« Reply #3 on: October 26, 2011, 11:48:29 AM »

FOr that I would do it in the Brains. The Brians are much faster in the actual code side. AND seeing as it is a basic ladder type coding it would work best.

Now the brains CAN be painfull to build long ladders. IF you mess up somewhere you have to start all over from scratch to rebuild the Rungs of the ladder.

Just a thought, (;-) TP

That is what i have been running into, what DRO would I need to change and how do I set its value? I have wrote VERY simple Brains, but I'm up to the challenge if it works good Smiley


ADD: I have never wrote a Brain were I had to set a value.
Logged
Aeroshade
Active Member

Offline Offline

Posts: 138


View Profile
« Reply #4 on: October 27, 2011, 11:40:14 AM »

If some one could write a simple one for reference that would be great, and I would much appreciate it.


Thanks

Aero
Logged
Overloaded
Global Moderator
*
Offline Offline

Posts: 3,073



View Profile
« Reply #5 on: October 27, 2011, 12:19:27 PM »

http://www.machsupport.com/forum/index.php/topic,6631.0.html

Russ
Logged

"I haven't failed. I've just found 10,000 ways that won't work."         Edison

"You cannot help men permanently by doing for them what they could and should do for themselves."
Abe Lincoln
Aeroshade
Active Member

Offline Offline

Posts: 138


View Profile
« Reply #6 on: October 27, 2011, 01:16:16 PM »

I'm trying to get the Brain up and running. I have attached the Brain I'm messing with, but when I run it, it sets the FRO to the last % on the list (in this Brain it's 30%) and when I turn the switch the FRO doesn't change. Any ideas?




For the Macropump I tried this but I don't see any change:

If IsActive(INPUT1) = False And IsActive(INPUT2) = False And IsActive(INPUT3) = False And IsActive(INPUT4) = False Then
SetOEMDRO(821, 0)
End If


Thanks for the help Smiley


Aero

* Feed Rate.brn (10.46 KB - downloaded 15 times.)
Logged
BR549
Active Member

Offline Offline

Posts: 2,557


View Profile
« Reply #7 on: October 27, 2011, 01:41:56 PM »

Try something along these lines.


IF not IsActive(Input1) and not IsActive(Input2)and not IsActive(Input3) then SetOemDro(29,0.000)

(;-) TP
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #8 on: November 03, 2011, 07:42:42 AM »

'MacroPump.m1s

'Here is another option using the Macro-Pump, since you have a potiential of 16
'positions. Figure out the numeric value of each combination in decimal.
'NOTE!! test and MAKE sure on the diagnostics page, that you are reading
'these 4 INPUTS when the B-switch makes them active!!!

BIT1 = IsActive(INPUT1) 'value in decimal of 0 or 1
BIT2 = IsActive(INPUT2) 'value in decimal of 0 or 2
BIT3 = IsActive(INPUT3) 'value in decimal of 0 or 4
BIT4 = IsActive(INPUT4) 'value in decimal of 0 or 8

DecimalValue = ( (BIT4 * 8) + (BIT3 * 4) + (BIT2 * 2) + (BIT1 * 1) )

If ( DecimalValue = 0 ) Then    'Four bit binary value expressed as decimal
SetOEMDRO(821, 0)             'FROVR DRO
End If

If ( DecimalValue = 1 ) Then    'Four bit binary value expressed as decimal
SetOEMDRO(821, 10)             'FROVR DRO
End If

If ( DecimalValue = 2 ) Then    'Four bit binary value expressed as decimal
SetOEMDRO(821, 20)             'FROVR DRO
End If

'ETC..........
'enjoy Scott
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!