08-15-2012 02:47 AM
Here's the task..
I have a number of front panel controls consisting of rings, numeric indicators and checkboxes. These controls are settings for a number of processes like integration, FFT and other mathematical operations. These operations are applied to a fixed number of signals.
Now say the controls are configured differently for each signal... E.G.
Signal 1: Integrate, Filter
Signal 2: Filter, Don't Integrate
Signal 3: Integrate, Don't Filter
How can I save the state of the controls for each signal? Currently my controls are in a type-defed cluster of references. I would prefer not to write a config file if there is another option.
Ideas?
08-15-2012 05:55 AM
You have to write it somewhere. If you dont like config files you can store it in the windows registry.
You can get a reference array of all front panel items (or make a custom one), then store value in registry with label as key, and load and set items the opposite way.
/Y
08-15-2012 07:35 AM - edited 08-15-2012 07:37 AM
I was going to ask a similar question to this.
Can one save the controls' states in an uninitialized shift register (or a WORM global)? That would mean not having to write to somewhere external.
08-15-2012 07:56 AM
James Mamakos wrote:
Can one save the controls' states in an uninitialized shift register (or a WORM global)? That would mean not having to write to somewhere external.
Depends on your application. If you are trying to restore values when starting up an app, that will not work. As soon as the VI or global leaves memory (when the app closes), all of your information is gone. You have to save the information to disk in some format. Personally, I'm partial to configuration files (ini).
08-15-2012 08:59 AM
For the most bare-bones solution...
Look at "operate >>> Data Logging"
It will log all FP to files and let you rewind etc.
Ben
08-15-2012 12:11 PM
If your problem with config files is with the users changing them or with the code required to handle them, then you can do something like this - https://decibel.ni.com/content/docs/DOC-15349
It handles an array of references, not a cluster, but I assume you should be able to manage that.