From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to read or write to txt file after executable is created

I have a vi that at start should read a txt(I gave it .cfg extension to help it stand out but it is a txt file) file and place the contents of the txt file in a string control. The last step before closing the vi is the contents of the string control is saved to the before mentioned txt file. The txt file contains a path to a specific directory. Everything works fine and the vi performs perfectly but as soon as I make an executable the txt file is not read from or written to. I included a picture of the read and write code I am using. I have sifted through the forums and tried including the .cfg file in the build as a support file but nothing I do seems to work, again the code works perfect until I make an executable. Any suggestions would be greatly appreciated.

Thank you,
Steve
0 Kudos
Message 1 of 4
(2,678 Views)
Are you getting any specific error messages?
I think the problem may arise from using the 'Current VI's Path' path. Have a look a this link in which Dennis Knutson gives a possible solution to file path problems and executables.
Hope this helps.
0 Kudos
Message 2 of 4
(2,670 Views)
There is just that little different between "Development Environment" and "Executable"
when Filepath is concern 🙂

Please see attached for your reference.

Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 3 of 4
(2,668 Views)
Thanks for the Help. I will implement the example code. This problem drove me crazy and I do appreciate the help.
0 Kudos
Message 4 of 4
(2,652 Views)