Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Flipz01 on April 13, 2007, 04:07:02 PM

Title: Momentary Outputs
Post by: Flipz01 on April 13, 2007, 04:07:02 PM
Does anybody know how to make an output button that is only on when you are clicking it?  Or, that will only be active for about 1 second.

I need a couple of buttons that activate outputs that connect to inputs on a PLC.  It would simplify PLC programming if the output is not maintained.
Title: Re: Momentary Outputs
Post by: Ron Ginger on April 14, 2007, 02:01:43 PM
I would do something like this:

call ActivateSignal(SigNo)
code "G4 p1"
while IsMoving
Wend
call DeActivate Signal(SifNo)

The G4 value is in seconds. The While IsMoving is needed to make Mach wait until the code has completed before returning.