Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: kkquek on November 02, 2010, 10:53:21 PM

Title: need help ! three function on one button
Post by: kkquek on November 02, 2010, 10:53:21 PM
dear sir,
how to make a button to "run,pause,continue" on one button(same button)
because my extend keypad only have 10 button
Title: Re: need help ! three function on one button
Post by: poppabear on November 04, 2010, 09:21:26 AM
You can put the following code in your Macro pump,
you can also do this same thing in Brains if you wanted.
I will show you a macro pump example.
Since you didnt specify what your INPUT is, I am going to use INPUT4 as your trigger, change it to what you need.

'////////  Macro Pump code /////////////////////////////

Counter = GetUserDRO(2100)                               'interlock counter dro

If Not GetOEMLED(800) Then                                'if NOT currently estopped
  If IsActive(INPUT4) And Counter = 0 Then
    If GetOEMLED(804) Then                                  'if in a Run State
       DoOEMButton(1001)                                     'hit the pause button
    Else
       DoOEMButton(1000)                                     'hit the Start button ( or continue so to speak )
    End If
    SetUserDRO(2100, 1)
  End If

  If Not IsActive(INPUT4) And Counter = 1 Then
    SetUserDRO(2100, 0)                                      'reset your counter
  End If
End If

'Scott
Title: Re: need help ! three function on one button
Post by: BR549 on November 04, 2010, 10:35:41 AM
I guess someone should remind you of the safety concerns of having GO and Stop run from the SAME button?????? surely there is another button on your setup that you could double up instead of start,hold????

(;-)TP
Title: Re: need help ! three function on one button
Post by: ger21 on November 04, 2010, 11:36:41 AM
It's not stop, he's just using cycle start to pause. To resume, you still hit cycle start, so he's just getting rid of the pause button.
Title: Re: need help ! three function on one button
Post by: BR549 on November 04, 2010, 12:16:19 PM
Bad JUJU to have one button that controls stop and start. Safety 101

Hit it once the machine starts motion, hit it again it stops motion.

That is start / stop

(;-) TP
Title: Re: need help ! three function on one button
Post by: kkquek on November 05, 2010, 11:15:19 PM
I'll try that.

Thanks for all the replies!

kkquek