LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generic Enum Value to String and back to Enum

Solved!
Go to solution

I'm new to LabVIEW and have Problems with generic writing an Enum to text and reading it back

 

I have Cluster with different Controls. I do not know which Controls!!! But I know there might be a Enum U16 Control on it. How can I write and read the Enum to Text?

 

The problem I have is that I get the displayed text by reading the Value, but I need the Index to write the Value?!

 

 

Simplified Example:

 

PaulPascher_1-1623932143283.png

 

Thanks for any advice or information reference

0 Kudos
Message 1 of 4
(178 Views)

Hi Paul,

 


@PaulPascher wrote:

How can I write and read the Enum to Text?


the classic way uses FormatIntoString/ScanFromString:

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 4
(174 Views)

@GerdW wrote:

the classic way uses FormatIntoString/ScanFromString:


I do not have the Enum! I only have the showen Controles Reference of a Cluster (The Cluster is exchangable) that may contain an Enum

0 Kudos
Message 3 of 4
(160 Views)
Solution
Accepted by topic author PaulPascher

Hi Paul,

 

Variant to Data with an U16 as target type gives you the Enum numeric value:

JensG69_0-1623933471244.png

Regards, Jens

 

Kudos are welcome...
Message 4 of 4
(155 Views)