LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to load the configuration data at runtime?

Hello all.

 

I am working on a data acquisition software where a user inputs different configuration data (which he may change at any point of time) like minimum and maximum temperature/pressure/rate, COM port etc. Please find the attached image of the GUI which I am doing in tab control format.

 

Now what I want is, suppose if the power goes off and the program restarts, it should load the last values of configuration settings updated by the user. One possibility I find is that we can store the various configuration data into a file and when the program reruns, it will fetch and load the corresponding data from the stored file. I am getting confused over this. Can somebody please tell me how to achieve this?

0 Kudos
Message 1 of 4
(965 Views)

@rajesh111 wrote:

One possibility I find is that we can store the various configuration data into a file and when the program reruns, it will fetch and load the corresponding data from the stored file. I am getting confused over this. Can somebody please tell me how to achieve this?


What are you confused about?  That is exactly what you need to do.  The real question is what format to save the data in.  I would probably use a JSON file.  I know a lot of people who would use a SQLite database.


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 4
(920 Views)

Look up the examples for configuration files in the Help menu.

 

You can write a starting INI file using Notepad. It saves you having to code the initial file creation. You can then read the configuration file and even modify it through your application.

 

More info here: https://zone.ni.com/reference/en-XX/help/371361R-01/glang/configuration_file_vis/

-----------------------------------------------------------------

If you can not measure it, you can not improve it.
- Lord Kelvin
0 Kudos
Message 3 of 4
(894 Views)

Save the configuration in a file and reload it when the program starts up.

 

I prefer XML for complex configuration settings, but in your case a simple text file would suffice.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 4
(884 Views)