LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

closing references

I have main.vi which calls CAN.vi.  The CAN.vi is just an icon in main.vi.  I'm not explicitly opening a reference to CAN.vi.  I'm using CAN.vi as a server for 15 other sub interfaces, i.e. EEC1.vi.
 
In CAN.vi, I'm not closing the references to EEC1.vi and others because I want the controls in these vis to remain in their last state.  If I don't explicity close the EEC1.vi reference  when the entire application closes, is this a problem?  I'm assuming when the main application closes, it will kill all references to any open vis.
 
 Attached are the 3 vis.  I hope this
Download All
0 Kudos
Message 1 of 3
(2,172 Views)
Hi Jim,


@Jim P wrote:
 I'm assuming when the main application closes, it will kill all references to any open vis.



you are right (it is called garbage control), but I wouldn't rely on it. These VI are kept in memory until Main.vi is closed. If I were you i'dd add a third frame in can.vi that closes all the EEC vi's.
Few points:
Put the VI references inside an array
If the code inside the eec#.vi is generic I would rename the file to *.vit and and open them reentrant

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 3
(2,162 Views)

OK.

I guess I'm still a little confused about how the events are processed. 

Inside CAN.vi is my While Loop (frame 2) where I'm using the references to the sub VIs.  If CAN.vi get closed, will the code automatically exit the While Loop and execute frame 3 (when I add it)?

0 Kudos
Message 3 of 3
(2,152 Views)