Real-Time Deployment Error: VI Loaded With Errors on the Target and Was Closed

Updated Jun 21, 2023

Reported In

Hardware

  • cRIO-9066

Software

  • LabVIEW Real-Time Module

Other

  • Real-Time Targets (e.g. CompactRIO, PXI RT Controller)

Issue Details

I can't deploy my LabVIEW code to my Real-Time target, I get a message saying that one of my VIs was loaded with errors on the target and was closed.

The error may take the following forms:

[LIBRARY NAME].lvlib:[YOUR VI NAME].vi loaded with errors on the target and was closed.

Deploying [YOUR VI NAME].vi [YOUR VI NAME].vi loaded with errors on the target and was closed.

Solution

If you recently upgraded versions of LabVIEW, your VIs may need to be recompiled to run properly on your target. Follow the steps in Forcing a VI to Recompile to do this.

If LabVIEW has not been upgraded and this error appeared after making changes to your code, this issue can often still be corrected by force-recompiling your VIs. If that does not change the behavior, you can attempt to resolve this by clearing the object cache in LabVIEW in order to ensure that everything is recompiled before deployment. There are two ways to do this:
  • In LabVIEW, go to Tools >> Advanced >> Clear Compiled Object Cache.
  • Delete the following file: C:\Users\<USERNAME>\Documents\LabVIEW Data\VIObjCache\<VERSION>\objFileDB.vidb on disk.

If the previous steps didn´t work, you can consider locating the VI that is displayed in the error message and removing the parent VI, saving, and closing the project. Then reopen and reinsert the parent VI. This normally allows the project to be able to deploy and run. 

Additional Information

This error has also appeared while using FPGA functions in Real-Time. Make sure the VI you're compiling for Real-Time does not contain FPGA functions. If you wish to communicate your Real-Time target with your FPGA target, there are different options such as Read/Write Contro, or User-Defined Variables. For more information check the related link.