Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: boutje on March 05, 2013, 04:35:36 PM
-
I want to set a new feedrate in the middle of a running program with a button.
Example:
The feedrate is a 1000mm/min in the middle of running program.
When i push a button (make in a new screen) the feedrate must be 10 mm/min.
When i push the button again the feedrate must be previous feedrate.
All this without stopping the running program.
-
This should get you started.
'Macro to toggle feedrate +/- 10
If Getuserled(2000) = 0 Then
SetDro(18, (GetDro(18)+10))
SetUserLed(2000,1)
Else
SetDro(18,(GetDro(18)-10))
SetUserLed(2000,0)
End If
End
(;-) TP
-
This should get you started.
'Macro to toggle feedrate +/- 10
If Getuserled(2000) = 0 Then
SetDro(18, (GetDro(18)+10))
SetUserLed(2000,1)
Else
SetDro(18,(GetDro(18)-10))
SetUserLed(2000,0)
End If
End
(;-) TP
Hey TP, wouldn't that be .......
'Macro to toggle feedrate BETWEEN 10 and 1000
... SetDro(18, (GetDro(18)*.01))
and .... SetDro(18, (GetDro(18)*100)) ... ?
Just guessing,
Russ
-
WOOPS I can't read very well I guess. Need new glasses. But you can see from the bad example how to do the function (;-) I Just need to take a math class or reading class to finish it out.
Thanks Russ, (;-) TP
-
A little caution here guys with where you are so far. Feedrate is 1000. You press the button and feedrate drops to 10. But what happens if a gcode F1000 happens to come along? You press the button again expecting a feed of 10 but you get a feed of 100,000.
Ian
-
Thanks for the reply`s.
@Striling,
Nice one!
But there is another issue .
The feedrate is not always 1000mm/min.
I can also be a other value.
-
new to this so don't try without drycutting. but would it be something like this;
'Macro to toggle feedrate
If GetOEMDRO(Don’t know #) = 0 Then
SetOEMDRO(?, (GetOEMDRO(?)*.01))
Else
SetOEMDRO(?,(GetOEMDRO(?)*100))
End If
End
-
TP, you did all the work, I just caught a typo. Couldn't have done it without ya. :)
Thanks,
Russ
Good point Ian .... real good !
-
The feedrate is not always 1000mm/min.
I can also be a other value.
Doesn't matter what the FR is, it just gets multiplied by .01 then back to the originally called FR by the *100.
-
normally I would capture the current FR and then ASK what you wanted for a new feedrate.
Just as easy to TYPE in the wanted feedrate in the DRO.
Russ, I could have sworn I read it as, want to reduce it by 10 IPM and then back to normal. (;-)
(;-) TP
-
I have make it totally different.
Now i have a button to set the feed FRO on 10%.
When i push the button again the feed FRO is set back on 100%.
This good for now.