LabVIEW Projects


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 Window

The 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 project


The 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 Toolbars

The 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 toolbars


You 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 Project

You 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 Folders

Project 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 Project

Items 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 Files

The 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:

  • Application Use stand-alone applications to provide other users with executable versions of VIs. Applications are useful when you want users to run VIs without installing the LabVIEW development system. Windows applications have an .exe extension, Mac OS X applications have an .app extension, and Linux applications have no file extension.

  • Installer (Windows only) Use installers to distribute stand-alone applications, shared libraries, and source distributions that you create with the Application Builder. Installers that include the LabVIEW Run-Time Engine are useful if you want users to be able to run applications or use shared libraries without installing LabVIEW.

  • Shared Library Use shared libraries if you want to call VIs using text-based programming languages, such as NI LabWindows/CVI, Microsoft Visual C++, and Microsoft Visual Basic. Using shared libraries provides a way for programming languages other than LabVIEW to access code developed with LabVIEW. Shared libraries are useful when you want to share the functionality of the VIs you build with other developers. Other developers can use the shared libraries but cannot edit or view the block diagrams unless you enable debugging. Windows shared libraries have a .dll extension. Mac OS X shared libraries have a .framework extension. Linux shared libraries have an .so extension.

  • Source Distribution Use source distributions to package a collection of source files. Source distributions are useful if you want to send code to other developers to use in LabVIEW. You can configure settings for specified VIs to add passwords, remove block diagrams, or apply other settings. You also can select different destination directories for VIs in a source distribution without breaking the links between VIs and subVIs.

  • Zip File Use zip files when you want to distribute files or an entire LabVIEW project as a single, portable file. A zip file contains compressed files, which you can send to users. Zip files are useful if you want to distribute instrument driver files or selected source files to other LabVIEW users. You also can use the Zip VIs (found on the Programming>>File I/O>>Zip palette) to create zip files programmatically.

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 Features

You 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.




LabVIEW for Everyone. Graphical Programming Made Easy and Fun
LabVIEW for Everyone: Graphical Programming Made Easy and Fun (3rd Edition)
ISBN: 0131856723
EAN: 2147483647
Year: 2006
Pages: 294

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net