07-06-2023 09:19 AM
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.
Solved! Go to Solution.
07-06-2023 09:38 AM
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.
07-06-2023 09:55 AM - edited 07-06-2023 09:55 AM
If you don't want to use property nodes:
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.
07-06-2023 04:17 PM
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:
07-07-2023 03:41 AM - edited 07-07-2023 03:56 AM
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.
07-07-2023 03:55 AM
Hello @LVNinja,@Basjong53,@raphschru, @wiebe@CARYA,
Thanks you very much all for your reply 🙂
It's very kind.
07-08-2023 05:49 PM
thank you for showing appreciation for help!