LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use a stop button to exit a sequence before it completes?

I have been using an event case structure within a while loop to allow the user to exit the while loop and execute a subVI.

Now, however, I'd like to use a flat sequence structure to execute a series of steps in order while still retaining the ability to exit the VI and execute a subVI. Some of the steps include relatively long waits, and I'd like to be able to stop these waits prematurely.

Does anyone have any advice on how to do this?  Thanks for any help you can provide.

0 Kudos
Message 1 of 6
(3,219 Views)
Have you considered using a state machine instead of the flat sequence struct?  I think you will find that it is a more robust solution that can be very easy to expand in the future if necessary.
0 Kudos
Message 2 of 6
(3,214 Views)
Thank you for the reply.  Are state machines available in LabView 7.1?  I'm having difficulty finding out information about them in the help index.
0 Kudos
Message 3 of 6
(3,208 Views)

There should, if memory serves, be a template you can use in 7.1 for the statemachine.  Of course, once you have seen the template and are comfortable with it you will be able to create your own.  Try following a path similar to this.  File>>New>>VI>>From Template>>Frameworks>>Design Patterns>>Standard State Machine

 

I dont have access to 7.1, perhaps someone can verify that this is the path to the template in 7.1?

0 Kudos
Message 4 of 6
(3,204 Views)
Thanks for your help - this is available in 7.1 in exactly the location you specified.  I think that you're right that this will be really helpful.
0 Kudos
Message 5 of 6
(3,194 Views)

FYI, there is also this tutorial on State Machines.  It goes over the why/how and gives an example.  Pretty useful.

 

Hope it helps! 

Brian A.
National Instruments
Applications Engineer
0 Kudos
Message 6 of 6
(3,141 Views)