How to Mass Compile in LabVIEW

Updated Jul 27, 2023

Environment

Software

  • LabVIEW

  • What does the mass compile option in LabVIEW do?
  • How do I perform a mass compile?
  • How do I update my project, containing multiple VIs, to a new version of LabVIEW?

Mass compiling LabVIEW code will ensure that the LabVIEW project and VIs are saved in the version of LabVIEW that is being used. A further explanation of this can be seen in the Additional Information section.

To perform a mass compile:
  1. Close all the VIs and projects currently open in LabVIEW.
  2. Open the Mass Compile tool:
    • LabVIEW 6.0 and higher: Select Tools » Advanced » Mass Compile.
    • LabVIEW 5.x and earlier: Select File » Mass Compile.
  3. Choose the directory of the VIs to compile from Directory to compile.
  4. Choose a directory to save the log file from Log Results.
  5. Enable the Cache VIs checkbox if you want LabVIEW to keep the VIs in memory so that they do not need to be loaded every time a top-level VI is compiled. (The recommended number of VIs is between 50 and 80.)
  6. Click on Mass Compile.

Additional Information

What is a Mass Compile?
When mass compiling, LabVIEW opens and closes VIs automatically. This does the following:
  • Ensures that all subVIs exist and relinks them to the main VI. It decreases loading time since LabVIEW will not need to search for the VIs.
  • Updates the VIs to the current LabVIEW version.
  • Reports corrupted VIs which can prevent them from loading correctly.
You can read more about this process here: Mass Compiling VIs - LabVIEW Help.



Mass Compile Log
This log is important because it will report the VIs with problems. Once you have mass compiled the code you can review the log of the mass compiler in the Status tab. There are several typical warnings you can expect:
  • The VI expected to be at __ was loaded from __
This warning message resembles a load path warning. This warning notifies you of a new linkage in your environment. Review these warnings to ensure that all new VI linkages are appropriate.
  • Could not load __ because __ in memory
These are true cross linking errors in which LabVIEW may choose the wrong subVI to link because of subVIs with duplicate names on disk. Refer to chapter 4, Cross-Linking, in Best Practices for Managing NI LabVIEW Applications Using the Project Explorer for more information regarding cross-linking problems.

Load path warnings or errors are typically included in the log when the directory structure of your project changed or when you copied your project to mass-compile from another computer that has a different directory structure.

Once the messages regarding moved files have been reviewed and fixed, mass compiling a second time will reveal non-linking problems with VIs. You should look for the following string in the mass compile reports to identify insane objects that exist in your application:
  • Insane Object
 The log also indicates if these insane objects were fixed by the mass-compile routine.
  • ###
Although rare, the mass compile might crash when working with unstable VIs. It is unlikely that you will experience a mass-compile crash unless a particular VI is in a bad state that would also crash LabVIEW when loaded and saved. If the mass compile crashes, the log file will indicate which file caused the crash. Locate and open these files to ensure they are not corrupted, and then mass compile again. It may be necessary to remove this file from the folder if the mass compile will not successfully complete in a directory due to the bad file.

When moving a project between different machines and mass-compiling it on the new machine, a common troubleshooting step is to compile the project both on the original machine and the new one. Differences in the logs on the original and target machine can reveal the issues to fix.
 
 Mass Compile Log Viewer
This tool allows you to quickly make sense of mass compile logs. It provides a user-friendly interface to provide detailed information on each log entry, and helps address some of the errors. 



Force Recompile
If you would like to Force Recompile the binary of the VIs in memory, press <Ctrl-Shift> and the Run Arrow of the main VI. The recompilation process may take a while. Save the VI(s) afterwards. While it is typical for nothing to happen after binary recompiling the VIs in memory, this can frequently fix/isolate many errors.