Saving VIs

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Select File»Save to save a VI. You can save VIs as individual files or you can group several VIs together and save them in an LLB. LLB files end with the extension .llb. National Instruments recommends that you save VIs as individual files, organized in directories, especially if multiple developers are working on the same project.

National Instruments recommends that you save your VIs in certain directories. To make VIs easily accessible, limit the number and levels of directories you use in a project.

Advantages of Saving VIs as Individual Files

The following list describes reasons to save VIs as individual files:

  • You can use the file system to manage the individual files.
  • You can use subdirectories.
  • You can store VIs and controls in individual files more robustly than you can store your entire project in the same file.
  • You can use third-party source control providers.

Create a directory for all the VIs for one application and save the main VIs in this directory and the subVIs in a subdirectory. If the subVIs have subVIs, continue the directory hierarchy downward. When you create the directory, organize the VIs and subVIs modularly according to the functionality of the subVIs.

Advantages of Saving VIs as LLBs

The following list describes reasons to save VIs as LLBs:

  • You can use up to 255 characters to name your files.
  • You can transfer an LLB to other platforms more easily than you can transfer multiple individual VIs. You also can ensure that the user receives all the files needed.
  • You can slightly reduce the file size of your project because LLBs are compressed to reduce disk space requirements.
  • You can mark VIs in an LLB as top-level so when you open the LLB, LabVIEW automatically opens all the top-level VIs in that LLB.
Note  LabVIEW stores many of its built-in VIs and examples in LLBs to ensure consistent storage locations on all platforms.

If you use LLBs, consider dividing your application into multiple LLBs. Put the high-level VIs in one LLB and set up other LLBs to contain VIs separated by function. Saving changes to a VI in an LLB takes longer than saving changes to an individual VI because the operating system must write the changes to a larger file. Saving changes to a large LLB also can increase memory requirements and decrease performance. Try to limit the size of each LLB to approximately 1 MB.

Managing VIs in LLBs

Use the LLB Manager window, available by selecting Tools»LLB Manager, to simplify copying, renaming, and deleting files within LLBs. You also can use this tool to create new LLBs and directories and convert LLBs to and from directories. Creating new LLBs and directories and converting LLBs to and from directories is important if you need to manage your VIs with source control tools.

Before you use the LLB Manager window, close all VIs that might be affected to avoid performing a file operation on a VI already in memory.

Note  You cannot cancel changes you make in the LLB Manager window.

(Windows) You also can double-click a .llb file in Windows Explorer to display the LLB Manager window so you can open, move, copy, rename, and delete files in the LLB.

Naming VIs

When you save VIs, use descriptive names. Descriptive names, such as Temperature and Serial Write &, make it easy to identify a VI and know how you use it. If you use ambiguous names, such as, you might find it difficult to identify VIs, especially if you have saved several VIs.

Consider whether your users will run the VIs on another platform. Avoid using characters that some operating systems reserve for special purposes, such as \ : / ? * < > and #.

Note  If you have several VIs of the same name saved on your computer, carefully organize the VIs in different project libraries or LLBs to avoid LabVIEW referencing the wrong subVI when running the top-level VI. Refer to the LabVIEW Style Checklist for more tips on how to name VIs, LLBs, and directories.

Saving for a Previous Version

You can save VIs, LabVIEW projects, and project libraries for a previous version of LabVIEW to make upgrading LabVIEW convenient and to help you maintain files in more than one version of LabVIEW when necessary. Select File»Save For Previous Version to save for a previous version of LabVIEW.

Note  To save packed project libraries for a previous version of LabVIEW, save the files in the packed library for a previous version and rebuild the packed library.

When you save a VI for a previous version, LabVIEW converts not just that VI but all the VIs in its hierarchy, excluding files in the labview\vi.lib directory.

If a VI, project, or project library uses functionality that is not available in the previous version you attempt to save to, LabVIEW saves as much as it can and produces a report of what it cannot convert. The report appears immediately in the Save for Previous Warning Summary dialog box. Click the Show Details button in the Save for Previous Warning Summary dialog box to open the Load and Save Warning List dialog box and review the details of each warning. You also can click the Ignore button to acknowledge these warnings and close the summary dialog box. Click the Save to File button in the Load and Save Warning List dialog box to save the warnings to a text file you can review later.

If you save a password-protected VI for a previous LabVIEW version, you must enter the password. You also can enter the password programmatically as an input on the Open VI Reference function.

Automatic Saving for Recovery

In the event of an irregular shutdown or system failure, LabVIEW backs up any modified VI (.vi), VI template (.vit), control (.ctl), control template (.ctt), project (.lvproj), project library (.lvlib), XControl (.xctl), or LabVIEW class (.lvclass) files open at the time of the shutdown or failure to a temporary location.

Note  If you are entering text anywhere in a file at the time of the automatic save, LabVIEW does not save that file. This behavior prevents automatic saving from disrupting text entry.

Select Tools»Options and select Environment from the Category list to enable or disable saving for recovery and to specify how often LabVIEW should back up files. If you enable automatic saving, LabVIEW backs up files before you run a VI. You also can configure LabVIEW to back up files at periodic intervals.

LabVIEW stores backed up files in the LVAutoSave subdirectory of the default data directory. Do not access or modify the files in the LVAutoSave directory manually.

If LabVIEW automatically saves files before an irregular shutdown or system failure, the Select Files to Recover window appears the next time you launch LabVIEW. Select the files you want to recover and click the Recover button. If you do not want to recover any files, deselect all files and click the Discard button. Click the Cancel button to move all selected files to the LVAutoSave\archives subdirectory of the default data directory. You can delete the contents of this subdirectory when you no longer need the backup files.

Note   Selecting a project or library for recovery does not automatically recover changes made to files in that project or library. To recover a modified project or library and all of its modified contents, make sure there is a checkmark beside the owning .lvproj or .lvlib file and beside each file the project or library contains.

Automatically saved files do not overwrite existing manually saved files. LabVIEW retains automatically saved files only until you manually save, discard, or archive the files.


Not Helpful