LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Putting a flat sequence on repeat without using a loop

Solved!
Go to solution
Solution
Accepted by topic author anotherabby

You basically need one case structure, where every case corresponds to one state. Each state also contains a logic, which decides when and how a transition takes place. For example, if an error occurs inside your "run" state, you can capture this error and a boolean gets the value "true". If the test however is finished without errors then another boolean can get the value "true". Depending which variable changed first, you can programm the logic (for example with a selector) and select the next state to be either "Idle", or "Shutdown". There are many ways to do this and as altenbach mentioned, there are templates available.

The whole case structure should be placed inside a while structure, so that when one state is finished, the new is selected and updates the case structure which runs again. The last state can also be used to stop the while loop, so that the whole VI terminates.

 

And yes, state machines can run for extended periods of time.



Message 11 of 11
(419 Views)