Example Code

Queued State Machine

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

Execution of a sequence based on a queued state machine architecture.

 

Description

This program allows the user to take any amount of states that they want to run, and be able to select what order they want them to run. In the code, you will have a selection screen on the left with a list of states that are available. To add them, and run them in a specific order, click on the desired state then the right arrow. Once all the states are selected, and on the right side of the front panel, press done.

This program only uses dialog boxes with the name of the state selected, but the dialog boxes can easily be replaced with actual code.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code
1. Run the VI.
2. From the Available States, select one and use the right arrow button to add it into the sequence.
3. Continue adding states as desired.
4. If a state needs to be removed, select it on the Selected States control and use the left arrow button to remove it.
5. Stop the VI.

 

Additional Information or References

Capture.PNG

 

Chris Van Horn
Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.