Summary: In this exercise, the objective is to use the Case structure in a VI. Complete the following steps to build a VI that allows the user to analyze data for limit testing and to determine the highest value.
![]() Figure 1 |
Controls>>All Controls>>Decorations
palette, on the front panel. This decoration visibly
groups the Analysis items.
Power Boolean
switch. Label the new switch
ANALYSIS. Right-click the switch and select
Mechanical Action>>Switch When Pressed from
the shortcut menu.
Controls>>Numeric Controls palette, on the
front panel. Label the control High Limit.
Controls>>LEDs palette, on the front
panel. Label the indicator Warning.
Controls>>Numeric Indicators palette, on
the front panel. Label the indicator High
Value.
Visible
Items>>Digital Display from the shortcut menu to
display the digital values.
File>>Save As to save the VI as
Temperature Control.vi in the
C:\Exercises\LabVIEW Basics I directory.
While Loop to
create space for the new items.
![]() Figure 2 |
Place the Case structure,
located on the Functions>>Execution Control
palette, on the block diagram. Wire the
Analysis control to the
selector terminal. Click the
decrement or increment button
to select the True case.
Greater?
functions, located on the Functions>>Arithmetic
& Comparison>>Express Comparison palette, on
the block diagram. This function returns
True if the temperature exceeds High
Limit. Otherwise, the function returns
False.
Place the Select
function, located on the Functions>>Arithmetic
& Comparison>>Express Comparison palette,
on the block diagram. This function returns the
greater of the two input values.
decrement or
increment button to select the
False case.
False case of the Case
Structure, shown in Figure 3.
![]() Figure 3 |
Warning Indicator and select
Create>>Constant. Use the
Operating tool to change the Boolean
constant to False.
High
Value indicator and select
Create>>Constant. Enter -99999
for the value of the constant.
80 in
High Limit, and run the VI.
If ANALYSIS is off, the VI turns off the
Warning LED and displays a value of
-99999 for High Value.
If ANALYSIS is on, the VI turns on the
Warning LED when the temperature is above
High Limit and displays the current
High Value.
Comments, questions, feedback, criticisms?
"A full introductory course on programming with LabVIEW."