02-25-2019 04:25 AM - edited 02-25-2019 04:27 AM
Hello everybody,
I have a main VI that loads other VIs as sub panels onto it. These subVIs are called dynamically when running my VI. When building an executable I select my subVIs in Always Included and the Main is selected as Startup VI.
After building my executable I get error 7: file not found NI-488 GPIB non existent.
The VI is not in the path it shows in the error description but I selected the right path in my project manager so I don't understand why it selects the wrong path when running the exe.
I tried copying the VI in the expected path in the error description but that didn't really solve the problem instead I gor error 1003.
The problem only occurs in the executable not in developing environment.
I know there are already a lot of threads about this problem but I couldn't find one that matches my problem.
LV Version 2015
Best Regards,
A.B.
Solved! Go to Solution.
02-25-2019 04:46 AM
Have a look on this article:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019NFfSAM&l
The realtive path is changing if a VI is imbedded inside an executable.
02-25-2019 11:13 AM
How are you setting a path? I would set a path relative to mainVI (or other VI that is loaded as a subVI), it will not change. Building relative to application directory is not a good idea.
Dev environment:
C:\Project\main.vi
C:\Project\SubVIs\dynamic.vi
Exe
C:\app.exe\main.vi
C:\app.exe\SubVIs\dynamic.vi
dynamic.vi path = Build path(Main.vi path, "..\SubVIs\dynamic.vi").
03-01-2019 05:42 PM
Hi alex,
I used the 8.x file layout while building the exe and now it all seems fine but whats the difference between these 2 layouts? (old vs new)
03-01-2019 06:09 PM
@a.b229 wrote:
Hi alex,
I used the 8.x file layout while building the exe and now it all seems fine but whats the difference between these 2 layouts? (old vs new)
The 8.x format compiles into a flat hierarchy. The new format compiles into a zip file like format, preserving the relative paths between all of your VIs. If you are dynamically calling VIs, it is best to use the new format and use Current VI Path, Strip Path, and Build path to create the absolute path to the VI you want to call. This way, it will work in both the development environment and the built executable.