Day 11: State Machines

NI Self-Paced Online Training

Our next design pattern, called the State Machine, provides a framework for writing applications in terms of states where depending upon current conditions decisions can be made on which state to transition to next.  This is an extremely powerful design patter that will start to allow you to make truly interactive user interfaces for your application.  The LabVIEW Core 1 module Implementing a Sequencer provides a very good introduction to creating state machines in LabVIEW.  It begins by introducing a new structure called the sequence structure, and progresses to discuss state programming, state diagrams, actions, and transitions, and finishes by describing methods for writing state machines in LabVIEW.

Access LabVIEW Core 1 Course  

  • Core 1: 15. Implementing a Sequencer

Today we will also continue learning more of the low-level details of using DAQmx.  Specifically we will look at ways to control when a specific acquisition task starts using a concept called triggering.  The DAQmx module Trigging on a Specific Condition takes a deep dive into this subject.

Access Using NI-DAQmx Course  

  • DAQmx: 3. Triggering on a Specific Condition
State Machines

We start to take a look at some advanced design patterns for top-level VIs that go well beyond the traditional continuous loop architecture.  These patterns provide the LabVIEW programmer with greater flexibility and the ability to write code that is much more responsive to user input.  The first step in this direction involves a patter called a state machine.  The following pages provide additional looks into the state machine design patter as well as a rather new pattern that for sequential code that is a significant improvement over the sequence structure.


The following page provides an additional look at the concept of triggering a data acquisition task when using DAQmx in LabVIEW.

Day 11 Topics

We will look at the Simple State Machine design pattern and will then spend time working on the Thermostat assignment.

Print Friendly, PDF & Email