From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Breaking/Indexing a Sequence structure

Greetings. Is there any way to "break" out of a sequence structure?
Suppose, for instance, I have a 3-frame sequence:
(1) Test a sensor.
(2) Do something.
(3) Report results.

If (1) fails, I don't want to execute (2) or (3). I can do it by having (1)
control a Case, of course, but due to the structure of what I'm doing it
would be much cleaner to be able to Break.

In a related matter, suppose I wanted to execute a Sequence beginning at a
specified frame. Is there a way to have LabView "begin executing this
Sequence at Frame #5 and continue from there?" Again, this could be done
with a Case & While structure, but under most circumstances the code will
operate just like a Sequence so I'd rather not have to manual
ly "step" the
Case index and stuff the whole thing in a While Loop.

Thank you!
Justin Goeres
Indio Systems, Inc.
Pleasanton, CA
0 Kudos
Message 1 of 2
(2,412 Views)
Justin Goeres wrote:

> Greetings. Is there any way to "break" out of a sequence structure?

There is no way (that I know of) to "break" out of a sequence

> In a related matter, suppose I wanted to execute a Sequence beginning at a
> specified frame. Is there a way to have LabView "begin executing this
> Sequence at Frame #5 and continue from there?" Again, this could be done
> with a Case & While structure, but under most circumstances the code will
> operate just like a Sequence so I'd rather not have to manually "step" the
> Case index and stuff the whole thing in a While Loop.

You have come up with the only 2 solutions to the problem.
You can use CASE inside each frame and pass a BOOLEAN
to each (or in your case put a case around step 2 and 3)
or
You ca
n use the CASE - WHILE structure that is essentially
a state machine.
Kevin Kent
0 Kudos
Message 2 of 2
(2,412 Views)