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.
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.
02-17-2022 08:28 AM
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 🙂
02-17-2022 08:53 AM
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.
02-17-2022 09:07 AM - edited 02-17-2022 09:13 AM
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.
02-17-2022 09:46 AM
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.
02-17-2022 10:51 AM
@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.
02-22-2022 01:16 AM
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.
02-22-2022 04:36 AM
ok it broke my code again.
All work deleted
02-22-2022 06:21 AM