LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get the name of each element in my cluster in a 1D array (of 9 elements)

Solved!
Go to solution

Hello guys,
I want get the names of each element in my cluster in a 1D array (of 9 element).
How I do that please?
Thanks you in advance.

0 Kudos
Message 1 of 7
(1,281 Views)
Solution
Accepted by Ngouda

You can use property nodes of the cluster

 

it will generate an array of references of all the elements of the cluster, running on a for loop you can get the name of each reference. 

 

LVNinja_0-1688654289083.png

 

Message 2 of 7
(1,274 Views)
Solution
Accepted by Ngouda

If you don't want to use property nodes:

Cluster Labels.png

 

Note that the variants contain the labels (and data and data types). If you need the data and the labels, you can simply use the 1D array of variant, and get the labels when needed.

 

That is "NI_Data Type.lvlib:Get Type Information.vi" btw.

Message 3 of 7
(1,264 Views)
Solution
Accepted by Ngouda

Just for completeness (as the question has already been answered):

 

For more general cases when your cluster elements can have any type, you can also get their data type with "Get Cluster Information.vi" from the Data Type Parsing palette. Unlike the "Variant to Data" method, it does not unwrap the value contained inside variants:

 

raphschru_3-1688678006744.png

 

 

 

 

Message 4 of 7
(1,177 Views)
Solution
Accepted by Ngouda

For even more completeness, I've used this vi sometimes to get the references to controls in nested clusters. You can then use the method of @LVninja to get the control labels.

Get  the name of each element in my cluster in a 1D array.png

 

Basjong53_0-1688719243085.png

 

Message 5 of 7
(1,153 Views)

Hello @LVNinja,@Basjong53,@raphschru, @wiebe@CARYA,
Thanks you very much all for your reply 🙂
It's very kind.



Message 6 of 7
(1,136 Views)

thank you for showing appreciation for help!

Message 7 of 7
(1,056 Views)