From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,069 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,065 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,051 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,046 Views)