LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster Control References

The Controls[] property of a cluster will provide an array of generic references to the cluster elements.  However, each element must have its own "Type Cast" or "To More Specific Class" node, and the resulting type must corresponding to the order of elements in the cluster.  

 

An "Unbundle By Name" or "Bundle By Name" node will respectively read or write typed values of cluster elements.

 

Is there an "Unbundle References By Name" node or VI to obtain a cluster of typed (not generic) references from a cluster?

 

0 Kudos
Message 1 of 10
(5,171 Views)
The Controls[] gives just an array of control reference types, but there are other options, you can make a reference directly to a member in a cluster.  What are you trying to do? 
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 2 of 10
(5,165 Views)

Also the generic control type does include a type id which will let you cast your objects back into the original type, it would have been much nicer if the class ID was actually a reference type instead this would have avoided the casting step.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 3 of 10
(5,164 Views)

I have several front panel objects grouped in a cluster, and I want to set their properties at runtime.

 

I just thought since the typed values were available, typed references would also be available (without explicit typecasting).

0 Kudos
Message 4 of 10
(5,157 Views)

Use the reference to the cluster's element, these are typed.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 5 of 10
(5,140 Views)
How do you get a typed reference to a cluster's element?
0 Kudos
Message 6 of 10
(5,115 Views)

Hi Steven,

 

Try taking a look at this Nugget where I try to touch on every aspect of control ref's. Hopefully you'll find something useful in that pile.

 

Ben

 

 

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

Make a reference to the cluster, click on the cluster reference and select link to.  Navigate the menu to the cluster then a submenu with the cluster elements will popup, select the wlwment name you need a reference to.  You will now have a reference (typed not a generic control ref) to the element of the cluster.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 8 of 10
(5,089 Views)

Attached is a very quick toy example of using a cluster's element references.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 9 of 10
(5,088 Views)

Unfortunately, using a cluster's element reference does not help in my case, as I have a cluster of (non-strict) type-def'd clusters.

 

I finally decided to put each control's initialization routine inside a Case Structure with Label.Text wired to the selector terminal.
0 Kudos
Message 10 of 10
(5,071 Views)