LabVIEW State Machine
LabVIEW State Machine
blog
LabVIEW
State Machine
Creating LabVIEW Applications using the State Machine Principles
Hans-Petter Halvorsen
LabVIEW
• LabVIEW is a graphical programming language
• LabVIEW has powerful features for Simulation,
Control, Vision and DAQ Applications
Resources:
• https://halvorsen.blog/documents/programming/labview/
• https://halvorsen.blog/documents/teaching/courses/labview_automation.php
2
While Loop
Basic LabVIEW Example
3
Simple LabVIEW VIs vs. LabVIEW Applications
• Typically engineers often create simple LabVIEW VIs
that eventually grow out of control, because they don't
have the proper structure and best practices.
• The solution to this problem is organizing your code
and data in a way that enables modularity, readability,
and reuse.
• Using a state machine approach is a good way to make
it right from the early beginning.
4
State Machine
The state machine is one of the fundamental architectures
LabVIEW developers frequently use to build applications
State Machine
Event Structure
Example
Shift Register
7
Structure your Code!
• Use the State Machine principles
• Use the Project Explorer
• Create and use SubVIs
8
Project Explorer
9
SubVIs
10
https://www.halvorsen.blog
LabVIEW Example
Hans-Petter Halvorsen
12
13
14
Hans-Petter Halvorsen
University of South-Eastern Norway
www.usn.no
E-mail: [email protected]
Web: https://www.halvorsen.blog