09-14-2009 05:00 PM
Hi All
I am trying to build an exe inorder to distribute my program to another PC. My first attempt at this has failed and I am in need of some assistance. My program is rather large with near a hundred SubVi. In my project sturcure these are organised in folders.
Some of these SubVi are reading and writing to files (excel) and this all works great when in my development environment.
I am opening my top level vi and building the exe succesfully. My first problem is that when I try to run the application, I get a runtime error that the "file cannot be found".
In my development I am using "current VI path.vi", "strip path.vi", "build path.vi" and "create dir if non-existant.vi" to load and create files.
All of these .vi's are used relative to where the current VI is stored.
Since these files I am loading/saving are settings, they need to be distributed with the exe file.
I know that when I create the .exe file, it also creates "data" folder.
So, my question is:
When the executable is created, what will the "current VI path.vi" return?
Do I have to move my files to the created data folder, and also change my SubVi's to look at that folder?
Thanks
Jamie
I am using LV2009
Solved! Go to Solution.
09-14-2009 07:45 PM
Remember that a VI that is built into an executable, the executable becomes a path to the VI. So generally you will have to strip path twice in the exectuable to get the directory where in the development environment you would only have to strip the path once.
Search the forums on strip path and executable and you'll see numerous other people have had this problem before.
09-14-2009 08:00 PM
09-15-2009 04:36 AM
09-15-2009 05:57 AM
Coq Rouge wrote:
A trick I use is to put the VIs handling paths into a LLB.
This is a very good trick, I would say.
I think I ve done this in few of my projects, but without doing much thought or analysis about why it is working properly in both the Devp environment & the EXE.
09-15-2009 06:34 AM
parthabe wrote:I think I ve done this in few of my projects, but without doing much thought or analysis about why it is working properly in both the Devp environment & the EXE.
A LLB and an exe file is both working as a container for storing the VI code. Therfore the paths will follow the same convention. It is not more than that 😉
09-15-2009 10:30 AM