LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically load control from variant data at runtime to read binary file


@Mickaël_Phalanx wrote:

The problem is still the same:

I don't know how the variant is build, so I can't use the "variant to data" function.

I only have a variant as an input.

 

Get the type.

 

If it's a cluster or an array, convert to an array of clusters.

 

So, start with a variant.

If it's a scalar, get the flattened data.

If it's a cluster, loop over the elements.

 

The only piece  of information missing was to build a cluster back from an array of cluster elements...

0 Kudos
Message 11 of 12
(531 Views)

@Mickaël_Phalanx wrote:
What I would like to do is to build dynamically the cluster constant according to the data type store in the variant, that would be extracted with the recursive VI just in case there are nested structures.
 
Or, is there maybe another way to reach the same result ?

Not with controls as input.

 

You can make VIs that parse the data, that would avoid the problem altogether.

 

You'd start the VI, it will parse the data the simple way with the strongly typed control\constant type, and the output would be the control or variant.

0 Kudos
Message 12 of 12
(529 Views)