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
(1,048 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 LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(1,044 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
(1,030 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
(1,025 Views)