01-26-2022 12:03 AM
I have a large cluster of clusters. All of the clusters are numeric but do vary between doubles and integers. In my particular case the cluster contains 12 clusters of different sizes. In total, the clusters contain 166 numbers. I want to convert this cluster into an array of clusters. The cluster in the array would be a name and a value. It is fine if the numeric type for this array of cluster is all defined as doubles. The brute force method would be to use a for loop with a case structure to unbundle each cluster and build the array for each cluster. However, if the cluster is modified this VI would have to be modified as well. I was hoping to use the Variant Type Info VIs to pick through the data. The problem here though is that I get all of the type information but lose the actual data when converting the cluster to a variant. Here is the basic idea I have but need a way to get to the actual data.
01-26-2022 12:55 AM
The OpenG variant tools can do this with minimal code (convert to array of variants, get the names of the internal cluster elements and for each one get the value by name and convert from variant to double). The MGI tools might too.
01-26-2022 03:21 AM
Just change the 1st variant method on the Main method to a Variant to data and change it to an Array of Variants, then it retains the values.