LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get the type of the data in a variant

Solved!
Go to solution

@rolfk wrote:

I was deliberating with myself for a while if I should post this. But here it is. It's literally the exact thing that was asked for initially.

 

Get Variant Text.png

Warning:

 

This is calling an officially undocumented LabVIEW function. It should be present since around LabVIEW 8.20 or so. As an undocumented function NI has the right to change or remove this function at any point in the future and it may therefore crash, sing a lullaby or or eat your hard drive if you are unlucky. Test very well before you decide to use this in anything but experimental code!


When I try it with LV2018, 2019, 2020, 2021 (all 32-bit), attempting to get the data throws error 1097, attempting to get the type always returns "void".

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 21 of 27
(1,018 Views)

@paul_cardinale wrote:

@rolfk wrote:

I was deliberating with myself for a while if I should post this. But here it is. It's literally the exact thing that was asked for initially.

 

Get Variant Text.png

Warning:

 

This is calling an officially undocumented LabVIEW function. It should be present since around LabVIEW 8.20 or so. As an undocumented function NI has the right to change or remove this function at any point in the future and it may therefore crash, sing a lullaby or or eat your hard drive if you are unlucky. Test very well before you decide to use this in anything but experimental code!


When I try it with LV2018, 2019, 2020, 2021 (all 32-bit), attempting to get the data throws error 1097, attempting to get the type always returns "void".


Sure! Try the next attempt I posted today.

Rolf Kalbermatter
My Blog
0 Kudos
Message 22 of 27
(1,015 Views)

@rolfk wrote:

That's what you get for quickly posting without in depth tests. This one works on my system. I had been using this function in some experimental C code a while back and quickly transferred it to a VI. 

 

 


Very nice.

This is how I would style it.

"If you weren't supposed to push it, it wouldn't be a button."
Message 23 of 27
(982 Views)

@paul_cardinale wrote:

@rolfk wrote:

That's what you get for quickly posting without in depth tests. This one works on my system. I had been using this function in some experimental C code a while back and quickly transferred it to a VI. 

 

 


Very nice.

This is how I would style it.


Everybody has his own preferences. 😀

 

I find the use of the classic palette for non user facing VI front panels still the best. They are always working without relying on any external model descriptions, complicated alpha shading and what else. Sure, with them not being visible usually, it won't matter much anyways, but then why bother to restyle an existing panel?

 

As mentioned, this is an undocumented function. It can be dangerous to use that in production type code.

Rolf Kalbermatter
My Blog
0 Kudos
Message 24 of 27
(974 Views)

This is awesome, thank you! Btw can you share from where did you get the function prototype? There are a lot of useful looking ones there.

0 Kudos
Message 25 of 27
(683 Views)

@ImreSzebelledi wrote:

This is awesome, thank you! Btw can you share from where did you get the function prototype? There are a lot of useful looking ones there.


No I can’t. Or in other words if I tell you I’ll have to shoot you. 😀

And no the names may sound sometimes exciting but many do not work usefully when called from the LabVIEW diagram. They are there so the LabVIEW compiler can refer to them but they require parameter types that are not accessible from a LabVIEW diagram.

Rolf Kalbermatter
My Blog
Message 26 of 27
(669 Views)

It is a shame but understandable. Thank you for letting me know! [: 

0 Kudos
Message 27 of 27
(643 Views)