From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enumerated Type control

Is there a way to retrieve the string from a wire coming from an
Enumerated Type control? Case statements do this, but how do I pull out
the string?

I'd like to avoid using the control's Strings [] attribute node with an
Index Array to get the string. Any way to do this?

Chris
0 Kudos
Message 1 of 2
(2,998 Views)
> Is there a way to retrieve the string from a wire coming from an
> Enumerated Type control? Case statements do this, but how do I pull out
> the string?
>
> I'd like to avoid using the control's Strings [] attribute node with an
> Index Array to get the string. Any way to do this?

There are three ways to get the strings. The first way is to use
the attribute node like you mention. A second way is to use the
Format into String node with the %s specifier. This will do one
value of the enum at a time. The third way is to flatten the
enum into a string and parse the type information that comes out
of that node. I'd definitely recommend the first or second methods.

Greg McKaskle
Message 2 of 2
(2,998 Views)