LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster of References Constant

I want to do UI control of my front panel within a subVI.  Hence, I need to pass a number of references to front panel objects to a subVI.

 

See the attached (simplified) example to illustrate my point.  Everything that lies within the sequence structure frames would reside in the subVI.

 

In the top part of the block diagram, the references are explicitly bundled together, before being passed to the subVI to be applied to property nodes.  This works fine.

 

However, if I want to define a constant cluster of references, as in the bottom part of the block diagram, it returns an error: "Object reference is invalid".  How would I make this work?  Note: I created this constant by right-clicking on the cluster wire in the top part of the diagram.

 

Many Thanks,

Dan

Message Edited by DanB1983 on 04-20-2010 07:08 AM
Message Edited by DanB1983 on 04-20-2010 07:09 AM
Dan
CLD
0 Kudos
Message 1 of 6
(3,490 Views)
In the top image, you are bundling references to specific controls.  In the bottom of the image, you are creating a cluster with the right type, but containing empty data.  You need to bundle the references to your specific controls into that cluster before you pass them to your subVI.
0 Kudos
Message 2 of 6
(3,475 Views)
OK, so back to my initial question, is it possible to create a constant cluster of references without having to bundle each individual reference together?
Dan
CLD
0 Kudos
Message 3 of 6
(3,472 Views)

DanB1983 wrote:
OK, so back to my initial question, is it possible to create a constant cluster of references without having to bundle each individual reference together?

Not easily. You can get a reference to the front panel and from there get references to every control and indicator it contains, then get the label from each control reference and see if it matches an item in the cluster, build the matching items into an array and then convert the array to a cluster (or find another way to get those references into the cluster), but that will probably turn out to be more work than bundling the references manually.

0 Kudos
Message 4 of 6
(3,466 Views)

 

You can pop-up on the middle input of teh bundle to create a constant. See this mini-Nugget.

 

This thread may help, here is a preview.

 

1_Bundle_Refs.PNG

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 6
(3,448 Views)
If you have a lot of controls, you can also use this to save time on creating the references and the cluster.

___________________
Try to take over the world!
Message 6 of 6
(3,435 Views)