LabVIEW Projects allow you to organize your VI and other LabVIEW files as well as non-LabVIEW files, such as documentation and just about anything else you can think of. When you save your project, LabVIEW creates a project file (.lvproj). In addition to storing information about the files contained in your project, the project file stores your project's configuration, build, and deployment information. You might be asking yourself: "Why do I need a project?" There are a lot of reasons, but a better question might be to ask: "When don't I need a project?" The answer to this is very simple. You don't need a project if you are only going to create one or two VIs and you are more interested in collecting and analyzing data, than you are in the VIs that you use to collect and analyze data. However, if you are interested in managing your VIs as software, you should organize your VIs in a LabVIEW Project. Project Explorer WindowThe Project Explorer window is where you will create and edit your LabVIEW Projects. Figure 3.7 shows an empty project. You can create an empty project by selecting File>>New . . . from the menu and then selecting Empty Project from the dialog box. Figure 3.7. Project Explorer window showing a new, empty LabVIEW projectThe project appears as a tree with several items. The root item is the Project root, which shows the name of the project file and contains all of the project items. The next item is My Computer, which represents the local computer as a target in the project. A target is a location where your VIs will be deployed. A target can be your local computer, a LabVIEW RT controller, a Personal Digital Assistant (PDA), a LabVIEW FPGA device, or anywhere you can run LabVIEW VIs. You can add targets to your project by right-clicking on the project root and selecting New>>Targets and Devices from the shortcut menu. In order to be able to add additional targets to your project, you will need to install the appropriate LabVIEW add-on module. For example, the LabVIEW Real-Time, FGPA, and PDA modules allow you to add those targets to your project. Beneath the My Computer target are Dependencies and Build Specifications. Dependencies are items that VIs in the project require. Build specifications are the rules that define how your application will be deployed. Project Explorer ToolbarsThe Project Explorer has several toolbars that allow you to easily perform common operations. These are the Standard, Project, Build, and Source Control toolbars, shown in Figure 3.8 (respectively, from left to right). Figure 3.8. Project Explorer toolbarsYou can choose which of these toolbars are visible from the View>>Toolbars menu, or by right-clicking on the toolbar and selecting the desired toolbar from the pop-up menu that appears (see Figure 3.9). Figure 3.9. Toolbar pop-up menu showing which toolbars are visible (checked)
Adding Items to Your ProjectYou can add items to your project, beneath the My Computer target. You can also create folders, to better organize the items in a project. There are a variety of ways to add items to your project. The pop-up shortcut menu is probably the easiest way to add new VIs and create new folders, as shown in Figure 3.10. Figure 3.10. Adding a new VI to a LabVIEW project from the pop-up menu of My Computer in the Project Explorer
You can also add items from the pop-up menu, but the easiest way (in Windows and Mac OS) is to drag the item or directory from disk into the Project Explorer, as shown in Figure 3.11. You can also drag a VI's icon (in the upper-right corner of a front panel or block diagram window) to the target. Figure 3.11. Drag and drop to add a VI into project
Project FoldersProject folders are used to organize your project files. For example, you could create a folder for your subVIs and another folder for your project documentation, as shown in Figure 3.12. Figure 3.12. The Project Explorer showing project folders used to organize project files
Project folders are virtual, which means that they do not necessarily represent folders on disk (although you might choose to create project folders that reflect the organization of your folders on disk). One side effect of this is that after you add a directory on disk to a project, LabVIEW will not automatically update the project folder contents to reflect changes made to the directory on disk. You will have to synchronize these manually, if you wish to do so. Removing Items from a ProjectItems can be removed from the project by right-clicking the item in the Project Explorer and selecting Remove from the pop-up shortcut menu, as shown in Figure 3.13. Figure 3.13. Removing items from a project using the pop-up menu
Alternatively you can delete an item by selecting the item in the Project Explorer and then pressing the <Delete> key or pressing the Delete button on the Standard toolbar. Removing an item from a project does not delete the corresponding item on disk. Building Applications, Installers, DLLs, Source Distributions, and Zip FilesThe project environment provides you with the ability to create built software products from your VIs. To do this, pop up on the Build Specifications node in the Project Explorer window and select a build output type from the New>> submenu. You can choose from the following options:
Each of these build output types has its own set of build specifications. A build specification contains all the settings for the build, such as files to include, directories to create, and settings for directories of VIs. Building an application and building an installer are two separate steps. You will need to create one build specification for each of these outputs. If you select Source Distribution from the File>>Save As . . . dialog, you will be guided through the process of creating a Source Distribution. This requires the creation of a new project file, if the source VI is not part of a LabVIEW project. For more information on building applications and using build specifications in LabVIEW projects, refer to the Fundamentals>>Organizing and Managing a Project>>Concepts>>Using Build Specifications section of the LabVIEW Help. More Project FeaturesYou have just learned about the fundamental features of the LabVIEW project environment. This knowledge will help you organize your VIs and project files and allow you to work efficiently. However, there are many more features of the LabVIEW project environment. For more information on using the LabVIEW Project Explorer, refer to the Fundamentals>>Organizing and Managing a Project section of the LabVIEW Help documentation. |