LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to skip sequence?

How can we skip the sequence? For instance, we have four steps in a sequence (0,1,2,3) and we will have inputs for these steps to check TRUE FALSE, if inputs are false so it goes as normal sequence and if any of inputs is TRUE so it will skip all the other steps go to the last step and get out the sequence.
0 Kudos
Message 1 of 3
(5,268 Views)
You can't just skip a Sequence, hence the name Sequence; however, you probably ought to change from a Sequence structure to a Case structure. But, if you must keep the Sequence structure, add a test (e.g. Equal.VI?) wired to a Case (the Case has all the original sequence contents inside it) inside EACH Sequence to determine if that sequence needs to run or skip.
I'd prefer my 1st option of just using Cases. You also have what is the basis for a State Machine design, but that may be beyond what you really need, for now.

Good luck with it,
Doug
Message 2 of 3
(5,268 Views)
The best way is to use the state machine. In this case you have to replace the sequence structure with the loop and case structure inside.
Another way is to organize each step as a SubVI with logical input and output. Then you have to organize them in such a way:

bool SubVI(bool input, bool output)
{
if input=true then output=true
else
{
do something;
output=false;
}
return output;
}

This is the same as all LV VIs with ErrorIn and ErrorOut nodes are organized.
Then you just have to wire your SubVIs in line and connect their inputs and outputs.

Oleg Chutko
0 Kudos
Message 3 of 3
(5,268 Views)