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: 

stop stacked sequence

Good morning,
 
I'd like to know how to stop a stacked sequnce.
In my program, by clicking a "Start Measurement button" an automatic sequence starts which contains more than 15 steps (some steps contatin also while loops).
I'd like to have the opportunity to abort the sequence once started by clicking an "Abort Measurement" button.
How can I do this?
Thank you
0 Kudos
Message 1 of 3
(4,731 Views)
Hi,

I don't believe it's possible to stop a stacked sequence structure once it starts running, at least not efficiently.

There is a structure that's recommended for this type of application called a state machine. With a state machine you can programmatically determine which state runs next. A state would correspond to a sequence in your stacked sequence structure.

You can have a look at the form a state machine takes by opening a new VI and choosing "New..." from the file menu or "More..." from the (lv8) splash screen. This will open the New dialog box. Browse to VI >> From Template >> Frameworks >> Design Patterns >> Standard State Machine.

A different state of the state machine executes for each iteration of the while loop. The shift register with the eumerated constant determines the next state to run.

The following tutorial has more information on why you would use a state machine and how to build them:
http://zone.ni.com/devzone/conceptd.nsf/webmain/c74cec177a289dbd86256c4e00600196

Let me know if you'd like more information on this.

Kind regards
Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 2 of 3
(4,728 Views)
Thank you, Sarah.
The solution you propose me seems to be perfect.
I should practice a little with time machines algorithm!!!
Bye,
Fede
0 Kudos
Message 3 of 3
(4,723 Views)