02-26-2021 10:36 AM - edited 02-26-2021 10:45 AM
@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...
02-26-2021 10:39 AM
@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.