LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve enum or ring control type values from TabControl through property nodes

Hi,

 

I am able to retrieve all the values set on my controls within tabcontrol, however I was wondering if for the enum or ring type of controls if instead of getting the numerical value if the text associated with that numerical value can be pulled out instead? For example if I have an enum or a ring type which has 0 = zero, 1 = one, 2 = two, instead of pulling out "0" "1" or "2" depending what the control is set to, if it can retrieve "zero", "one", "two". 

 

My Vi is below, and I don't know what other properties I'll need to do this, if at all possible. 

 

Thanks!

0 Kudos
Message 1 of 4
(2,973 Views)

If you properly get the value out of an enum, you have an enum which has the "string" as the data.  But for rings, you will need to do a lookup using the Strings And Values[] property.


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 4
(2,957 Views)

Yes, it's possible, but requires more work. First you'll have to test the control reference to see if its a ring or an enum. You can do this using the class name or class ID property of the reference. Then you'll need to use "To More Specific Reference" to cast the reference to a reference to the correct type. Finally, you can get the text from that reference using the RingText.Text property.

0 Kudos
Message 3 of 4
(2,952 Views)

Thanks guys,

 

I will have to check on this in a bit. Broke something down and have to fix that before moving to this, but I will take your suggestions. If I can't get it working, I'll return 🙂

 

 

 

 

0 Kudos
Message 4 of 4
(2,927 Views)