From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

associating references to controls in cluster

Hello

I am new to Labview OOP coding.

I am trying to hide/unhide a control within a cluster. I realize the controls are available as a 1D array of reference. And I am able to specify an element of the array of references to hide or unhide the specific element. How can I accomplish this (hide/unhide) without knowing or caring about the order of the element in the cluster ? Thanks

0 Kudos
Message 1 of 5
(2,483 Views)

You could iterate through the array of references looking at properties of the reference such as label name and stop when you find the reference whose name matches the control you want.

 

Beyond that, the order of the controls within the array of references should be the same as the order of the controls within the cluster when you use the Reorder Controls within Cluster... menu choice.

0 Kudos
Message 2 of 5
(2,476 Views)

If you want a reference to a specific cluster element, simplify go to the front panel, right-click the desired element inside the cluster, and select "create reference".

 

(Sorry, posting by phone. Cannot look at your VI)

0 Kudos
Message 3 of 5
(2,469 Views)

Hi, krishk24,

 

I usually right click the control in the cluster to create the property node and choose the visible property.

But I'm not sure it is a good way to apply to all situations.

 

Control Reference - hide unhide.PNG

0 Kudos
Message 4 of 5
(2,450 Views)

Yes, after looking at the code, it seems creating a direct reference is easiest. (You would need to create a reference as I suggested earlier if you change the visiility e.g. from within a subVI).

 

 

0 Kudos
Message 5 of 5
(2,443 Views)