03-10-2010 09:35 AM
I'm working in LabView and I'm tryng to do a simple function button push latch.
Push button and release turns a solenoid on, push and release button a second time to turn off.
I found an example on the ni.com/first web site (search for Button Functional) that has 4 different type of button functions. I'm trying to use the on/off case in the example. What I don't understand is, what keeps the case structure that is enabled by the deracing button AND gate in the "True" case? I would think the AND output is only true for one processing loop (30ms???).
03-10-2010 10:38 AM
What you need to do is to detect a rising edge of the button. Going False to True.
Then invert the state of a boolean that is the state of the solenoid.
The state of the solenoid is stored in a non initialize shift registers of a loop that runs only once (a For Loop or a While Loop will work)
Or in a Feed Back node
03-10-2010 12:33 PM
You're right - it looks to me like that example doesn't do what it says it does. You could add an additional shift register to keep track of whether the current state is On or Off, and then XOR that with the output of the AND to get the behavior your want.
03-10-2010 12:48 PM
Thank you very much for confirming that I'm not going total crazy, yet! You would not believe how many hours I wasted trying to figure out how it would do what it said it should do. I hope that the wonderful folks at NI always verify their examples work before posting them!
OmarGator, Thanks for your much simpler way of doing a buttom latch.
03-10-2010 12:57 PM
A very small style note: consider using XOR instead of the select.
10-11-2014 11:13 AM
so..how to interface the solenoid valve to daq ni usb 6008