10-18-2020 07:07 PM
I'd like to add a log.txt file into my LabView projects which eventually get built up into a LabView application (.EXE). I then use that built application to distribute to multiple computers on our manufacturing floor. Currently when I build my application I have to hard code the path where I want the file which changes for every computer I put it on.
I'd like the log.txt file to always be created in the folder of my .EXE that I put on the computer. That way I always no where it is and I don't get a path error when this built up .EXE changes computers. How would I go about creating a relative path in my vi that gets built into the .EXE?
10-18-2020 07:34 PM
Look in the File Constants >> File I/O palette. There is a function called Get System Directory. You can choose from many different paths that are based on the OS.
There are primitives in there that will return things like the Application Directory.
10-19-2020 06:03 AM
@bmernax30 wrote:
I'd like the log.txt file to always be created in the folder of my .EXE that I put on the computer. That way I always no where it is and I don't get a path error when this built up .EXE changes computers. How would I go about creating a relative path in my vi that gets built into the .EXE?
Use the Application Directory function.