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 can help 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 possible workaround for this type of issue 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 workaround 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 screenshot below: Disconnect type definitions and Remove unused members of project libraries.
- If you get this error while building an example of the LabVIEW Sound and Vibration Toolkit, make sure that you unchecked the Additional Exclusions mentioned in the previous bullet point, to avoid removing important dependencies used by the toolkit.
- 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. Perform a 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 that 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.
- If you are seeing this error while building a real-time application that communicates with an FPGA, and it is calling it by bitfile reference, try refreshing the FPGA VI reference in it:
- In your RT main VI, open the block diagram > right-click the Open FPGA VI Reference Function > Configure > deselect Bitfile > click OK > right-click the Open FPGA VI Reference Function > Configure > select Bitfile again to refresh the reference > Save your VI and try building the application again.
- Error 1502 can occur if you have used LabVIEW State Diagram Toolkit to construct the state machine.
- Right-Click on the state machine loop > select Unlock Code From Editor Wizard.
- Find all Integer to Enum nodes and replace them with Variant To Data nodes.