LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView doesn't find file

I've got a LabView Application, which uses two txt-files (read/write to it). if i run the apllication with the LabView-Software it works fine. but if i make an executable it returns the error-code nr.7 (could not find file / or ni-488 card doesn't exist). when it trys to open one of this files. when i made the executable so i added the txt-files as support-files...
i don't know what the reasen is, that causes this error.
thx for your help
0 Kudos
Message 1 of 8
(3,889 Views)
How does your LabVIEW code call the .txt file? Is it a hardcoded path, or a relative path? I have a feeling that when you create an executable, it's either looking for a directory which doesn't exist (like the National Instruments directory which most likely doesn't exist on a PC without LabVIEW), or a relative path which is different on the target PC.

I've made executables which look for text files, so I can tell you that it can be done (both reading and writing).

Mark
0 Kudos
Message 2 of 8
(3,889 Views)
So I used the VI that ctaches the path of a VI (the toplevel VI) and then i split of this path and add the name of my txt-files. so i generate the path... doesn't this VI work if you make an application?
0 Kudos
Message 5 of 8
(3,889 Views)
54577533trh wrote:

> So I used the VI that ctaches the path of a VI (the toplevel VI) and
> then i split of this path and add the name of my txt-files. so i
> generate the path... doesn't this VI work if you make an application?
>

At least in the past build vi's path was as if it was in a llb.
So one has "strip path" one extra compared to non build vi's.

I usually place ini files one directory too up during development
process (if I use relativer path) to overcome this.

Juha
0 Kudos
Message 6 of 8
(3,889 Views)
How are you finding the files? Is the directory hard wired? Support files will be placed in the DATA subdirectory below the directory that the program is in (unless you choose custom locations from the application builder). If you are looking in the current directory, you must split off 2 file/directory names from the .EXE but only 1 file/directory name from the main program in LabVIEW.

It might be easier for us to diagnose the problem if you include your code.

Rob
0 Kudos
Message 3 of 8
(3,889 Views)
LabVIEWs App Builder creates a library inside the .EXE so you have to strip the path twice in the
the built version to get to your file. See attached "Path to File.VI".


> I've got a LabView Application, which uses two txt-files (read/write
> to it). if i run the apllication with the LabView-Software it works
> fine. but if i make an executable it returns the error-code nr.7
> (could not find file / or ni-488 card doesn't exist). when it trys to
> open one of this files. when i made the executable so i added the
> txt-files as support-files...
> i don't know what the reasen is, that causes this error.
> thx for your help
Message 4 of 8
(3,889 Views)
thanx for this very helpful vi. now it works great
0 Kudos
Message 7 of 8
(3,889 Views)
I tried running this .VI under LavView 5.1, and it would not open the file. What do I need to do, for this file to open?
0 Kudos
Message 8 of 8
(3,889 Views)