06-20-2012 06:48 PM
In my main VI, I opened a VI reference to another VI (let's call it VI1) and used the invoke node to run VI1 in the background. Once VI1 is done running, I thought I still have to close its reference in my main VI. However, the reference to VI1 became invalid. Is that a standard behavior? It doesn't make sense to me why the reference would become invalid.
Solved! Go to Solution.
06-20-2012 07:16 PM
Sounds like you set Auto Dispose Ref to True.
LV Help:
Allows you to run a VI independently of the caller without opening its front panel immediately or opening another reference inside the target VI. If TRUE, the referenced VI transfers ownership of the reference from the calling VI to the VI that is running. This means LabVIEW disposes of the reference, along with the parallel data space, when the target VI goes idle, not when the VI that opened the reference goes idle. The reference can still be used by the calling VI until the target VI closes the reference. The calling VI does not need to close the reference unless the Run VI method returns an error. If the calling VI does close the reference, the target VI can abort and leave memory. If FALSE, LabVIEW automatically disposes of the VI reference when the VI that opened it goes idle. The default is FALSE.
06-21-2012 10:29 AM
Right on. Thanks!
06-21-2012 10:30 AM
When it says go to idle, does it mean when the program finish running?
06-21-2012 10:34 AM
It simply means that the VI you invoked is idle meaning you could press the run button for that VI. It has nothing to do with the state of the VI that invoked it.