LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variants: are they explained in any labview course?

I have discovered that my licence allows me to have access to online training? Do you know if variants are explained in any of the available courses?

0 Kudos
Message 1 of 4
(2,840 Views)

There's not really a ton to them.  There are some cool features for sure but I'm not sure they get much attention in the Core classes other than the basics of "They can be any data type".  The features that work well, and don't work well, come from just trying to use them.  I'd say read up on the help of each function, and look at any shipped examples.

0 Kudos
Message 2 of 4
(2,822 Views)

Here I found some resources (see link below), but right, in the "Core" courses it is not really detailed...

http://www.ni.com/white-paper/4998/en/

 

0 Kudos
Message 3 of 4
(2,812 Views)

What do you want to know?

 

You can convert most data structures to a variant and convert it back to the original data given the original datatype. Here the use is similar to "flatten/unflatten to/from from string". This is useful to create a generic connector where the datatype needs to be variable, for example look at the "data" variant input for nonlinear fitting. See example 2 here for one possible use. Here the variant contains a cluster of a DLB and an integer 1D array to tell the model which parameters are adjustable. Of course any other useful information can be added to the cluster as long as the calling VI and the model agree on the data structure.

 

(One of the more powerful features of variants are variant attributes. Kind of metadata that can be stored and retrieved very efficiently, even if the variant itself is just an empty dummy. (see the links in this idea)).

0 Kudos
Message 4 of 4
(2,809 Views)