02-07-2023 08:53 PM
I have a for loop inside a while loop in a VI. The while loop is there so the user can select some Boolean options on the front panel and navigate to some file directories. Then once everything is setup, the user hits a button, which executes a for loop and "post processes" the tdms files in the directory the user selected. My problem is, once the for loop is finished, it just starts over again and starts processing the files over again.
I want the the entire while and VI to stop, once the for loop is finished. How do I do that?
Thanks!
Adam
02-07-2023 09:35 PM
Add an OR node before the conditional terminal to capture the Boolean value from the Stop button and a True value from the For Loop.
02-08-2023 07:25 AM
Move the for loop out of the while loop so that when "the user hits a button" the while loop stops, and you move on to running whatever is in the for loop (may not even need the for loop if it's only executing once), once that stuff executes the VI is complete.
02-08-2023 08:46 AM
Another (better?) option is to create a simple state machine.
02-08-2023 08:48 AM
Can you elaborate on how to create a simple state machine?
02-08-2023 08:52 AM
WolfmansBrother - thanks for uploading an example VI. I only have LabView 2019, so can you upload a 2019 version for me?
Thanks!
02-08-2023 08:54 AM
let me google that for you...
https://labviewwiki.org/wiki/State_Machine
02-08-2023 08:57 AM - edited 02-08-2023 08:58 AM
Resources to look at would be
- NI Simple State Machine Template
or google "labview state machine"
02-08-2023 09:00 AM
here ya go
02-08-2023 09:19 AM
Yep, I guess I could have googled that. 🙂