LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Move back and forth between frames in a sequence.

I am developing a program that is a sequence with many frames (40 so far).  In each frame there is a VI that I have created.  Each of these VIs has an input terminal to which I wire a string constant that asks the user a question or gives the user a command.  There are either one or two output terminals on these VIs.  When there are two output terminals.  The VI will feature two LEDs that signify either a true or false outcome.  When there is one terminal, there is only one LED that signifies that the user has read and understands the command or instructions that were given.  Their are basically three types of VIs:

 

1) In the first type, the user is required to enter a numeric answer and press a "next" button in response to the question in the string constant.  At that point, the number entered is compared with a desired range or set of acceptable values.

 

2) In the second type, the user answers the question in the string constant by clicking either the "yes" button or "no" button.

 

3) In the third type, the user is required to enter a "next" button to acknowledge understanding or completion of the command that appears in the string constant.

 

I would like to create two additional buttons on each of these VIs.  One that will move the program back to the previous frame in the sequence and another that will move the program forward to the next frame in the sequence.  I basically need to create a "back" button and a "forward" button that will allow the user to advance or return to specific frames in the sequence without restarting the program.

 

I haven't the slightest clue how to do this.  Can anyone help me out?
0 Kudos
Message 1 of 4
(3,445 Views)
Don't use a sequence structure.  You cannot move backwards to a previous sequence.  Instead, use a state machine.  Search for examples in Labview.  Basically, a state machine is a case structure with some variable containing the next state wired to its input selector terminal.  Each of your frames can be put into a case.  Your code can decide which is the next case to call.  A queue is excellent for holding the next case to be called.  See the attached example for a Queued State Machine.
- tbob

Inventor of the WORM Global
Message 2 of 4
(3,440 Views)
How did you get the ? box on your case structure to turn pink?
0 Kudos
Message 3 of 4
(3,403 Views)
It's green if you wire a Boolean to it, blue if you wire a numeric or enum to it, and red if you wire a string to it. And, you can wire an error cluster to it. In that case Smiley Very Happy, you have a green case called No Error and a red case called Error.
0 Kudos
Message 4 of 4
(3,399 Views)