Showing results for 
Search instead for 
Did you mean: 

Get Text Value from an enum as a variant

Go to solution

I want to use a cluster of parameters with which to sent to another application via a DDE link.  The label of each control in the cluster is sent together with the value as text.  Using an array of control references I can get the Label.Text property for each control in the cluster.  The Value is presented as a Variant so I have to convert the data into a string acording to datatype.  I got the datatype from the ClassName property and wired this to a case structure that could convert the data to a string according to type.  This works fine for String (trivial), Digital, and Ring but I cannot work out how to get the string value from a Enum.  I would have thought it would be possible as the String value is part of the data as indicated but the array of Variants indicator.


I would appreciate any help with this.


The attached vi shows what I have got so far.  The Desired output array is a dummy control to show what I want to get from this vi





0 Kudos
Message 1 of 8
Accepted by topic author Ken_Naylor

Hi Ken,

see the modified vi please. If this is not enough, please see also the "OpenG" vi´s.



Message 2 of 8
That's BRILLIANT!! - Thanks.   And so quick
Message 3 of 8

Hi, can I see the solution too? Is the solution for all enums (typedef and not typedef)?


0 Kudos
Message 4 of 8



There was an attachment in the 'Solution' Post from Mike, I don't know where it has gone.  I will have a look to see if I have saved it locally.  It was a long time ago (2008) but you might be lucky.  Without looking at it I cannot determine whether it works for all enums but I don't remember a reason why it wouldn't



0 Kudos
Message 5 of 8

Found the file


(LabVIEW 8.5)



Message 6 of 8

Hello Ken,


it works fine, thank you very much. Smiley Very Happy

0 Kudos
Message 7 of 8

You're very welcome



0 Kudos
Message 8 of 8