09-29-2020 08:08 AM
Hallo,
i have a VI who has to open a Text file and has to safe in diffrent Text and Excel files. When i Build a EXE and open it on a diffrent Computer its always searching for the Paths i used a my PC.
How is it possible that the EXE is remembering the Path i put in after closing the EXE?
Regards,
Felix
09-29-2020 09:41 AM
Lots of things could cause that.
Default values, constants, ini file values.
09-29-2020 10:30 AM
does it meen that normaly the EXE remembers the last value?
09-29-2020 10:37 AM
@felixfelex wrote:
does it meen that normaly the EXE remembers the last value?
no.
09-29-2020 11:37 AM
It would be a lot easier to help if you could share your code. The exe will not "remember the path" from the previous run unless it has been programmed to "remember the path." Without seeing your code it is impossible to guess as to how it is programmed.
09-30-2020 04:14 AM
Here is a Part of my programm. When i build a exe i want that the Exe remebers the last path i put in by using the exe.
My Problem is that i want to use the Exe on diffrent PCs but the Path is always the path i was using by creating the VI. On the other PC this Path didnt exist.
09-30-2020 04:19 AM
You could use the ini file that LabVIEW makes for executables.
The source code can use a similar ini file.
When building the exe, you can choose to use a custom ini file. So you can give your executable an ini file with a path that is the same for each executable, but different from the path your source code used.
09-30-2020 04:58 AM
Can you explain a little bit more please.
09-30-2020 05:25 AM
@felixfelex wrote:
Can you explain a little bit more please.
What aspect?
You can interface with ini files though a library. Either NI's "Configuration File VIs" or a library (like Configuration-File-Library ).
You'll need to open the file, and read the value when you start, write the value when you change it or when you save the file, and save the file.
Opening the correct file (the source file could be at a different relative path from the executable file) can be done with the Application Directory function.
"Use custom configuration file" can be found under Advanced in the exe's build specification.
09-30-2020 05:34 AM
Combining a User-Created .ini File with LabVIEW.ini for Distribution