LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Access cluster within cluster through control refnum

Solved!
Go to solution

I have a cluster1(with 2 numeric controls) with other controls within a cluster2. I want to pass this cluster2 to subvi as a control refnum and then set cluster1's numeric control 's value. How do I do that? I cannot simply unbundle cluster2...

0 Kudos
Message 1 of 5
(3,426 Views)
Solution
Accepted by topic author tomsze

You can get the refnums to all the controls in the main cluster through the "Controls[]" cluster property; then you need to identify the inner cluster refnum using its name (label) or index (knowing the main cluster elements order); after this, you have the refnum you need in the shape of a Control refnum, so you need to pass it through the "To more specific class" node specifying that the "target class" is a cluster (you can create a constant for that input and select the following path: "Generic-GObject-Control-Cluster-Cluster"). This will give you the inner cluster refnum ready to get and set all cluster properties.

Message 2 of 5
(3,396 Views)

I wrote a nugget on the topic of using control references that can be found here.

 

But for the most simple approach, right click the sub-cluster from the FP and select "create reference". That will create a reference to the sub-cluster and no funny stuff required.

 

If you really want the funny stuff, see my nugget I linked above.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 5
(3,368 Views)

Ok, it works~ thanks~

0 Kudos
Message 4 of 5
(3,360 Views)

Or you create a DVR to the cluster and change the value through a InPlaceStructure.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 5
(3,360 Views)