LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enumerate does not say enumerated and can't obtain item name using format into string

Hi I am trying to obtain the item name from an enumerated control array. The array is made of enumerated U16. I used the example in the first picture to obtain the data name and it works fine. However, when I try it on my example it just gives the number value rather than the item name. I also notice from the second picture that my array does not say "Enum" anywhere even though it seems like it is, it only says U16. I obtained this data type from a Instrument Driver which I am using to modify on my own so I'm not sure if the Enum type was different in the older versions of labview. Is there anyway to get to change so that it is a proper Enum?

Thank you

enumTostring.PNG

EnumToStringNotWORKING.PNGEnumDoesNotSayEnum.PNG

0 Kudos
Message 1 of 6
(2,623 Views)

You have a Ring, not an Enum.  Drivers typically use the Ring due to localization (an Enum doesn't localize since the text is part of the data type).

 

If you want to get the displayed text, you need to use a property node to get the Strings[] and then index that resulting array with the value of the ring.  Of course, this assumes you are using sequencial values.

 

I have also done translational case structure to convert to/from rings and enums.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(2,612 Views)

Thanks crossrulez,

 

I am trying to use the property node but the String[] option doesn't show up. I'm guessing it's because it is an array of rings. How would I access the string[] property for each element?NoStringNode.PNG

0 Kudos
Message 3 of 6
(2,593 Views)
Don't try and create a property node for the array. Right click on the ring constant itself.
0 Kudos
Message 4 of 6
(2,589 Views)

try.....

Example_VI.png

0 Kudos
Message 5 of 6
(2,568 Views)

As Dennis said, you need to create the property node from the ring that is inside of the array.

 

But here's what I had in mind


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(2,517 Views)