Enum Constant

From LabVIEW Wiki
Jump to: navigation, search
Object information
Owning palette(s) Numeric palette
Type Constant
Requires Basic Development Environment
Icon Functions - Numeric Palette - Enum Constant.png

Use the Enum Constant to create a list of string labels with corresponding integer values you can select on the block diagram.

The enumerated constant is similar to a Ring Constant, but you cannot customize the corresponding numeric values for the string labels in an enumerated constant. The numeric value is always an integer from zero to n – 1, where n is the number of values in the enumerated constant.

Unlike the ring constant, the labels associated with an integer value are part of the data type. If you pass the value from an enumerated constant to an indicator, LabVIEW displays the string label instead of the numeric value.

The enumerated constant is only visible on the block diagram and cannot be viewed on the front panel. You also cannot change its value at run time, so you should select a value from the enumerated constant before you run the VI. Use an enumerated type control to allow the user to select an enumerated value from the front panel at run time.

You select, add or remove, and rearrange values in enumerated constants much the same way you do for ring and enumerated controls.

By default, the numeric representation of an enumerated constant is a 16-bit unsigned integer. You can change the representation of an enumerated constant to any unsigned integer data type except for an unsigned 64-bit integer data type.



Version Change(s)
LabVIEW 2018 More info to come.

See Also

External Links