09-28-2016 04:26 PM
Is there an easy way that I can dump the current state of a Labview program/application into a "memory dump" file before I quit the program, so when I restart this LabVIEW application, it restores the info from this "memory dump" file, so I can pick up where I left off exactely?
Thanks.
Ian
09-28-2016 04:53 PM
You can use INI files or XML files to store the current state of the front panel controls and then during the loading phase of the app, if a file exists, load the values into the appropriate controls and delete the file.
09-28-2016 05:24 PM
aputman
Thank you for your input. I am not sure if we are talking about the same method, but I found the following that can work for me.
It sets all controls to their last states only, it does not set indicators to their last states. I think I can live with it.
https://decibel.ni.com/content/docs/DOC-3551
Thanks again.
Ian
09-28-2016 05:52 PM
aputman was answering your question. He is saying that you can programmatically save the values of your controls, as well as any other state information you may need to a file. When the application starts it loads the files, resets everything to the satet and resumes execution. If you are using a state machine you can literally pick up where you left off in your state machine. Unless everything you are using in your VI is a control your method will not be able to resume with everything reset to its last value. Only control values will be initialized.
09-28-2016 07:05 PM
Mark/aputman
Thanks. Can you attach a simple example to elabrate?
On the method I found, I realized if I set "Controls" to "false", I can save and then load and reset values for all indicators too.
Thanks
Ian
09-28-2016 07:59 PM
Here is an example of how I usually do saving/loading of configuration data. It uses the MGI RWA (Read Write Anything) library which you can download for free. Just go to VI Package Manager and search for MGI RWA, and install it.
--Hope
09-28-2016 08:03 PM
Just realized you may not have 2016 yet. I backsaved it to 2014, hopefully that works for you.
09-29-2016 08:35 AM
OpenG library has a VI called "Write Panel to INI". It's in the Variant Configuration File palette.
09-29-2016 08:41 AM
Oops. I just read your post above with the link to the article about CtrlVal.GetAll. Yes, that is the method that OpenG VI uses. It will also write indicator values.
09-29-2016 10:57 AM
aputman
Many thanks.
Ian