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: 

facing issue in closing the while loop in Wait

Hello all

 

I am using the attached VI for reading the data from the serial port every 5 sec but I am pressing the Stop button I am waiting for 5 sec to close the while loop anyone please let me know how I can stop the while loop when pressing the stop button without changing the wait timing 

 

any answer will be appreciate 

0 Kudos
Message 1 of 2
(739 Views)

You need to start with some basic LabVIEW tutorials because you code has so many glaring mistakes that it is not possible to easily solve your problem(s). Learn about proper state machine architecture. Look at the shipping examples and templates. Learn that index array is resizeable. Learn how to use event structures (they don't belong on the toplevel diagram or buried deep inside sequences! You have both! You only need one!). Learn how to avoid sequence structures. Learn about this function. Never operate on paths as strings. Do more error handling, etc.

 

(Your stop button is read first thing in each iteration, so if it is pressed right after that, you'll get one additional iteration.)

 

 

0 Kudos
Message 2 of 2
(695 Views)