Using code management tools is essential, but choosing from LabVIEW's many options can be tricky. Here I will explore Project Libraries (.lvlib), Classes (.lvclass), Libraries (.llb), Packed Project Libraries (.lvlibp), Projects (.lvproj), and VI Packages (.vip) so that you can compare each tool's purpose and behaviors to make smart choices on which to use in YOUR codebase.
With more than just a few VIs, proper use of code management tools is essential. LabVIEW provides a variety of good options, but choosing which tools to use for various scenarios requires an understanding of both the broad intent of the tool as well as nuanced differences between them.
Project Libraries
LabVIEW project libraries are collections of VIs, type definitions, shared variables, palette files, and other files, including other project libraries. When you create and save a new project library, LabVIEW creates a project library file (.lvlib), which includes the properties of the project library and the references to files that the project library owns. A project library file does not contain the actual files it owns, unlike an LLB, which is a physical directory that contains VIs. Files that a project library owns still appear individually on disk in the directories where you saved them.
Classes
You create user-defined obljects in LabVIEW by creating LabVIEW classes. LabVIEW classes define data associated with an object, as well as the methods that define the actions you can perform on the data. The benefits of encapsulation and inheritance allow you to create modular code that is easy to change without affecting code throughout the application.
In LabVIEW, the data of a class is private, which means only VIs that are members of the class can access the data. You define the data of the class in the private data control. When you create and save a LabVIEW class, LabVIEW creates a class library file (.lvclass) that defines a new data type. The class library file records the private data control and information about any member VIs you create, such as a list of the VIs and various properties of the VIs. The class library is similar to the project library (.lvlib). However, the class library defines a new data type.
The private data control is a unique class library file that defines a cluster of data for the new data type and is the data on the class wire. LabVIEW does not save the private data control on disk. Instead, LabVIEW saves it inside the class library file. Saving the private data control inside the class library file allows LabVIEW to ensure that you never use the wrong private data with the class definition.
Packed Project Libraries
LabVIEW packed project libraries are project libraries that package multiple files into a single file with a .lvlibp file extension. The top-level file of a packed library is a project library. By default, the packed library has the same name as the top-level project library.
All VIs in a PPL are pre-compiled, which means:
- These VIs are only changed/updated when the PPL is built.
- They are built specifically for one version of LV and one specific target.
When you open a packed library, you see only the exported LabVIEW VIs. Exported VIs are VIs in project libraries with a public access scope or VIs in LabVIEW classes with a public or protected access scope.
VI Package Manager
VI Package Manager (VIPM) is a package management tool that organizes and maintains packages within your LabVIEW environment. It’s a tool for obtaining and configuring libraries and development tools, but you can also subscribe to shared repositories created with VIPM. These various third-party development libraries and tools are supported for download via the LabVIEW Tools Network or the VI Package Network.
VIPM allows you to quickly access third-party networked code repositories and get them into your LabVIEW development environment quickly. With this, it also helps you build your own reuse tools into packages which can be installed in LabVIEW. VIPM has configuration management features that help you configure your LabVIEW development environment for your current project.
VI Package (.vip)
A package is a file which contains all the necessary components wrapped together along with the actual tool which is to be installed. The package provides information related to its destination, compatible LabVIEW versions etc. Package files are saved in the *.VIP format.
VI Package Build (.vipb)
These files are a close parallel to LabVIEW application build spec.
Various aspects of the build are defined including:
- Package properties/metadata (Name, company, author…)
- Source directory/files included
- Output directory
- Destinations for package deployment (vi.lib, user.lib, etc.)
- Source file settings
- Advanced:
- Install/versioning requirements
- Dependency management tools
- Licensing/activation tools
VI Package Configuration (.vipc)
This is a list of packages that is managed as a group and can be deployed for use with a specific LabVIEW version. This list can be saved to a file and later recalled and applied. Package configurations are saved as *.VIPC files and you can create package configurations using the VI Package Configuration Editor window.
Learn more about DMC's LabVIEW programming expertise.