LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't access .txt file in 2011 executable

Solved!
Go to solution

You can use a relative path your .exe to the text file.  You just have to pay attention that your VI's path is different in an .exe than it is in the development environment.

 

Why Does My Executable Not Work When Using the Current VI's Path Constant?

Message 11 of 22
(698 Views)

It is easy to adjust for whether or not you are running in an executable. Here is a VI that does exactly that. Give it the path to the current VI and it will return the folder that it is in and adjusts for whether it is in an executable.

 

     Rob

Message 12 of 22
(692 Views)

You didn't provide a text file, but I created one and again, if it is in the same directory as the EXE, the porgam finds it and loads it up.  It parsed all the data correctly.  There's still something missing.  From your code posted, I have Application.EXE and the VIDAQ Configuration File.txt in the same directory.

0 Kudos
Message 13 of 22
(686 Views)

It may also help to use the simple error handler VI to tell you exactly the error you are receiving.  Right now, you are ignoring any errors.

Message 14 of 22
(685 Views)

My apologies, you did include an example file.  And it as well works if in the same diretcory as the EXE.

0 Kudos
Message 15 of 22
(682 Views)

Had to strip off "THREE" Levels rather than two levels for Windows XP.

 

You live and learn.

 

I've enclosed the programmed application with the various levels of directory at the bottom on the first slide.

The second slide show the executable and its levels of directory.

0 Kudos
Message 16 of 22
(674 Views)

@Mark Levine wrote:

Had to strip off "THREE" Levels rather than two levels for Windows XP.

 

You live and learn.

 

I've enclosed the programmed application with the various levels of directory at the bottom on the first slide.

The second slide show the executable and its levels of directory.


Check your build specification. It looks like the build specification is putting extra folders in the destination.

 

I always change where my build goes. Usually: C:\<project folder>\builds.

 

When I worked in WinXP, I only ever had to strip one more level than when I was working in the development environment.

 

     Rob

Message 17 of 22
(670 Views)

Rob,

 

Doesn't seem to help.  It's that pesky .exe file I have to strip away.  Don't know what a .exe file is doing in the path.

 

Thanks,

Mark

0 Kudos
Message 18 of 22
(666 Views)

Did you read the link I posted?  !!

Message 19 of 22
(664 Views)

Ravens Fan,

 

I'm reading it now.  Looks like it has the answers I'm looking for.  May take a while to absorb and check out.

 

Thanks,

Mark

0 Kudos
Message 20 of 22
(661 Views)