Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: boutje on March 05, 2013, 04:35:36 PM

Title: How to set the feedrate with a button
Post 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.
Title: Re: How to set the feedrate with a button
Post by: BR549 on March 05, 2013, 04:58:14 PM
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
Title: Re: How to set the feedrate with a button
Post by: Overloaded on March 05, 2013, 07:59:50 PM
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


Title: Re: How to set the feedrate with a button
Post by: BR549 on March 05, 2013, 09:28:43 PM
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
Title: Re: How to set the feedrate with a button
Post by: stirling on March 06, 2013, 04:28:58 AM
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
Title: Re: How to set the feedrate with a button
Post by: boutje on March 06, 2013, 06:17:54 AM
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.
Title: Re: How to set the feedrate with a button
Post by: Kenneth on March 06, 2013, 07:16:36 AM
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
Title: Re: How to set the feedrate with a button
Post by: Overloaded on March 06, 2013, 07:27:53 AM
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 !

Title: Re: How to set the feedrate with a button
Post by: Overloaded on March 06, 2013, 07:30:30 AM
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.
Title: Re: How to set the feedrate with a button
Post by: BR549 on March 06, 2013, 11:51:00 AM
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
Title: Re: How to set the feedrate with a button
Post by: boutje on March 08, 2013, 04:31:32 PM
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.