Case Structure - National Instruments BridgeVIEW User Manual

National instruments bridge user manual
Table of Contents

Advertisement

The Case structure has two or more subdiagrams, or cases, exactly one of
which executes when the structure executes. This depends on the value
of an integer, Boolean, string, or enum value you wire to the external side
of the selection terminal or selector. A Case structure is shown in the
following illustration.
Case statements in other programming languages generally do not execute any
case if a case is out of range. In G, you must either include a default case that
handles out-of-range values or explicitly list every possible input value.
Your objective is to build a VI that checks a number to see if it is positive.
If the number is positive, the VI calculates the square root of the number;
otherwise, the VI returns an error.
1.
Open a new front panel and create the objects as shown in the
following illustration.
The
Number
indicator displays the square root of the number. The free label acts as
a note to the user.
control supplies the number. The
Square Root Value

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BridgeVIEW and is the answer not in the manual?

Table of Contents