03-02-2010 08:38 AM
Greetings all,
I just inherited a rather large program that is running on a system. This program uses quite a few dynamically loaded vi's that are being pulled in from various locations. the program is also still running as a VI as opposed to an executable. I have been tasked with re-writing a good portion of it and creating an executable/installer. Of course, the German contractor who wrote the bulk of it is no longer around and nobody knows anything about it. My main problem is that there are many, many versions of vi's sitting in about 50 folders that are being used. Only one of the versions is being actually loaded and executed. I had no way of knowing which vi's are being used so I wrote a little vi that lists all the vi's currently loaded in memory. It works well enough in that it returns the vi name along with the directory path. When I build the executable, I don't want to simply add all the folders with their myriad vi's to the project, only the ones that are actually being used.
I have two questions actually:
1) Is there a better way of doing what I did here? (I have attached my little vi)
2) I would like to exclude the standard Labview vi.lib vi's from the list as those will automatically be included in the build. Otherwise I will have to sort through the entire list to determine which are actually "man made" versus NI built-in.
I have attached my little "Get Open Vi's List" vi. Please feel free to make any suggestions/changes. I am using version 8.6 so nothing later than that pls.
Thanks for the help.
03-02-2010 09:29 AM
03-02-2010 09:30 AM
The OpenG toolkit has a VI called 'List VI hierarchy', these are split from user.lib/vi.lib and other VIs.
Ton
03-02-2010 09:41 AM
What is your search path set to in your LabVIEW Options? Is it set to pick up VIs from vi.lib first?
I'm not saying this is the case, but there may be a good reason why the original developer has copies of VIs from vi.lib. For example, the Read From Spreadsheet VI was not polymorphic in the past. If you wanted it to work to return the data as an array of strings you would need to make a copy and modify it according to the instructions in the block diagram of that VI.
As far as projects are concerned, technically you only need to put the top-level VI in the project, as well as any top-level dynamic VIs. If you have auxiliary files that need to be included when the app gets installed (such as custom configuration files) then these need to be in the project file so they can be selected to be included when the app is installed. When you build an app/installer VIs from vi.lib are not normally included (there's a checkbox for it).