LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

button press problem

I use several buttons to control a state machine.  Pressing each of them will lead to a different state.
My problem is that the button will show pressed (grey) all the time after it is pressed once. It can recover until it is pressed again. In my case, it will execute that state again.
It won't affect the performance of the program but really looks uncomfortable.
Is there any way to set the behavior of the button. I wish it could show pressed only when I press the mouse down and recover after I release.
Please give me some suggestion. Thanks.
0 Kudos
Message 1 of 4
(2,783 Views)

Try the mechanical action setting of "Switch Until Released".  That should give you the behavior you describe (being toggled while the mouse button is held down, but being released after releasing the button).

-D

0 Kudos
Message 2 of 4
(2,775 Views)
Two issues. 1) you can set the mechanical action of the button by right-clicking it while in edit mode. It sounds like you want "Latch Until Released" but I'd recommend working with "Latch When Released" unless you are specifically looking for the other effect. 2) the control actually has to be in the loop so that it can be unlatched. If the control isn't in the loop, it will depress when you click it, but then just sit there till you click it again. The events will be triggered, but it won't respond the way you want. If you are using the event structure, try dropping the control into the case where it executes if you don't need it somewhere else.

Chris
Message 3 of 4
(2,775 Views)

I have tried Chris' method and moved the control buttons into the loop. It works.

Thanks a lot!

0 Kudos
Message 4 of 4
(2,741 Views)