From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop a While Loop Before My Wait Time Elapses in LabVIEW

Solved!
Go to solution

Hi guys,

I have a While loop with a long Wait (ms) time function. My Stop button takes too long to stop my loop. How can I program my Stop button to end a while loop immediately? I appreciate  your efforts in answering my question.

 

Kindly check my Project as a snippet.vi.png

0 Kudos
Message 1 of 5
(2,509 Views)

You need to divide your long waiting time into many small waiting intervals. Then in an additional while loop, wait either until your stop button is pressed or until all waiting intervals have been completed.

 

Regards,

Jens

Kudos are welcome...
0 Kudos
Message 2 of 5
(2,504 Views)

@JensG69 wrote:

You need to divide your long waiting time into many small waiting intervals. Then in an additional while loop, wait either until your stop button is pressed or until all waiting intervals have been completed.

 

Regards,

Jens


 

Dear Jens, thanks a alot for your trial but how can i divide the long waiting time into small interval while it is entered by the user ? 

0 Kudos
Message 3 of 5
(2,473 Views)
Solution
Accepted by Darawish

Here's one idea that comes to my mind:

 

grafik.png

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 4 of 5
(2,453 Views)

A more scalable solution would be a better state machine where you would also add a wait state.

(Also make sure to use correct representations. DBL is incorrect for a wait)

0 Kudos
Message 5 of 5
(2,432 Views)