08-06-2020 01:31 PM
Hello,
I am pretty new to labview. I am using a flat sequence inside a while loop. there are 2 sequence. the first sequence will have wait time for 3 sec and next sequence will have wait time for 7 sec. Now I have attached a stop control button. Now when i run the vi, and let say i want to stop the program using the stop button for while loop, i cannot stop the vi.
how do i make a control to stop the program at anytime??
Solved! Go to Solution.
08-06-2020 02:15 PM
08-06-2020 02:42 PM
As GerdW said, a state machine is an appropriate approach. You only need one loop, and the state machine does the sequencing (no sequence structure). You use small wait times and exit the wait state when you reach your total wait time.
08-07-2020 01:56 AM
A sequence works similar to a sub-vi in that nothing can happen until it's finished. So your stop button probably works, but it'll wait the 10 secs (or <=20 if it reads the stop button at a bad time) Before it stops.
As mentioned, a state machine is a good solution to these needs.
08-07-2020 12:19 PM
Since you are "pretty new" to LabVIEW, I would immediately ditch the use of sequence structures, and learn how to enforce dataflow correctly. Here is a link to help you get started. Depending on sequence structures to enforce dataflow is a habit you have to immediately unlearn.
08-08-2020 09:20 PM
Thank you everybody. The used state machine and it works fine very efficient.