LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Executable not loading files

I am using LabVIEW version 8.2. I'm trying to turn a project (consisting of around 350 files) into an executable. It has turned into an executable but the problem is that it is not working as the non-executable version works. Specifically the executable does not load front panels in the browser. The user interface vi loads other vi's front panels into a sub-panel. The main vi that loads into the browser loads fine (actually its a vit) but other vi's don't load into its dub-panel. What is wrong? Any suggestion or solution.

Several thouths are running through my mind at the moment;
1- If I include all files in the "dynamic vi's and support files" section would it work then? What are the implications of such an action?
2- Is this a vesion related issue? I have gone through the other related posts and found some mentions regarding version 8 and 8.2. Does porting the project into version 8.5 solves this issue?
3- The project used to have fixed paths imbedded in several vi's. I added a vi that finds the location of the projects base folder and modifies the paths accordingly, so that even if the project is located (as a whole) into some other folder structure it still works. Do I have have to append the executable's name (for example app.exe) to the existing path making scheme for the project to be able to be turned into an executable. (I'm attaching the path building vi's, kindly go through them and modify them for the executable version of the project. The top folder of the project is called LAM and it contains a subfolder called program which contains further 1 level of sub-folders which contain all the vi's.)

Please help (thanks and gratitude is all I can offer in return).
0 Kudos
Message 1 of 12
(5,162 Views)
Hi rashid,

two points:
1) when you dynamically load vis you have to add them in the build process as dynamic vi!
2) in an executable the "path to vi" changes as it now includes the exe name as additional directory level. All vis are located in this additional directory with no sub-folders!

All this is not version related, it has been like this since LV can create executables (AFAIK).


Message Edited by GerdW on 03-05-2008 11:30 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(5,152 Views)
Thanks a lot for the answer GerdW!
Your oint number 2 raises 2 questions in my mind;
1- If my executable is called LAM.exe, then does that mean that I have to append \LAM.exe\ infront of every vi call (drive:\path to vi\LAM.exe\somevi.vi)?
2- "
All vis are located in this additional directory with no sub-folders!". If I have a main directory for the project and it contains a program folder which contains 1 more level of sub-folders for different component vi's for the project; would the path structure leading to vi's change some how? (For example if I have a file called closeexcel with following path c:\LAM\PA-Excel\closeexcel.vi, would it now become c:\LAM\PA-Excel\LAM.exe\closeexcel.vi?)
(Can you check the attached files to see if they would work in the executable and if possible can you make changes to them so that the executable make start working properly).

Thanks a lot!
0 Kudos
Message 3 of 12
(5,144 Views)


GerdW a écrit:

2) in an executable the "path to vi" changes as it now includes the exe name as additional directory level. All vis are located in this additional directory with no sub-folders!


There a several documents on ni.com about this difference. For example this one.

0 Kudos
Message 4 of 12
(5,139 Views)
Hi rashid,

1) If you want to call your vis with full/absolute path: yes. I would recommend to use relative path: get path of main vi, add relative path to subvi.
2) You should use relative path, especially in an exe. LV will look for vis in the current directory (which is the exe) so just call them with their name!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 12
(5,138 Views)
Thanks for the link JB!
I'll go through the documents and bother you again I something needs more clarification.
0 Kudos
Message 6 of 12
(5,135 Views)
Dear JB,

I found the article you pointed out very useful indeed. I also found a vi at the location you pointed out. I incorporated the code into my own path building code. It still is not working in the executable but working fine in the development mode (earlier version was also doing fine in the development mode). I'm attaching the files. Can you or someone (kindly) look into the code and modify it so that it may work correctly.
In the project there were absolute paths, to overcome this shortcoming I developed this vi, so that it might still find the correct path even if the project (main folder + sub-folders) are placed inside some other folder. The absolute path looked like this C:\LAM\Program\Excel\Excelclose.vi. I pass Program\Excel\Excelclose.vi to the path builder and it appends the correct location to it.
Please help!
Thanks!
0 Kudos
Message 7 of 12
(5,122 Views)
Hi rashid,

not sure which path you really need.
See attachment with some comments...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(5,112 Views)
Can someone find some vi's for me which can make correct path depending on whether the program is running in development mode or executable mode.
Thanks!
0 Kudos
Message 9 of 12
(5,091 Views)
Here is one. You will find the original in the document I have linked in my previous message.
0 Kudos
Message 10 of 12
(5,087 Views)