LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Stop a While Loop Before My Wait Time Elapses in LabVIEW

Solved!
Go to solution
Highlighted

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
(165 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
(160 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
(129 Views)
Solution
Accepted by topic author Darawish
02-15-2019 07:54 AM

Here's one idea that comes to my mind:

 

grafik.png

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 4 of 5
(109 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)


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 5 of 5
(88 Views)