LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait untill button is pressed

Hi,

Is there any function available in LabVIEW which pause the execution untill the button is pressed?

I mean at a stage, i need my program to wait untill the button is pressed, so is there any function available to achieve this.

Kindly guide.

Regards

0 Kudos
Message 1 of 11
(10,684 Views)

Use an Event Structure with only a case for the button you want to press. Wire this in the path of your execution, for example using the error wire. You don't need to do anything in the structure.


GCentral
0 Kudos
Message 2 of 11
(10,681 Views)

Something like this?

Switch until released.jpg

0 Kudos
Message 3 of 11
(10,631 Views)

I usually just do this:

pause.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 11
(10,612 Views)

I meant something like this.

 

evstr-continue.png


GCentral
Message 5 of 11
(10,606 Views)

@cbutcher wrote:

I meant something like this.

 

evstr-continue.png


I do that as well but make sure the "Lock FP ..." option is NOT selected in that event case. If they hit the button twice the FP will lock-up.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 11
(10,594 Views)

What you need is a state machine. One state waits for button presses.

0 Kudos
Message 7 of 11
(10,584 Views)

wfb.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 11
(10,554 Views)

@paul_cardinale wrote:

wfb.png


That would misfire nearly 100% of  the time. assuming there are other controls on the front panel. Also, are you sure that the button state is read after the activity is detected. Most likely you read the stale state from when the loop started.

0 Kudos
Message 9 of 11
(10,545 Views)

@altenbach wrote:

@paul_cardinale wrote:

wfb.png


That would misfire nearly 100% of  the time. assuming there are other controls on the front panel. Also, are you sure that the button state is read after the activity is detected. Most likely you read the stale state from when the loop started.


It works fine.  I've used it many times.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 10 of 11
(10,532 Views)