LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI reference close

Solved!
Go to solution

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. 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 5
(2,851 Views)
Solution
Accepted by topic author jyang72211

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.

Message 2 of 5
(2,849 Views)

Right on.   Thanks!

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 5
(2,828 Views)

When it says go to idle, does it mean when the program finish running?

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 4 of 5
(2,825 Views)

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.

=====================
LabVIEW 2012


Message 5 of 5
(2,821 Views)