The State Machine is one of the fundamental architectures LabVIEW developers frequently use to build applications quickly. State Machine architecture can be used to implement complex decision-making algorithms represented by state diagrams or flow charts.
State Machines are used in applications where distinguishable states exist. Each state can lead to one or multiple states, and can also end the process flow. A State Machine relies on user input or in-state calculation to determine which state to go to next. Many applications require an "initialize" state, followed by a default state where many different actions can be performed. The actions performed can depend on previous and current inputs as well as states. A "shutdown" state can then be used to perform clean up actions.
This vi uses State Machine architecture to perform the functions of a Coke machine.