Lab 1
Lab 1
Getting Started
Right click the first input of the Add function and select CreateConstant.
Right click the constant and select RepresentationI32. This changes the numeric
representation of the constant to a 32-bit integer, also known as a long.
Control
Controls = inputs
Indicators = outputs
Block Diagram
Graphical code
Controls Palette
Control:
Numeric
Customize
Palette View
Indicator:
Numeric Slide
Structure:
While Loop
Dataflow Programming
Block diagram execution
Additional Help
Right-click on the VI icon and choose
Help, or
Choose Detailed help on the context
help window
Documentation, and so on
Loops
While Loop
While Loop
For Loop
Drawing a Loop
2. Enclose code to be repeated
1. Select the structure
Exercise 1
Make a very simple clock to count the seconds for a minute.
Exercise 1
Make a very simple clock to count the seconds for a minute.
Case Structures
FunctionsProgrammingStructuresCase Structure.
2.
Select
(a)
(c)
FunctionsProgrammingComparisonSelect.
(b)
Case Structure
The case structure has one or more sub diagrams, or cases, one of
which executes when the structure executes. The value wired to
the selector terminal determines which case to execute and can
be Boolean, string, integer, or enumerated type.
Functions Programming Structures Case Structure.
Select
Returns the value wired to the t input or f input, depending on the
value of s. If s is TRUE, this function returns the value wired to
t. If s is FALSE, this function returns the value wired to f. The
connector pane displays the default data types for this
polymorphic function. It is found at
Functions Programming Comparison Select.
Exercise 2 XOR
Create a VI with two Binary inputs (Buttons), and a Binary
output (LED) which simulates the XOR, with JUST using Case
Structures.
Hint: You may use more than one case structures.
XOR Table
Input 1 Input 2
0
0
1
1
0
1
0
1
Output
0
1
1
0
Create SubVI
Enclose area to be converted into a subVI
Select EditCreate SubVI from the Edit menu