LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert an Array of Variants of Enums to an Array of Enums

Solved!
Go to solution

I suppose, you are looking for the now deprecated 

"..National Instruments\LabVIEW 2019\vi.lib\Utility\GetTyp.llb"

 

this .llb can be used like shown in the following example from this source

"GetTypeInfo.vi"and  "GetNumericInfo.vi" can be replaced by the counterpart of the Data Type Parsing VIs

 

2019_enum_to_value.png

 


Something like this, parsing the variant data type, is probably the solution.  But I don't know how to use data types to create an array of enums.  I can create an array of variants of enums, but that is as close as I can get.  

I added a VI to this discussion thread to illustrate my issue more clearly.  

 

Thanks

0 Kudos
Message 11 of 13
(1,063 Views)
Solution
Accepted by topic author BrittonB

The solution was to use flatten to string and flattened string to variant as below.  

The case structure just sets the possible enum representations: U8, U16, U32, and U64.  

An example of the solution is in the attached VI.  It uses OpenG Toolkit and is written in LV2018.  

 

BrittonB_0-1592924614414.png

 

Message 12 of 13
(1,034 Views)

@BrittonB wrote:

The solution was to use flatten to string and flattened string to variant as below.  

The case structure just sets the possible enum representations: U8, U16, U32, and U64.  

An example of the solution is in the attached VI.  It uses OpenG Toolkit and is written in LV2018.  

 

BrittonB_0-1592924614414.png

 


 

 

 

 

 

 

 

 

 

 

 

 

Glad you solved your problem!  I was headed towards a solution involving flattening and unflattening, but I couldn't get home to work on it.  Nice job!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 13 of 13
(1,017 Views)