Finn's LabVIEW Goldmine:

State-machine

LabVIEW file:

LLB_state_machine.llb

Picture of Front panel and of Block diagram.

What is it?

It is a state machine for sequential control of the position (of a bicycle). (If you do not know what a state-machine is.) The state-machine is implemented with

  • an overall Case-structure which defines the states and contains the actions of each state,

  • a Shift-register which remembers which state is the active state,

  • internal Case-structures inside each state (Case in the overall Case-structure) together with proper boolean comparison functions implementing the transition conditions.

The state-machine controls a simulated process (bicycle position) given by the following dynamic model:

d(position)/dt = speed

where speed is manipulated by the state-machine. An integrator is used to obtain position as the integral of speed. 

The arrow on a Vertical Pointer Slide is replaced with a picture (an emf-file) of a bicycle. The procedure to substitute any graphical part of an indicator or control on the Front panel is as follows: Right-click on the item (graphical part), e.g. the arrow of a Vertical Pointer Slide. Select Advanced / Customize in the menu that is opened. Click the Tool button in the toolbar of the new window that is opened. Right-click on the arrow on the slider, and select the picture you want. Etc.

How to use it?

Use this VI as a template for your own state-machine controller for any simulated dynamic system. To control a real (physical) process in stead, just substitute the simulated process with read and/or write functions for analog and/or digital I/O (input/output).


[Finn 's LabVIEW Page]


Updated 6 September 2016 by Finn Aakre Haugen