01-15-2010 04:15 PM
Hello all,
Forgive me if I use incorrect terminology here but what I would like to do is this:
In my vi I require that the user enters a path and file name for saving a file. I would like to somehow make this the default value in the file path save box the next time this program is run (the computer may be turned off between runs).
I've done some searching online but to no avail-it may be that I'm not describing the problem correctly. Does anyone have any suggestions on how I might go about doing this? It seems that it should be something quite simple but it has me vexed.
Cheers,
Alex
Solved! Go to Solution.
01-15-2010 04:22 PM
Configuration file. There is a good example:
C:\Program Files\National Instruments\LabVIEW 8.6\examples\file\config.llb\Write Configuration Settings File.vi
Jean-Marc
01-15-2010 04:23 PM
01-15-2010 04:34 PM
I've considered using a config file but here is the added problem I didn't want confuse the issue with: the file that I mentioned in the orginal post is actually itself, a config file. I need to allow different users to save it where they need to and have the program remember where the last one saved was. This isn't how I would personally create this program but convincing the powers that be to do it the other way is not an option.
I suppose I could make an inital startup config file to save where the last user's config file is.... I was wondering if there was a way to internally save this value-perhaps as a global variable or default.
Any thoughts?
01-15-2010 04:55 PM
01-15-2010 05:17 PM
You can for example save it in the system temporary folder (there's a path constant for that!) or next to the executable. If it should be different for each user, place the ini file in the default folder or default data folder.
If you have LabVIEW 2009, you have a few more predefined locations: Have a look at get_system_directory. Simply put the ini relative to one of those locations and it will know how to find it later.