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.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

purging of unused VI's

In the process of learning how to use Labview I have created many VI's that I do not need for my application.
Unfortunately all of the application's VIs and the "temporary" VIs are in the same directory.
Is there any way to query separate VIs to see where and if they are used in application VI's.

For instance, I have created many globals and saved them. Many of those globals are not used anywhere in my application.
IF I open a global, it does not show useage. That only occurs if I open the calling VI, which then shows the global in the hiearchy.

Thank you,
Message 1 of 2
(2,783 Views)
One way to get rid of the garbage is to open the main VI and then do a Save With Options>Development Distribution. This will create an llb file with the main VI and all subVIs (exclusive of VIs in vi.lib). Once the llb is created, delete all of the files in the folder except for the llb. You can then use Tools>VI Library Manager to convert the llb back to a folder. If you have multiple main VIs, you'll have to create the llb for each before you do any deleting. And, if in any of your VIs, you call other VIs dynamically, the dynamically called VIs will not be included. Make a backup of the folder before doing this!

A programatic way is to write a small VI and in there, use the application property All VIs in Memory. Open your main VI(s) and run the small one to get a list of all VIs loaded. You could then use that list and the File I/O function List Directory. Whatever file is listed in both, you keep. If a file only shows up the in the List Directory result, delete it.

The first method is fine for a one time operation. The attached example gets a list of unused VIs.
Message 2 of 2
(2,778 Views)