LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

initialization with loops

I am trying to re-run a test once I get to the "ENDEND" case statement. When the "Run Test File" is turned "off" then "on" on the control panel, the test should run again. How can I achieve this as I have several nested loops?

Also, how can I reinitialize all the outputs from the case statements to zero once the "Run Test File" is off?

See attached picture

Thanks for the help!

 

 

 

0 Kudos
Message 1 of 4
(3,174 Views)

If you have a proper State Machine, you should not have nested loops.  You just sequence through the states until you see a condition to go to a different state.  I recommend making a state chart before you start doing any coding.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(3,169 Views)

I actually mean that I have case structures inside others, my main loop is a while loop.

0 Kudos
Message 3 of 4
(3,121 Views)
It's good to go with state machine as suggested by crossrulz...

Your program should be in such a way that it initialise with the required input and if required make default values before going to actual run state...
once the run state is completed it should go to off state...
once it reaches off then take a decision, whether you need to run the test again, if so make the decision to go to initialize state again...
it should continue like above until it's satisfy your number of run test..... Then you can close the application....

If my understanding regarding your requirements is correct...this will help you...
0 Kudos
Message 4 of 4
(3,106 Views)