tags:

views:

475

answers:

3

I have a LabVIEW application that I inherited that has a bunch of sub-VIs. In the course of cleaning it up I've discovered some of the included VIs are not used. I know I can use the VI Hierarchy to see every VI included as icons but this isn't that useful for comparing against a directory listing. Is there a(n easy) way to create a list of VIs used by a LabVIEW application? I just want a list.

+5  A: 

This download on the National Instruments website will save a list of all subVIs of a chosen VI to a text file.

If you just want to see the list (and have the application builder or the professional development system), choose Tools>Build Application and click the VI Settings tab.

Neither of these methods will tell you about dynamically loaded VIs, but you can check whether any of these are being used with Edit>Find>Objects and searching for Call by Reference Node and/or Invoke Node.

There may also be ways of doing this from the Project Explorer in LabVIEW 8 upwards.

nekomatic
The download didn't save the list to a file but that's easily corrected. Adding a 1D Sort Array in there makes it more useful, too.
dwj
Ah, the VI by that name I have on my machine is evidently not the same as the NI one! As you say though, this is easy to fix.
nekomatic
+1  A: 

Using the Project explorer under LV8 you can save the file information of all VIs for the current project ('Project' menu, select 'File information' then click on the 'Export File information' button) but this will just list all VIs in the project.

To get a list of all VIs used by the top level VI of an application you can use VI server to recursively get a list of all Callees and build up the list. Basically Open a reference to the top level vi and using the property node, take the string array of Callees and repeat until there are no more. You can also get the Path of the VI so you can mask out all standard VIs from the vi.lib folder.

I have put together a simple VI to do this in under half an hour which I could make available if required.

Just seen that there is one available from the National Instruments website but of course I prefer my version as it filters out the library VIs.

Swinders
Nor does the one on the NI site sort the list but that was easily taken care of, too.
dwj
+3  A: 
Ton
I like the "Save As" -> "Duplicate hierarchy to new location" method. A simple directory comparison showed which VIs were no longer needed. Note that external code (DLLs) were not copied over (as expected).
dwj