LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build a Application EXE with File who remeber the Path

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

0 Kudos
Message 1 of 11
(1,781 Views)

Lots of things could cause that.

 

Default values, constants, ini file values.

0 Kudos
Message 2 of 11
(1,753 Views)

does it meen that normaly the EXE remembers the last value?

0 Kudos
Message 3 of 11
(1,740 Views)

@felixfelex wrote:

does it meen that normaly the EXE remembers the last value?


no.

0 Kudos
Message 4 of 11
(1,736 Views)

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.

0 Kudos
Message 5 of 11
(1,731 Views)

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.

0 Kudos
Message 6 of 11
(1,701 Views)

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.

0 Kudos
Message 7 of 11
(1,698 Views)

Can you explain a little bit more please. 

0 Kudos
Message 8 of 11
(1,689 Views)

@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.

Message 9 of 11
(1,680 Views)

Combining a User-Created .ini File with LabVIEW.ini for Distribution 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 10 of 11
(1,675 Views)