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

Updated Jun 18, 2021

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.vidbe on disk.

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.