Example Code

Object Oriented State Machine using LabVIEW

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
This example is an object oriented state machine. Each state is a class and state transition is handled by the state itself.

 

Description

This code is an object oriented state machine. Each state is a class and state transition is handled by the state itself. The class 'StateMachine' is a holder class for the states and executes the current state (class). This particular implementation runs each state for a certain amount of time and then changes to the next state.

 

Requirements

LabVIEW 2012(or compatible)

 
Steps to Implement or Execute Code

  1. Run the vi.

 

Additional Information or References

State transition graph:

StateTransition.JPG

 

Front Panel

 

Capture.JPG

 

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

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

Contributors