To download NI software, including the products shown below, visit ni.com/downloads.
Overview
Coding that exemplifies how to convert an integer into an enum.
Description
This example shows two methods of converting an integer to its enum equivalent. The first method uses the Variant to Data VI and the second uses typecasting.
Requirements
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
1. Insert a number in the numeric control within the enum amount of items
2. If desired, change the items of the Reference Enum.
3. Run the VI, and observe the Enum indicators.
Additional Information or References
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
For method 2: you should look at the Representation (U32, U16 or U8 for enums) of your enum and use that before the type cast