FIRST Robotics Competition Blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structure Snippet

Whit-E_Wall-E
NI Employee (retired)

We can use the Case Structure in LabVIEW to make decisions based on an input to the Case Selector (the "?").  For example, if we wire a boolean value to this Case Structure, we can choose to run one algorithm if it is a true value, or another algorithm if it is false.

This snippet demonstrates how we can make decisions based on the value of a numeric control.  In this case, we can choose a different combination of LED values for five different ranges:

Less than or equal to 2

3 through 10

11 through 20

21 through 30, or

31 or greater.

This can be used, for example, to display more LED's to the driver when the vehicle's velocity is greater.  Note how you can change the range of values represented by each in case in the Case Structure.

Case Structure.png

Regards,

M. Whitaker
ni.com/support