1. Introduction to the LabVIEW Real-Time Module Interactive Deployment Process
When you click the Run arrow in a LabVIEW Real-Time application, or right-click a LabVIEW project and choose a Deploy menu option, the LabVIEW IDE must performs the following steps:
- Ensure that all LabVIEW Real-Time VIs are cross-compiled for execution on the desired real-time hardware target (e.g. CompactRIO, Real-Time PXI, etc). Depending on the specific hardware used, the code may be compiled for either x86 or PowerPC architectures and used with underlying ETS or VxWorks embedded OSs.
- Download the compiled code to the embedded target, include linking information, and load the code into memory.
- Run the LabVIEW Real-Time application on the target.
Figure 1. The LabVIEW Real-Time deployment process involves several steps, from cross-compiling code for the intended hardware to loading and executing applications on the target.
For LabVIEW Real-Time applications with a large number of VIs, the deployment process can take several minutes, as each VI is compiled and transferred to the hardware target with a handshaking protocol. The following section discusses several specific optimizations implemented in the LabVIEW 2011 Real-Time Module, which improve development efficiency by reducing iterative deployment times.
2. Deployment Time Improvements in the LabVIEW 2011 Real-Time Module
Real-Time VI Object Caching to Avoid Repeat Compiles
In LabVIEW 2010, you can separate VI source code from its object code using the Separate Compiled Code from Source File option in the VI Properties dialog window. When this option is enabled for a given VI, its object code is stored in a database in the LabVIEW data directory VI object cache folder.
The LabVIEW 2011 Real-Time Module uses this same object cache to store cross-compiled LabVIEW Real-Time code. While LabVIEW still must compile the VIs in a LabVIEW Real-Time application before running the application on a hardware target, in subsequent deployment operations (during iterative development) LabVIEW only needs to recompile VIs that have changed. You do not need to activate object caching – it is automatically enabled when developing LabVIEW Real-Time applications. You can, however, clear the object cache manually by selecting Tools»Advanced»Clear Compiled Object Cache.
Figure 2. With the LabVIEW 2011 Real-Time Module object caching improvements, you do not need to wait for unchanged VIs to recompile when deploying iteratively.
By reusing compiled LabVIEW Real-Time VIs rather than recompiling each time you deploy an application, you can save a significant amount of time when iterating code. For large LabVIEW Real-Time applications, the compilation process can take up to 70 percent of the total deployment time. The object caching improvements made in the LabVIEW 2011 Real-Time Module dramatically reduce compile times for repeated deployments. Note that the exact speedup is dependent on how many VIs are edited between deployments.
Keeping LabVIEW Real-Time VIs in Memory on Embedded Targets
In addition to always recompiling LabVIEW Real-Time VIs for iterative deployment operations, LabVIEW 2010 and earlier versions typically required re-transferring and reloading cross-compiled VIs on your embedded target whenever you edited an application on your development PC. This loading time accounted for up to 30 percent of overall deployment time.
The LabVIEW 2011 Real-Time Module greatly reduces this load time for iterative deployments. Instead of re-transferring and reloading all LabVIEW Real-Time application VIs, only VIs that you have modified (and have been recompiled) on the host development computer are transferred via Ethernet and loaded on the target. This significantly reduces transfer and load time and, ultimately, overall deployment time.
Figure 3. You are likely to see the "already deployed" text in the LabVIEW 2011 Real-Time Module deployment dialog, as only VIs that have been modified are re-downloaded to your target hardware.
Packed Project Library Deployment Improvements
Packed project libraries (*.lvlibp), introduced with LabVIEW 2010, reduce compilation time by packaging multiple VIs into a single file. Previously, including a packed project library in a LabVIEW Real-Time application required individually deploying each VI used from the library.
With the LabVIEW 2011 Real-Time Module, packed project libraries in a LabVIEW Real-Time application deploy as a single unit. Not only does this reduce the overhead associated with repetitively transferring individual VIs, it also means that once you deploy the packed project libraries, the VIs they contain are available in memory on the target if used in subsequent iterations of the same application.
Summary: Overall Iterative Deployment Time Reduction
Though the deployment time per iteration of a LabVIEW 2011 Real-Time Module application varies based on code size, the scope of edits made, and more, initial benchmarks of an 100-VI application show a deployment time reduction of up to 70 percent (versus the LabVIEW 2010 Real-Time Module).
As a whole, the improvements in object caching, keeping LabVIEW Real-Time VIs in memory on embedded targets, and packed project library deployment substantially reduce the penalty associated with making incremental improvements to your LabVIEW Real-Time code. Ultimately, this means that with LabVIEW 2011 you can rapidly prototype new ideas and drive systems and products to completion in less time.