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: 

extract variant data type for case selection

Solved!
Go to solution

I dont' know much about variant, so I am going to ask as many questions as possible on this topic.  If I have an array of variants, and each of these variant was converted from different data type.  This array will be index to a for loop and each element will be processed in a case structure inside the for loop. 

 

The question is I would like to take the data type from the variant, convert it into enum, and use it to select case on the case structure.  How do I do that?  Or what's the best way to do that?

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 4
(3,638 Views)
Solution
Accepted by topic author jyang72211

www.openg.org

 

"Get TDEnum From Data" VI from the Data Tools package.

 

 

There's also the "GetTypeInfo" VI that's in the <labview>\vi.lib\Utility\VariantDataType folder.

Message 2 of 4
(3,635 Views)

This is so amazing that it makes me want to cry!!  This is exactly what I want.  There are so many functions available.  I need to explore the website that you sent me.  Thank you so much.

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 4
(3,629 Views)

check out also VI package manager. It allows easy install of many openg packages.

 

I have used the write to ini file, from the openg package, that writes a variant to an ini file.

Should have all the code you need.

VI name: Write Key (Variant)__ogtk.vi

located in: C:\Program Files\National Instruments\LabVIEW 2009\user.lib\_OpenG.lib\variantconfig\variantconfig.llb

 

0 Kudos
Message 4 of 4
(3,611 Views)