Error 7 or Error 1003 Occurs When Using VI Server in a LabVIEW Application

Updated Nov 6, 2023

Reported In

Software

  • LabVIEW

Issue Details

My LabVIEW application uses VI Server to call and run another VI. When I run the application, I receive Error 1003 or Error 7.
 

Solution

You can receive Error 1003 or Error 7 when you try to call a VI by reference or try to run a VI dynamically using VI Server and the called VI cannot run. A common reason the VI cannot run is because LabVIEW cannot locate it or one of its subVIs. This also often occurs when the VI depends on a driver that has not been installed on the current system (for example, NI-DAQmx or NI-SoftMotion).

The easiest way around this is to include any VIs that you call dynamically and dependencies into the build. The procedure for this is shown below. However, if the VI being called by VI server is not static, for example, if it is changed after build time and you do not want to rebuild and distribute the entire executable, ensure you use relative file paths for the VIs you will be calling. You will also need to copy the VIs you would like to execute into the relative file path on the target machine. Besides, see Building and Distributing Applications for the proper process for building distribution.

For LabVIEW 8.5 and later:
Include the dynamically called VIs in the Always Included section of the Source Files tab in the Application Builder build specification.
 

 

For LabVIEW 8.0 to 8.2:
Include the dynamically called VIs in the Dynamic VIs and Support Files section of the Source Files tab in the Application Builder build specification.
 

For LabVIEW 7.1 and earlier:
Click Add Dynamic VI from the Source Files tab in the Application Builder build specification.
 


If the error still occurs, load the VI in the LabVIEW development environment and make sure it is not broken. If you do not make any changes to the VI and receive a prompt to save changes when you close the VI, some subVIs were found in a different location. Save the VI with the new locations and build the application again.

Additional Information

If the code you are calling by reference was written in a previous version of LabVIEW and the executable is being built in LabVIEW 2009, the project will generate incorrect paths when built. Please see Error 7 When Running Executables Built in LabVIEW 2009 and Later.

When using relative paths with the Current VI's Path Constant and after re-building the stand-alone executable with the LabVIEW 8.x file layout property checked, you might need to consider the number of times required to strip the path, see Error 7 in Executable When Using the Current VI's Path Constant.

If you do not want to include the VIs called dynamically into the build an alternative is to create a Packed Project Library to include all the dependencies of the VI in the library. Otherwise, if you try to call the VI dynamically the dependencies of that VI won't be loaded if not already part of the LabVIEW executable. For more details, check the link in the Related Links section: "Dynamically Called SubVI Does Not Load When Built Into an Executable".