Machsupport Forum

Mach Discussion => Mach Screens => Screen designer tips and tutorials => Topic started by: michaelthomas on July 29, 2012, 07:48:49 PM

Title: Modify Button Output
Post by: michaelthomas on July 29, 2012, 07:48:49 PM
I would like to modify the softlimits button to activate an output when pressed, then deactivate it when pressed again.

I can get it to activate with a VB script of ActivateOutput(7)......but I can't shut it off.  This is pretty new to me, so I'm making very slow progress....lol.

I though maybe using a toggle type button would work, but it hasn't so far.

I wonder if I need a conditional script.....but don't know.

Any help would be appreciated.

Thanks,

Mike
Title: Re: Modify Button Output
Post by: ger21 on July 29, 2012, 08:33:03 PM
Typically, you'd check the status of an LED to determine the status of the output, and turn it on or off based on the LED's status.
Like:
 If GetOEMLED(xx), then
deactivateoutput
else
activateoutput.
endif

I don't know the actual syntax off hand, so the above is just for reference. :)
Title: Re: Modify Button Output
Post by: michaelthomas on July 29, 2012, 10:33:39 PM
That did the job.....Thanks a bunch.

Mike