Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Separating Compiled Code from VIs

LabVIEW 2010 Help

Edition Date: June 2010

Part Number: 371361G-01

»View Product Info

By default, a VI contains compiled code. When you edit the VI, LabVIEW recompiles the code of the VI. LabVIEW also recompiles any VIs that call the VI, causing you to save VIs that you do not edit because recompiling causes an unsaved change. If you use source control, separate compiled code from the VIs you check into source control so that the VIs that you do not check out do not have to recompile.

When VIs with separate compiled code recompile, you do not have to save the VIs because they do not have unsaved changes. To separate compiled code from a VI, place a checkmark in the Separate compiled code from source file checkbox on the General page of the VI Properties dialog box.

When LabVIEW opens a VI with separate compiled code, LabVIEW generates and saves a VI object file (.viobj), which stores the compiled code. When LabVIEW generates a VI object file, the compiled code is no longer part of the VI.

If a VI with separate compiled code is a top-level VI, LabVIEW loads the front panel and block diagram of the top-level VI and loads the compiled code of the subVIs.

Note  If you intend to load or run a VI using the LabVIEW Run-Time Engine, do not separate compiled code from the VI.

VIs with Separate Code in LabVIEW Projects

In a LabVIEW project, you can separate compiled code from all new VIs you create in the project. Place a checkmark in the Separate Compiled Code From Source File checkbox on the Project page of the Project Properties dialog box to separate compiled code from new VIs.

When you place a checkmark in this checkbox, LabVIEW does not automatically separate compiled code from the VIs if you add existing VIs to the project. To separate compiled code from existing VIs in a project, click the Mark VIs button on the Mark Project VIs to Separate Compiled Code dialog box. You also can separate compiled code from each VI.

VI Object Files

A VI object file contains the compiled code of a VI with separate compiled code. The VI object file saves the compiled code for a specific target, which indicates the LabVIEW version and operating system of the VI you save. When you load a VI with separate compiled code, LabVIEW compiles and generates a VI object file and saves the file in the object cache.

If a VI object file already exists, the compiled code in the VI object file loads. Each time you save or reload the VI, the VI object file updates with the changes.

Note  A VI without a front panel or block diagram is not the same as a VI object file. You do not need to access a VI object file directly.

VI Object Cache

The object cache is the folder where LabVIEW saves all VI object files. The object cache is located in the LabVIEW Data directory.

Note  Because you do not access VI object files directly, you do not need to manually access the object cache.

LabVIEW does not automatically delete VI object files. Because the object cache is a collection of the VI object files of all VIs with separate compiled code, you might need to free disk space by deleting VI object files in the object cache. You also might need to delete VI object files to recompile one or more VIs. Specify the object cache you want to clear in the Clear Compiled Object Cache dialog box.

When you delete the VI object file of a VI, LabVIEW creates a new VI object file the next time you load the VI. However, each time LabVIEW generates a VI object file, the VI takes longer to load because it has to recompile.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit