Programming Structures: Labview Has The Equivalent of Several Programming Structures
Programming Structures: Labview Has The Equivalent of Several Programming Structures
Do
Execute Sub diagram
While condition is TRUE
•While Loop checks condition at the end of the loop.
•The loop executes at least once.
•The loop counter contains the number of times the loop has executed.
Updated 1/31/05 OPSE 310 - Week 2
For Loop
In LabVIEW 7, put a WHILE
Loop Counter N - Count Terminal loop on block diagram and then
Numerical Input
change to FOR loop
I - Iteration Terminal
Numerical
Output
Grey Dot
1 0 .0 0
Initial
Value
New Last
Previous Value
Value Value
FeedBack Example
Execute code
ELSE
Execute Code
And CASE SELECT structures
CASE SELECT var 0 , D e fa u lt
var=1, do code1
var=2, do code2 var
var=3, do code3
otherwise, do code
List : -1, 4, 6, 9
Range: 12..25
Range: ..0 (all numbers less than or equal to 0)
Combination: -1, 0..5, 8
Strings: “ON”
0 [0 ..1 ] 1 [0 ..1 ]
1 0 .0 0
Task 1
var
Inputs Output
Example