06-07-2014 08:34 AM - edited 06-07-2014 08:40 AM
I have some code inside a flat sequence, and I entered the flat sequence inside a while loop. The thing is that I don't know how to restart the flat sequence, so that in the last frame, it goes back to the first frame and restarts the process until the program is stopped.
Can someone please tell me how to do this?
Thanks in advance!
I forgot to mention that I need to execute the code in a sequence, and I can't use a state machine, because my code doesn't work with user input, so please suggest another method.
Solved! Go to Solution.
06-07-2014 09:40 AM
You put a while loop around the flat sequence.
I don't understand your reasoning for not being able to use a state machine. I guarantee a state machine architecture is possible and would be a better implementation then a flat sequence.
06-07-2014 11:10 AM
Is there a way to reset the probes programatically so that they return to a null value, when the app reaches the end?
06-07-2014 11:29 AM
What probes are you talking about???
06-07-2014 11:30 AM
What probes are you talking about?
Yes. That would just be a final case of the state machine (clean up, shut down) that you execute right before stopping the while loop.
06-07-2014 11:31 AM - edited 06-07-2014 11:34 AM
I have another question:
I already tried to make the flat sequence repeat by using a while loop with a shift register, so that when it executes 1 time, the while loop is restarted.
This works fine the first 2 times, but it then stops repeating.
How can I make it repeat forever, so that when it reaches the end of the sequence, the while loop is restarted and the whole app executes in an infinite loop?
Forget about the probes, I just found the answer.
06-07-2014 11:35 AM
If you want an infinite loop, then you need to wire a False constant to the stop terminal of the while loop. I don't recommend that because even an "infinite" loop you will want to stop eventually.
Figure out why your while loop only ran twice. There must have been something you did that caused the boolean value going to the stop terminal to be True after the 2nd iteration.
The questions you are asking are about some basic LabVIEW programming skills.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
06-07-2014 11:38 AM
06-07-2014 11:52 AM
Nando88 wrote:I forgot to mention that I need to execute the code in a sequence, and I can't use a state machine, because my code doesn't work with user input, so please suggest another method.
User input has nothing to do with whether or not you can use a state machine. State Machines are wonderful for sequencing.
What probes are you referring to?