This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

LabVIEW Error 1502 When Building an Application

Updated Apr 24, 2020

Reported In

Software

  • LabVIEW Application Builder Module
  • LabVIEW

Issue Details

I get error 1502 when trying to build an application with LabVIEW:

An error occurred while building the following file:

<File Path>

The VI became broken during the build process. Open the Build Specification and enable debugging to include the front panel and block diagrams.

 

Solution

Error 1502 occurs when the Application Builder attempts to load VI dependencies or block diagrams due to a weak link to certain required components. More details can be found in the Additional Information section below.

There are several settings in the Application (EXE) build properties dialog box which typically resolve this issue. Changing these settings will significantly increase the compile time, and size of the executable. However, it will not greatly affect execution speed.
 
  • A first option that can be effective for solving this problem is to Enable debugging in the Advanced category. Checking this option will include block diagrams that will greatly increase the application size (by approximately double), but will usually resolve this error.
 
 
  • Another option is to include the front panel and block diagram of the VI that is causing the error.  Navigate to the Source File Settings category and select the VI that is causing the error. Uncheck the Remove block diagram box. If the VI is not listed in the Project Files section, then select Dependencies. Uncheck the Remove front panel and Remove block diagram boxes
 
 
  • Uncheck the following settings in Additional Exclusions as seen in the screen shot below: Disconnect type definitions and Remove unused members of project libraries 
 
 
  • Another reason this problem could be occurring is if there are dependencies from a previous run time of LabVIEW that have been deprecated for your current version. Make mass compile your project following the indications provided in How to Mass Compile in LabVIEW.
 
  • This error is commonly caused by building an application from a VI that has code which will never execute; for example, having a constant wired to the selector terminal of a case structure. In addition, this may be caused by deleting or removing SubVIs and dependencies from the project that may still be loaded in memory.
    • If you continue to run into issues with your subVIs not executing after resolving this error, try unchecking Remove unused polymorphic VI instances and Disconnect unused inline subVIs under the Additional Exclusions section when building your executable.
 
  • Error 1502 can sometimes also occur if there are Diagram Disable structures or Conditional Structure Code. It is advised to remove from the block diagram any code that will not be used. For example, code that is in the disabled case of a Diagram Disable structure.
    • It is also recommended to explicitly include code from project dependencies.

Additional Information

When building an application, the first step that LabVIEW does, is to make a copy of the code as a source distribution to a new directory, along with changing settings for the purpose of compiling into a single EXE file. Error 1502 occurs when something in that process goes wrong. This is caused by weak links which can occur from several things such as: Diagram Disable Structures, bad dependencies, etc..