Summary: In this lesson, you will learn about making decisions with the Select function.
Every VI described in this course so far has executed in an order dependent on the flow of data. There are cases when a decision must be made in a program. For example, if a happens, do b; else if c happens, do d.
In text-based programs, this can be accomplished with if-else
statements, case statements, switch statements, and so
on. LabVIEW includes many different ways of making
decisions. The simplest of these methods is the
Select function.
The Select function, located on the
Functions>>Express Comparison palette, selects
between two values dependent on a Boolean input. If the
Boolean input s is True, this
function returns the value wired to the t
input. If the Boolean input is False, this
function returns the value wired to the f input.
You used the Select function in the Thermometer VI exercise to determine
whether to output a Fahrenheit value or a Celsius value, as
shown in the block diagram in Figure 1.
![]() |
If the decision to be made is more complex than a
Select function can execute, a Case
structure may be required.
"A full introductory course on programming with LabVIEW."