Learn how to design reusable LabVIEW code with the state machine architecture. Through hands-on exercises, you will learn how to design state diagrams, implement LabVIEW state machines, add new states to existing state machines and change state transition logic.
Implementing state machine design patterns in LabVIEW leads to improved scalability and maintainability of applications over longer periods of time. State machines are used in applications where distinguishable states exist. Each state can lead to one or multiple states, and can terminate the process flow. A state machine relies on user input or transition logic to determine which state to go to next.
This technical manual demonstrates some of the most important concepts when designing state machine architectures in LabVIEW. You will complete exercises to demonstrate the importance of LabVIEW state machines including how to design state diagrams, implement a LabVIEW state machine, add new states to an existing state machine and change state machine transition logic.
LabVIEW Vending Machine
Provided with the technical manual is a LabVIEW applicaiton that will be used during the exercises. The LabVIEW Vending Machine Application is designed to accept change and distribute a soda when the change has reached the appropriate amount. This application was developed using a state machine diagram and LabVIEW state machine architecture. The LabVIEW Vending Machine application has the following requirements:
All Soda products are sold for 50 cents.
The machine only accepts nickels, dimes, and quarters.
Exact change is not needed.
Change can be returned at anytime during the process of entering coins.
The LabVIEW Vending Machine application behaves in a manner to distribute a soda as soon as the deposited amount >= .50 cents. This is not the expected bahavior of a typical vending machine. A typical vending machine would behave in a manner such that a user can deposit as much money as desired and can then make a soda selection that will be delivered if the user has deposited enough money. The exercises will walk you through modifying the state machine to execute in a manner that is consistent with the updated state diagram model. This behavior will be conistent with the bahavior of a typical vending machine.
Adri Kruger National Instruments LabVIEW Product Marketing