From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving all user inputs as default

Hi,

 

I am trying to save all user made settings into a file. So that Labview loads the old settings as default.

I was not able to find a simple setting for this case so I looked already some stuff up and got a half working solution running. I think the example is somewhere here on the board as well.

 

What I wanted to have is, if a value of a Control is changed it should be saved and also showing the saved value after restarting labview. (instead of the standard value which is set on the UI).

 

My problem is as following:

What is possible: load and save integers and bools

What is not possile: load and save strings and DAQmx-settings.


Maybe some of you already put work into the same problem and can me help me out here 🙂

0 Kudos
Message 1 of 8
(1,170 Views)

Look into using Configuration Files (File I/O->Configuration File VIs palette).  They are very simple and you can store all kinds of settings (strings, booleans, floating point values, integers).

 

The next type of file I would look at is JSON.  I am a huge fan of the JSON Text library (available through VI Package Manager).  JSON can allow more complex data types (clusters, arrays).

 

Whichever you choose, you just need to update the values in the configuration and save the file after a setting is changed.  Then at application start up, you read the configuration and set the controls/settings.


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
0 Kudos
Message 2 of 8
(1,161 Views)

Oh, just Use datalogging @

 

It's built in already and you just have to use it rather than reinvent it. Or even learn anything about how LabVIEW stores some of those esoteric IO controls.   LabVIEW does datalogging it in its native binary format. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 8
(1,145 Views)

Another option is to use the "MGI Application Control" tooklikt from VIPM. They have two VI's that would likely do what you want, and are super simple to use.

They are called "MGI Save Front Panel Data.vi" and "MGI Restore Front Panel Data.vi"

 

They essentially will just save the state of all controls and indicators to a file, or reload the file and set the controls and indicators.

0 Kudos
Message 4 of 8
(1,135 Views)

@ShockHouse wrote:

Another option is to use the "MGI Application Control" tooklikt from VIPM. They have two VI's that would likely do what you want, and are super simple to use.

They are called "MGI Save Front Panel Data.vi" and "MGI Restore Front Panel Data.vi"

 

They essentially will just save the state of all controls and indicators to a file, or reload the file and set the controls and indicators.


IIRC, those vis use the datalogging functions. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 8
(1,115 Views)

thank you guys.

 

working with the mgi right now, but starting to have problems with saving the vi and/or not able to load it the next day. Don't know if that's related to mgi though.

0 Kudos
Message 6 of 8
(1,065 Views)

ok it broke my code again.

All work deleted

me1ody_0-1645526188298.png

 

0 Kudos
Message 7 of 8
(1,052 Views)
Go back and try the datalogging functions. They are based on everything LabVIEW has ever done. Proven working functions since Version 1

"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 8
(1,040 Views)