10.9. Finite State MachineΒΆ

The concept of the finite state machine (FSM) is very common and powerful tool for modeling a system in all branches of engineering and computer science. A system or machine is said to have state when it responds to its input in different ways at certain times. The state is often defined according to the behavior or action that it is currently performing. The FSM can only be in one state at a time. Some states may only be entered from certain other states. In some cases, the system may transition from a set of states in a linear sequence.

In LabVIEW, an FSM is implemented with an Enumerator inside a loop. The control variable to the case structure is an enumerator, which defines the different states. Inside the case structure, we place other instances of the enumerator along with any needed selection code to select the state of the FSM in the next loop iteration. Thus, the next state value uses a shift register.