09-05-2015 07:31 AM
Hi guys.
I want to create a sequence that is controlled by an input button for example a "NEXT" button that will commence a set of instructions assigned in step 2 of a sequential structure. Something like we see in an installation of a software.
Can somebody direct me in the right direction?
Solved! Go to Solution.
09-05-2015 08:28 AM
Google for "state machine LabVIEW" and also search here the forum. If you meant you want to use the "Flat sequence structure" or the "stacked sequence structure", you do it wrong. Use a proper state machine.
What you describe is easily managable using a State Machine, and you can do much more with it. For example you can have a "Next" and a "Cancel" button, and depending on the user's choice, the state machine will go into a different state. In case of the Next button, it will start to do some operations for example (which operation should be anytime abortable ("Abort" button), in a short time, this is also a benefit of a good state machine), and for the Cancel button the State Machine will go into an "Idle" state, waiting for new user commands, and so on...
09-05-2015 08:51 AM
This is an easy way to make a sequence. The first case will wait until the Next boolean changes, you put whatever you need in subsequent cases and a True constant to stop the While loop.
09-05-2015 09:43 AM
What's the purpose of this?
If you want to use a sequence, the sequence structure already exists. Re-creating it with a while loop and case structure doesn't really provide added benefit. If you want flexibility, you should be developing a state machine. In neither case would it make sense to create this structure.
09-05-2015 01:31 PM - edited 09-05-2015 01:32 PM
A Sequence structure can't exit early; mine can.
You can add a shift register and pass data between states, an ugly idea with a Sequence structure.
My suggestion is a mini-State Machine, yours uses the oft-vilified Sequence structure.
09-05-2015 02:36 PM
09-05-2015 10:30 PM
09-08-2015 12:31 AM
It worked! Thanks guys for the pointers!