Managing Dependencies in LabVIEW Projects

FlexRIO Help

Edition Date: November 2015

Part Number: 372614J-01

»View Product Info

»Download the Help in ZIP Format

Use Dependencies to view items that VIs under a target require, such as:

Each target in a LabVIEW project includes Dependencies. LabVIEW automatically identifies the files required by each item in the project and includes these files in Dependencies. LabVIEW organizes Dependencies into three folders: vi.lib, user.lib, and Items in Memory.

Note   (MathScript RT Module) LabVIEW also adds MathScript user-defined functions that a VI calls statically to this location.

Using the Dependencies List

You cannot add items directly to Dependencies. Dependencies updates automatically when you add, remove, or save an item in the project. For example, if you add a VI that includes a subVI to a target, LabVIEW adds the subVI to Dependencies. However, if you manually add the subVI under the target, the item does not appear under Dependencies. When you name or move dependent files, take precautions to avoid incorrect dependencies.

To view the current dependencies of a project, right-click Dependencies and select Refresh from the shortcut menu. You also can use the Refresh Dependencies method to refresh Dependencies programmatically.

Note  If you previously hid Dependencies in the Project Explorer window, you must display the item again to access it in the Project Explorer window.

LabVIEW tracks subVIs recursively. LabVIEW does not track shared libraries (DLLs) recursively. For example, if calls b.dll statically and b.dll calls c.dll statically, LabVIEW only considers b.dll as a dependent item. To manage c.dll in the project, you must explicitly add c.dll under the target.

If a dependency is part of a project library, LabVIEW includes the entire project library under Dependencies.

You cannot create new items under Dependencies. You cannot drag items from other places in the Project Explorer window to Dependencies.

Including Dynamic Dependencies

When you open a project, the items that a VI calls dynamically do not appear under Dependencies. When you run the callers, the dynamically loaded items appear in the Items in Memory folder under Dependencies. You can add these items manually under a target to manage them in a project.

Because dynamically loaded files are not statically linked by any callers in the project, any action that changes the path to a dynamically loaded file can prevent the project from loading the file. To ensure that dynamically loaded files are in the correct location, follow these guidelines:

  • Group the files in a separate folder.
  • Refer to the files using relative paths.
  • If you need to move a project or distribute an application, remember to include the folder in which you grouped dynamic dependencies.

Managing Shared Dependencies

If you create applications that share code, changing the code can inadvertently affect other callers. Observe the following guidelines when managing dependencies with shared code:

  • Minimize changes to code shared by applications.
  • If you need to change shared code, make local copies for testing and integration.
  • Dedicate time to managing and integrating changes to shared code.
  • Use source code control.


Not Helpful