Error 7 When Running Executables Built in LabVIEW 2009 and Later

Updated Jan 17, 2023

Reported In

Software

  • LabVIEW Base
  • LabVIEW Full
  • LabVIEW Professional
  • LabVIEW 2017 Application Builder Module

Issue Details

I am able to create an executable in LabVIEW 8.x that opens another file or that calls other VIs dynamically through VI Server. When I create the same executable in a later version of LabVIEW and run it, I receive the following error:

Error 7: Possible Reason(s): File not found

It appears that the dynamic VIs are not loading properly. Why can't I run an executable created in LabVIEW 2009 and later, and how do I fix it?

 

Solution

Beginning with LabVIEW 2009, the file layout of an executable was changed. For example, take a top level VI called Main.vi, located in folder AAA. Main.vi opens a file called Second.vi in folder BBB. On the development machine, the file paths of these VIs would look like the following:

C:\AAA\Main.vi
C:\BBB\Second.vi


Previously, if you build an executable in LabVIEW 8.x called Application.exe, the relative file paths of the VIs will resemble:

C:\Application.exe\Main.vi
C:\Application.exe\Second.vi


However, in LabVIEW 2009, the file paths of the VIs were changed to preserve the hierarchy such that they reflect how they are saved on the development machine. Therefore, if you build your executable in LabVIEW 2009 or later, the following are the relative file paths of the VIs:

C:\Application.exe\AAA\Main.vi
C:\Application.exe\BBB\Second.vi


It is recommended that you modify any file paths in your VIs to compensate for this change. However, if you wish to use the older LabVIEW 8.x file layout, go to the properties of your application and within the Advanced category, check the box titled Use LabVIEW 8.x file layout as shown in the screenshot below. 



Note: Any LabVIEW projects with a Build Specification built in 8.x will automatically have this box checked when opened in LabVIEW 2009 and later.