LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I would like to extract the names (labels) of my elements in a cluster automatically, how can I do that?

Because I want to write down the data in a cluster to a textfile, I need a header line. I'd like to have one consisting of the names of the elements in the cluster. And I'd like to extract them automatically, because I don't want to create 60 property nodes.
0 Kudos
Message 1 of 6
(3,839 Views)
Create a reference node (not the property node) of the cluster, use the property "Controls[]", it returns an array of all controls in the cluster, then use "Label.Text" property inside a for loop. you know what to do next, do you? This requires LV 6i and above.

Joe
Roush Industries, Inc
Message 2 of 6
(3,839 Views)
Hi RS,
first you need LV 6 and above.
-Use the property Controls[] that create an array of reference of all the cluster elements
- With these references you can extract labels names individually and do what you need.
I attach an example that shows it.

Have a good time,

Alberto
Message 3 of 6
(3,839 Views)
Do you know how to dynamically change the element names in a cluster? Thanks.
0 Kudos
Message 4 of 6
(3,839 Views)
Dynamically changing the labels on the elements of a cluster doesn't seem to be easily possible. Perhaps this is due to the need for name matching in the Unbundle by Name function.

It is possible, however, to change the caption dynamically. Same method as given above, but write to the caption.text property. An example is attached if you're reading this through the NI web site.
0 Kudos
Message 5 of 6
(3,839 Views)
Thank you very much. I need to build a cluster with an array: strings in the first column are cluster names and the second are the corresponding values. Therefore, I am looking for dynamically update the element names.

Jim
0 Kudos
Message 6 of 6
(3,839 Views)