Escolar Documentos
Profissional Documentos
Cultura Documentos
TOPICS
A. Using Sequential Programming
B. State Programming
C. State Machines
ni.com/training
A. Using Sequential Programming
• Many of the VIs you write accomplish sequential tasks
• There is nothing in this block diagram to force the
execution order of these tasks - any one of these tasks
could happen first
ni.com/training
A. Using Sequential Programming
ni.com/training
A. Using Sequential Programming
To force execution order, use a Sequence structure
• A structure with frames, where each frame executes in order
• The second frame cannot begin execution until everything in the first
frame completes execution
ni.com/training
A. Using Sequential Programming
ni.com/training
A. Using Sequential Programming
ni.com/training
B. Using State Programming
ni.com/training
B. Using State Programming –
State Transition Diagram
Type of flowchart that indicates the states of a program and
transitions between states
ni.com/training
8
B. Using State Programming –
State Transition Diagram
Furnace
Example:
ni.com/training
9
C. State Machines
ni.com/training
C. State Machines – Infrastructure
While Loop
ni.com/training
C. State Machines –
Transition Between Two States
ni.com/training
C. State Machines –
Case Structure Transition
ni.com/training
C. State Machines –
Transition Array Transition
ni.com/training
Course Project
DEMONSTRATION
Exercise 8-1
State Machine VI
DISCUSSION
Summary—Quiz
1. When using a Sequence structure, you can stop the execution
part way through a sequence.
a) True
b) False
ni.com/training
19
Summary—Quiz Answer
1. When using a Sequence structure, you can stop the execution
part way through a sequence.
a) True
b) False
ni.com/training
20
Summary—Quiz
2. Which of the following are benefits of using a state machine
instead of a sequential structure?
a) You can change the order of the sequence
b) You can repeat individual items in the sequence
c) You can set conditions to determine when an item in the
sequence should execute
d) You can stop the program at any point in the sequence
ni.com/training
21
Summary—Quiz Answers
2. Which of the following are benefits of using a state machine
instead of a sequential structure?
a) You can change the order of the sequence
b) You can repeat individual items in the sequence
c) You can set conditions to determine when an item in the
sequence should execute
d) You can stop the program at any point in the sequence
ni.com/training
22