Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
15 ratings:
 3.93 out of 5     Rate this Document

Path Information When Searching for SubVIs



Hardware: PXI/CompactPCI>>Controllers

Problem:
I am unable to open a subVI when loading my program on a new computer. How does LabVIEW handle saving file paths for subVIs, and how can I modify the search paths?

Solution:
For any particular VI, LabVIEW saves each of the SubVIs as a relative path from the main VI. When opening up a VI, LabVIEW will first use relative paths to locate its SubVIs. If the VIs are not in the same directory as the main VI, LabVIEW will then search for the missing subVIs according to the VI Search Path settings. You can configure the search paths by going to Tools»Options»Paths and selecting VI Search Path from the drop-down menu. By default, LabVIEW will look through the following locations in order (\* means LabVIEW will search through the subdirectories):
  • <topvi>\* - the location of the top level VI
  • <foundvi> - the location of the last VI found
  • <vilib>\* - the LabVIEW vi.lib
  • <userlib>\* - user.lib
  • <instrlib>\* - instr.lib
If LabVIEW was unable to find the VI in the expected location or in any of the paths from the above list, you will be prompted to manually locate the VI. 

If VIs were not found in the relative paths where LabVIEW expected them due to the SubVIs being moved, LabVIEW will notify you that changes have been detected by placing an asterisk next to the VI name in the window title bar. Saving the main VI afterwards will also save a new relative file path for the subVI. 

Note: When saving a new copy of a VI, LabVIEW will save the relative path to the original SubVIs. Opening this SubVI later would search the relative paths before looking in its own directory for SubVIs. This can cause the main VI to reference the SubVIs in an unexpected location.

If you want to create a copy of an application that is independent from other versions, you can create a source distribution (refer to the Related Links section for more information). You could also copy the files to a new directory without opening them in LabVIEW.

If you already have a version of your application that is pointing to the wrong location, you can go in and manually replace the misdirected VIs with the copies you want. Select View»VI Hierarchy with the top level VI open. Go to View»Full VI Path in Label. You will then be able to see the full paths where your VIs are located. You can open the SubVIs and save them to a new location. If you have many subVIs to move, you might choose to correct the problem by moving the entire copy of the application to a new place causing the relative paths to be recreated.



Related Links:
LabVIEW Help: Adding a Directory to VI Search Path
LabVIEW Help: Setting Path Options
LabVIEW Help: Building a Source Distribution

Attachments:





Report Date: 08/21/2001
Last Updated: 04/30/2014
Document ID: 2CKGQ6G4

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit