10-01-2011 09:21 AM
In LabVIEW 2010 or 2011 I open a .txt file in a read file program that is one level below the main routine.
When I make an executable of the main routine it can't find the .txt file even when I put in the executable folder and at a directory level above.
Used to work in LabVIEW 8.0.
Thanks,
Mark
Solved! Go to Solution.
10-01-2011 09:37 AM - edited 10-01-2011 09:38 AM
Can you post some code so we can look at it?
Are you accessing the .txt file with a relative path? When built into an executable, there is one extra layer added to the path that must be stripped.
example in development environment:
vi path = c:\<vi location>\vi_name.vi
in executable:
vi path = c:\<executable location>\executable.exe\vi_name.vi
Rob
10-01-2011 10:49 AM
Are your OSs the same? Windows 7 has placed more stringent restrictions on file access.
10-01-2011 11:25 AM
I have Windows 7. What's the fix?
When I make an executable of the READ subroutine by itself it works fine (like it always did in Windows XP LabVIEW 8.0).
Making an executable of the MAIN program for which the READ is a subVI one layer beneath MAIN it can't find the text file.
Thanks,
Mark
10-01-2011 11:30 AM
How can I post the code?
When I copy the block diagram I get a message saying I've exceeded 10,000 words.
I can send a zip file of the whole thing if you tell me how to attach it.
Thanks,
Mark
10-01-2011 11:44 AM
You can send in a ZIP file by pointing to it with the Attachments box right below where you enter your message on the board.
Here:
Have a good day.
Rob
10-01-2011 11:49 AM
Here is the zip file with all the code. MAIN VIDAQ is the top level.
Read VIDAQ Variables reads the .txt file.
Thanks,
Mark
10-01-2011 12:33 PM
Your code is looking for the file to be in the same directory as the EXE. If running as source, it is looking one directory above the code.
10-01-2011 01:17 PM
That's true but it doesn't work. Can't find the .txt file in the .exe folder even though I put it there.
That's the problem I'm experiencing.
I know what it should do but it's not doing it.
10-01-2011 01:30 PM
When I use the full path name for the .txt file it works. Of course now I have to know in which directory the executable will go before I make the build.
Another big dissappointment.