Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: ballistic42 on January 13, 2016, 05:39:34 PM

Title: User LED
Post by: ballistic42 on January 13, 2016, 05:39:34 PM
I have an LED that I made for my ATC Tool Carousel slide extension.  I have a reed switch hooked up to my tool carousel air cylinder that has a magnetic piston.  The reed switch which is Normally Open will close when the Piston goes under the reed switch.  This in turn will close the circuit and activate the on screen LED.   The LED is to let the M6START Macro and the user see that the air cylinder is in the Extended position. 

The question is how do I make the LED work?  I have made others but for some reason I just can't figure this one out.  I do have an output that runs the air cylinder on output 4.  I think all of this is correlated but don't know how to put it into words.

Thanks,

Jeff
Title: Re: User LED
Post by: BR549 on January 13, 2016, 06:29:58 PM
You canuse teh brains or teh macroPump. You would monitor teh switch state via the Input# that you brought the signal into. Seeing that yo have 2 signals you can watch makes it better.

The output signal that activates the cylinder and teh End of stroke signal that tells you you are extended.

So you look at both conditions

IF GetSignal(ouput#1) AND Getsignal(inout#1) then '

  SetUserLed(*********x,1 ) ' Turn on Led

End If