LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build exe and file path

Solved!
Go to solution

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

0 Kudos
Message 1 of 7
(9,314 Views)

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.

Message 2 of 7
(9,301 Views)
Solution
Accepted by topic author jmax007
Start by reading this page. 🙂
Message 3 of 7
(9,296 Views)
A trick I use is to put the VIs handling paths into a LLB. Then I do not have to worry about exe or delevopment enviroment. You do not have to put all VIs in your project into a LLB. 


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 4 of 7
(9,265 Views)

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. Smiley Happy

 

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.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 5 of 7
(9,243 Views)

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 😉



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 6 of 7
(9,231 Views)

altenbach wrote:
Start by reading this page. 🙂

ThankYou

This is exactly what I was looking for 🙂

 

 

0 Kudos
Message 7 of 7
(9,205 Views)