Programmatically Index Through an Enum, Text, or Menu Ring

Updated Nov 6, 2023

Reported In

Software

  • LabVIEW

Issue Details

Is there a way to programmatically index an enum, text or menu ring?

Solution

Yes you can programmatically index an enum, text, or menu ring. An easy way to do this is to type cast the iteration terminal of a While or For Loop to the enum, text, or menu ring that you want to index.

Note: The iteration terminal is an I32 and enum, text, and menu rings are of type U16 by default.

Method 1:
The first method is just to place a To Unsigned Word Integer VI (U16) before wiring the iteration terminal into the type cast.

Method 2:
You can change the representation of the enumerator to U32. You can change the representation from the Data Type tab in the Properties of the enumerator.

Refer to the Attachments for an example VI that shows how to index through an enumerator using these methods.