LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Click Button

I have an Exit button (latch on release) which exits my program.  In the button's Value Changed event, I read its value and return it to the stop terminal of the enclosing while loop.

 

I want to programatically fire that event.  However, when I set the "Val(Sgnl)" attribute of the button, I get an error because the button has a latch action.

 

How can I fire that event or "click" the button programatically?

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

Change the mechanical action. You can just reset the value programatically to simulate latching action.

=====================
LabVIEW 2012


Message 2 of 4
(4,865 Views)

You can configure exit button event with User event function and you can keep same event case for both. You can generate this user event anywhere in your code

PBP
Labview 6.1 - 2019
0 Kudos
Message 3 of 4
(4,844 Views)
Another option here is use a queued state machine. When you press exit you go to the exit state(s) to quit. Now that you have created the state you can queue it up when a button is pressed, when an error or any other programmatic event occurs, etc. This gives you an expandable architecture without the complexity of user events or the mysterious value signaling property node which I have pretty much sworn off by now. Its tough to inherit code where suddenly events are firing due to value signaling property nodes that I overlooked. In my opinion its much easier to follow queues.
0 Kudos
Message 4 of 4
(4,837 Views)