03-24-2015 02:17 AM
Hi All
I am facing a issue when buuilding exe of my project. I have used one subVI(Placed inside SubVI folder) which is reading the excel file palced under cofniguration folder. For this I have taken "Current VIs path function .In development system environment I am striping path 2 times to reach to configuration folder and read the excel .Its working correctly. When I am building exe I have striped the path one more time extra (total 3 times)and expecting that it should read the file. As the "cuurrent Vis path function will give outputs as : "ExePath\Exename\subVI\Readfile.vi"
However in the exe , subVI's path is not taken from the exe and it is taken from the project folder only(i.e: C:\Software\ProjectName\SubVI\Readfile.vi). Due to this even after striping path 3 times its not reading the file correctly.
What could be the reason for this?
I am attaching the folder structure of the project.
Solved! Go to Solution.
03-24-2015 03:10 AM - edited 03-24-2015 03:11 AM
Hi LV_user,
recommended method is to use the AppDir constant (file constants palette). This will give you the folder where your EXE is located in…
To your question: we do not know how your subVI is embedded in the EXE. We do not know your BuildSpecs. We do not know your LabVIEW version.
We do know NOTHING to elaborate an answer for you…
03-24-2015 06:18 AM
Hi
Thanks for the reply!
I have build an application using LabVIEW version 2012. SuBVI is embedded in the project in always incluuded section of the application builder under source files. Also in souurce file settings , subVI folder settings is as per the screeshot attached.
Main VI is the startup VI for the application.
When I am running the exe ,I am getting the OP of getCurrent VI path function as : C:\Software\sample.exe\Test\Code\SubVI\readfile.vi whereas I am expecting the OP as C:\software\sample.exe\subVI\readfile.VI .(C:\Test\Code\subVI\readfile.VI is the path where my project is located).
03-24-2015 06:35 AM
Hi LV_user,
When I am running the exe ,I am getting the OP of getCurrent VI path function as : C:\Software\sample.exe\Test\Code\SubVI\readfile.vi whereas I am expecting the OP as C:\software\sample.exe\subVI\readfile.VI .(C:\Test\Code\subVI\readfile.VI is the path where my project is located).
In an EXE the VIs are stored in the same relative file position as they are in the project. So you get the very same folder/subfolder structure in the EXE!
03-24-2015 06:49 AM
03-24-2015 11:48 PM
HI GerdW and MikePorter,
Got the point!
I am now using application directory to get path of exe when running exe. Till now i was in impression that when we build exe the path for the VIs/SubVIS are taken from the exe and not from the base root folder path.
and hence while building exe we have to strip our path one more time compared to the development system environment. I have done the same thing seveal times and it worked.
If in exe also it takes the subVIs path from the base folder (for eg: C:\software\sample.exe\test\code\subvi\readfile.exe instead of C:\software\sample.exe\subvi\readfile.vi) then why we always say that we have to strip one more time extra while building application? Not clear to me ... and hence I am repeating the question... sorry for it!!
03-25-2015 06:59 AM
03-26-2015 12:57 AM
Hi Mike
Ohh...this indeed was a good information for me!! I have always build executables till LabVIEW 2009 and i guess it was in the same format which i mentioned.
I guess from LV2012 this internal exe structure is changed.
Thanks for the information!!!