07-07-2015 08:18 PM
How exactly can I make my app 'remember' some of the controls values till next program run?
07-07-2015 08:47 PM
Are you running in development or as an executable?
In development, you can use the invoke node to make the current values default. That way, they'll be the default values on next open. You can also right-click the controls/indicators and choose the same option under data operations.
In either setup, you can build an ini file. Save the values you want to retain in that file and start your application by initializing all of the controls/indicators to these values.
07-07-2015 10:20 PM
07-07-2015 11:31 PM
07-08-2015 12:35 AM
07-08-2015 02:46 PM
Sometimes, when I need a quick solution for this, I just put all needed data in a cluster and save it at program exit in XML file. The XML functions from the File I/O/XML/LabVIEW Schema functions palette, or the GXML library, can be used.
Then, at program start, you can read this file, if it exists (which is not true at the very first start). I usually save this file in the applications directory, in order to keep it simple.
07-08-2015 04:10 PM
@chembo wrote:
Sometimes, when I need a quick solution for this, I just put all needed data in a cluster and save it at program exit in XML file. The XML functions from the File I/O/XML/LabVIEW Schema functions palette, or the GXML library, can be used.
Then, at program start, you can read this file, if it exists (which is not true at the very first start). I usually save this file in the applications directory, in order to keep it simple.
I've had some weird stuff happen with saving all my data as one big XML string and reading it back in. I think this happens when I have an array of Variant data in my cluster? It's been a little while since I've had the problem, so I can't recall what my fix was. I think some of the syntax just gets messed up when you have an identical data type as the one to which you're flattening.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'