An enumerated type (enum)
is a list of string labels with corresponding integer values. It is handled as an unsigned integer in LabVIEW (U8
- default, and U32
For example, we can have an enum to hold the four weather seasons, in which case we'll have a numeric value for each one: 0-"spring", 1-"summer", 2-"autumn", and 3-"winter".
When you wire an enum to the case selector of a Case Structure
you are able to make different cases for each of the enum's values. To create a case for each of the enum values, right-click on the case structure frame and select Add case for every value.
For example, if the enum holds the four weather seasons, you can have four different cases for each value "spring", "summer", "autumn", and "winter".
Furthermore, you can have multiple enum items in the same case. In the case Selector label, the string values of the enum are represented as strings in double-quotes. If you would like to add multiple items to one case, you can add their names in quotes separated by commas.
For example, if we want our Case Structure to handle Spring and Autumn together, for being equinoxes; and Summer and Winter together for being solstices, we can have: Case 1 - "Spring","Autumn". Case 2 - "Summer","Winter".