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: 

closing references

This question has been posed before and beaten to death ... and I've spent the good part of an hour perusing the discussions ... however ... I'm not satisfied with most of the conclusions. And the last discussion occurred last January, so there just might be some newer info out there ...
 
I have a vi that opens an ActiveX class, and this reference filters down with invoke and property nodes 12 levels to get the data that I need. At this moment I am only closing the original ActiveX reference, but I'm sure I need more. Instead of doubling the screen size of the block diagram with all of the Close References I tried to create an array with all the references and would close them all in one For Loop with one Close Reference ... but when I connected reference #2 I get a class conflict.Smiley Indifferent
 
Has this been easier to work with in LV 8.2? Or do I have to plop down a Close Reference for each and every invoke/property node? That sounds brutal! But I need to be certain that I'm doing everything I can. Thanks in advance Smiley Happy
PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 1 of 3
(2,479 Views)
With ActiveX references, you must close every single one you have opened.  This includes explicit opens like with the Automation Open function, and implicit opens like reading a new reference property from a property node.  You can get away with closing the single top-level VI reference as far as VI Server is concerned, but with ActiveX, any unclosed reference will be a memory leak.
 
So yes, your diagram will have to grow to accomodate 12 Close References.
 
-D
Message 2 of 3
(2,480 Views)
Thanks, Darren. Yours would be the definitive bottom line. Smiley Happy I figured I would do this just to be safe. I ended up putting a row of Close References, one above each property and method. I was concerned with any one of them closing too soon, so I just sent the laste error cluster from the last property node back up and all the way to the left Smiley Surprised to the first close reference, then just daisy-chained that error cluster through all the Close References so they close all at once but only after I get the data. It's not a bad looking solution and my block diagram isn't any bigger, either. I don't have the ActiveX components here on my laptop at home so I'll have to wait until Monday to see if it works, but I don't see why it wouldn't. Thanks again.
PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 3 of 3
(2,452 Views)