LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

label of cluster in array

Highlighted

Hi all,

  I create an array with element is cluster of 3 numbers. The array has 20 elements (clusters). I am going to label each cluster in different text but I found that once the label of any cluster changed, all clusters' label will change accordingly. Is that any way to label different element in an array differently? Thanks.

0 Kudos
Message 1 of 4
(1,091 Views)

No.

Every element of the array must be the same (that means labels as well).  The only differences are in the values.

 

What you could do is make a 4 element of the cluster that is a string, then make the value of the string whatever you want the label to be.  Color it transparent and arrange it just so, and it will look like a label.  Of course the label is now a value within that cluster and you'll have to initialize it and maintaing that value through code just as you would with the 3 numeric values in the cluster that is each element of the array.

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

Another (but limited) way to do this is to make a cluster of your clusters, with each "sub-cluster" having a unique name.  When you go to process this "Super-cluster", use "Cluster to array" to turn it into an Array of Clusters (which strips off the labels from the elements), process the (now) Array elements, and it you want to display it back as a Cluster, do an Array-to-Cluster (you might have to TypeCast the resulting Cluster to your saved TypeDef -- you did make a TypeDef of your Super-Cluster, didn't you? -- in order to get the Labels back, I'm not sure).

 

Bob Schor

0 Kudos
Message 3 of 4
(1,036 Views)

I think the type cast back will get the labels back for display.

 

Ben

0 Kudos
Message 4 of 4
(1,021 Views)