LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

closing control[] reference

If I have a main VI that calls sub-VI's, and I pass the control[] refereces of the controls in the main VI to the sub-VI. Should I use a for loop to close the control[] reference? And should I close the control[] referece in the main VI or the sub-VI?
0 Kudos
Message 1 of 4
(2,792 Views)
My understanding of what you are doing is building an array of the control references in the main vi to pass to the sub-vis. Is this correct? If so, why not bundle the references instead? This way you could easily pull out the required reference by name.

Aside from that, if you are passing references to the front panel objects you shouldn't need to close them at all. The following links should be useful in helping you to understand when to close references:

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000834C0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=closing+references&USEARCHCONTEXT_QUESTION_S=0

http://www.ni.com/devzone/lvzone/dr_vi_archived4.htm

Hope that helps.

John
0 Kudos
Message 2 of 4
(2,792 Views)
That was not what I meant, sorry for the confusion. I have a cluster control[] property that I need to pass to the sub-VI. I have read the information in that link, but much of those info pertains to LabView 6.1 or 6.0. I am using LV 7.0. Thanks.
0 Kudos
Message 3 of 4
(2,792 Views)
I've not used LV 7, but I expect that the information is still valid. In any event, if you are going to close the reference then IMHO you should do it within the same vi that you open it in.
0 Kudos
Message 4 of 4
(2,792 Views)