LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Text Value from an enum as a variant

Solved!
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

 

Ken

 

 

0 Kudos
Message 1 of 8
(6,215 Views)
Solution
Accepted by Ken_Naylor

Hi Ken,

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

 

Mike

Message 2 of 8
(6,214 Views)
That's BRILLIANT!! - Thanks.   And so quick
Message 3 of 8
(6,202 Views)

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

Thanks.

0 Kudos
Message 4 of 8
(5,246 Views)

Hi

 

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

 

Ken

0 Kudos
Message 5 of 8
(5,241 Views)

Found the file

 

(LabVIEW 8.5)

 

Ken

Message 6 of 8
(5,231 Views)

Hello Ken,

 

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

0 Kudos
Message 7 of 8
(5,216 Views)

You're very welcome

 

Ken

0 Kudos
Message 8 of 8
(5,210 Views)