Eric,

It is not possible yet for the Array to Cluster node to adapt to the size of the 
output it is wired to.
However in the OpenG LabVIEW Data Tools, there is a VI "Array to VCluster" that 
converts an array into a variant cluster of the same
size of the array. Wire your array to the input of that VI and wire the variant output 
to the "Variant to G Data" primitive and then
to your cluster. When "Variant to G Data" is not wired directly to a typed input (such 
as a tunnel to a structure) the wire may be
broken. Connect a local variable of the cluster to the type input of "Variant to Data" 
node.

Basically, "Array to VCluster" takes the flattened data of the array and formats it in 
cluster flattened data and dynamically
generates the type descriptor of a cluster having the same number/type of elements as 
the array. Flat Data and type descriptor are
then converted into a variant using the primitive "Flattened string to Variant".

You could probably make a subVI out of this piece of code and, using a typedef for the 
cluster, have code that doesn't break when
the cluster size is changed.

Jean-Pierre Drolet
Avensys


Reply via email to