From the course: Learning LabVIEW

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

State machines

State machines - LabVIEW Tutorial

From the course: Learning LabVIEW

Start my 1-month free trial

State machines

- [Instructor] Although a simple series of sub-VIs wired together sequentially can do a lot, there will be times when you need more control over the flow of execution. What if you need to dynamically reorder how parts of your program execute if a certain condition occurs? Or perhaps repeat a certain part of the sequence several times. A common and very useful way to structure LabVIEW programs is using a design pattern called a finite state machine. The state machine consists of the set of possible states the program can be in and the transition conditions to move execution from one state to the next. For example, consider a simple program with a button that takes a measurement when the user presses it. That program might have two states. An Idle state, which checks to see if the user pressed the button, and another state that acquires a Measurement Value. When the program starts it enters into the Idle state. If it sees…

Contents