The Project Explorer was introduced in LabVIEW 8.0 to provide developers with a system-level view of the files they need for an application. The goal of the LabVIEW Project Explorer is to help developers easily find and organize files from within the development environment and provide added functionality that addresses the challenges of managing and developing large LabVIEW applications. Since the initial release of the LabVIEW Project Explorer, NI has incorporated several new features as a result of customer feedback. To learn more about the latest version of the Project Explorer window, view the Managing a Project in LabVIEW topic in the LabVIEW Help.
Figure 2: This Project demonstrates how the same application we saw in Figure 1 can be organized in the LabVIEW Project Explorer.
Use LabVIEW Projects to group together LabVIEW files and other files, create build specifications, and deploy or download files to targets. When you save a LabVIEW Project, LabVIEW creates a .lvproj file, which includes references to files on disk, variables, hyperlinks, configuration information, build information, deployment information, and so on.
The LabVIEW Project Explorer does not reproduce or copy your files to new locations on disk. It provides a new method for displaying files on disk and offers shortcuts to the locations of the files on disk. With the LabVIEW Project Explorer, you can:
- Easily access and navigate files without leaving LabVIEW
- Customize and filter how files are organized
- Preserve links when moving or renaming files on disk
- Prevent, detect, and resolve incorrect links
- Manage code for specific hardware targets1
- Manage build configurations1
- Integrate with source code control providers1
1These are not covered in this article.
Note that some of the functionality described in this article is available only in LabVIEW 8.5 or later. To learn about the new features in the latest version of LabVIEW, review What's New in LabVIEW?
Managing Your Files in the Project Explorer
There are two pages for viewing files in the LabVIEW Project: the Items page and the Files page.
Figure 3: The files page shows a filtered view of all items in the Project as they are located on disk and allows users to perform file operations such as copy and rename
The default view is the Items page, which provides a tree view of items you have added to the LabVIEW Project and groups them by hardware target. You can create folders in this view to either customize how files are organized or to synchronize to a specific location on disk. This is where you likely will spend most of your time.
You cannot delete files from disk from the Items page – this is designed to protect users from accidentally deleting code. You can however, organize your code into files on your computer by right-clicking on items in the Files view and selecting Move on Disk...
The Files page shows where items that have a corresponding file on disk are physically located. Use this view to perform the same file operations you would normally perform from within your system file browser, such as moving, copying, or deleting. Because LabVIEW is aware of the changes, it is able to update callers and preserve links when changes are made.
You can customize the hierarchy of files in the LabVIEW Project Explorer without affecting the layout of files on disk; however, it is recommended that the organization in the LabVIEW Project reflect the hierarchy you’ve set up on disk as closely as possible.
Using Folders in the LabVIEW Project
You can organize the contents of your LabVIEW Project using two types of folders: virtual folders and autopopulating folders. With virtual folders, you can customize the organization of project items without making any modifications on disk.
Figure 4: Users can select from auto-populating or virtual folders when organizing files in the LabVIEW Project Explorer
Virtual folders are ideal for scenarios in which you want to change the organization of files in LabVIEW without making any modifications to their storage locations on disk. If you add a folder on disk to the LabVIEW Project Explorer as a virtual folder, it is represented by a snapshot view at the time you added it. If you make any changes afterward, including the addition of new files, these changes do not appear in the LabVIEW Project. However, you can make changes manually by dragging new files into the LabVIEW Project or temporarily converting the virtual folder to an autopopulating folder.
With virtual folders, you can group files from two or more separate locations on disk in the LabVIEW Project Explorer. They are also useful for filtering the information displayed in the LabVIEW Project Explorer to help you determine if files are grouped with other items you don’t need.
NI introduced autopopulating folders in LabVIEW 8.5 to automatically reflect the contents of folders on disk. Autopopulating folders are synchronized to a physical folder, which means that they always display any changes or modifications made to this location outside of the LabVIEW development environment. Use autopopulating folders whenever possible to preserve the disk hierarchy within the LabVIEW Project Explorer. Autopopulating folders are not recommended when managing Project Libraries or LabVIEW Classes or when attempting to resolve large numbers of cross-links.
Use autopopulating and virtual folders to enforce organization and structure for your application files in the LabVIEW Project Explorer. Autopopulating folders are ideal for preserving and maintaining the structure on disk, but there are situations in which you either cannot use them or need customization. In these cases, use virtual folders to customize the organization of files in the LabVIEW Project Explorer.
LabVIEW automatically loads all statically linked subVIs into memory when you open the calling VI. The Dependencies section of the LabVIEW Project Explorer is automatically populated with these same subVIs if they have not been added to the LabVIEW Project when the calling VI is loaded into the LabVIEW Project Explorer. Beginning in LabVIEW 8.5, user dependencies are separated from the contents of vi.lib to make it easier to identify which files were written by the application’s developers.
Adding files to a LabVIEW Project indicates to LabVIEW which files and resources are intended for use in an application. Check the dependencies section to make sure you’ve added everything you need to your LabVIEW Project – if you have not done so, remaining files are listed in this section. This is an important practice for ensuring you’re using the copy of a subVI you intended.
A VI in your LabVIEW Project may become incorrectly linked to the wrong subVI, in which case adding the copy of the subVI you intend to use to the LabVIEW Project signals LabVIEW that one or more callers may be incorrectly linked to a different subVI with the same name. This scenario is often referred to as cross-linking.