LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reset the state of one switch when another switch is pressed in a VI

I have a START/STOP latching button and a PAUSE/RUN latching button. I would like to be able to reset the PAUSE button when the START/STOP button is pressed. Sometimes the user leaves the PAUSE button latched and then presses the START/STOP button. This then activates only part of the VI.
0 Kudos
Message 1 of 4
(3,497 Views)
You could do this in eoither of two ways. The most straight-forward is the case where you have a state-machine of some sort handling the button presses. All you would have to do is insert a local variable of the Pause/Run button in the case structure that is executed when the Start/Stop button is set to the "Stop" position. The local variable would allow you to force the switch into whatever state you want.

The other possibility is that you might want to do it in a subvi. In that situation you'd need to pass to the subvi a reference to the Pause/Run button and use the "Value" property to turn it off. The disadvantage of this approach is that according to NI using property nodes to set the value of a control is much slower than writing to it directly with a lo
cal variable.

If you have specific questions feel free to follow-up. Also if you could post the pertinent bits of the code in 6.0 format I could give you very specific recommendations.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(3,497 Views)
First of all, latching boolean controls automatically reset themselves after being pressed. Do you mean switching buttons?

Anyway, create a property node for the conrol that you want to reset. When the Start/Stop button changes value (case structure or Event in 6.1) wire the correct value into the "value" property of the property node.

Hope this helps, e-mail me if you need more information.
0 Kudos
Message 3 of 4
(3,497 Views)

is there a good example of this?

0 Kudos
Message 4 of 4
(1,329 Views)