LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create .exe that sends results to .txt, keeps looking for folder with .exe name

Created a project that logs the results to a .txt file that was setup in "Source File Settings" as a subfolder "Test Results",  but when I run the .exe it trys to write the results to a folder with the same name as my .exe file. I must have something set up wrong under my Build properties.

 

Thanks Chuck

0 Kudos
Message 1 of 4
(2,311 Views)
Or you have something setup wrong in your code. Are you aware that the path to a folder is different when you create an exe than in the development environment. If you are using something like Current VI Path, you need to do an extra strip path.
Message 2 of 4
(2,302 Views)

Even though this knowledgebase's question does not address your question directly, it does expand on what Dennis said about the path being different between the development system and the executable. And how the it adds another layer in the executable.

 

The part that is most useful to you is this:

 

" Consider a VI named Application.vi located in the hard drive's root directory (e.g. C:\). In the LabVIEW development environment, the Current VI's Path function returns:

C:\Application.vi

Now consider the same VI built into a stand-alone application named MyApplication.exe. When running, the Current VI's Path function returns:

C:\MyApplication.exe\Application.vi

Therefore, when you have an executable, you must strip the path twice to get to the owning directory.  To write a VI which will return the current directory both as a VI and after being built into a stand-alone application, use LabVIEW's Application Kind or Application Name properties to determine in which environment the VI is running. "

 

Hope this helps!

 

 

Warm regards,
Karunya R
National Instruments
Applications Engineer
Message 4 of 4
(2,237 Views)