LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving the state of controls

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?

0 Kudos
Message 1 of 6
(2,293 Views)

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 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 6
(2,282 Views)

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.



Never say "Oops." Always say "Ah, interesting!"

Message 3 of 6
(2,268 Views)

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


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 4 of 6
(2,261 Views)

For the most bare-bones solution...

 

 

Look at "operate >>> Data Logging"

 

It will log all  FP to files and let you rewind etc.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 6
(2,252 Views)

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.


___________________
Try to take over the world!
Message 6 of 6
(2,238 Views)