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.

Example Code

Simple State Machine Based on Dialogs

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

Download All

Overview: State Machine example, using dialogs to communicate with user.


Description: This VI is an example of a very simple state machine.  Based on user input, the program progresses through different steps.  Booleans indicate at which point variables are updated throughout the code.  You might use something like this if you would like to move through different steps based on the results of data acquired or user input.


Requirements: LabVIEW 2012 (or compatible). Hardware: none. 


Steps to Implement or Execute Code:

1. Run the VI.
2. Follow the dialogs and indicators.
3. To stop the VI, choose "cancel".


Additional Information or References:

 

Simple State Machine_FP.png

 

Simple State Machine_VI BD.png


**This document has been updated to meet the current required format for the NI Code Exchange.**

 

 

 

 

 

Marti C
Applications Engineer
National Instruments
NI Medical

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

Comments
Todd S.
NI Employee (retired)
on

Thanks for posting.  Could you please rename your attachment to include the LabVIEW version?

Todd S.
LabVIEW Community Manager
National Instruments