LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save user input data

I would like the ability to have a settings screen and allow the user to enter parameters.  These parameters need to be saved even when the program (VI) is shut down.  As an example I made a quick simple program, Sample test 1.vi.  Here there is input data, amplitude, a maximum setting and a minimum setting.  I would like the user to be able to set the settings (maximum and minimum) to the desired level, run the program, stop the program, shut down the program.  Upon restarting the program the settings should be at the last entered value. Any ideas or assistance is appreciated. Thanks,Brian

 

0 Kudos
Message 1 of 9
(5,768 Views)

Hi Brian,

 

save the settings to an in file (aka config files) on exiting the settings dialog...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(5,764 Views)
Great tip!  even LabVIEW itself uses this technique!

"Should be" isn't "Is" -Jay
Message 3 of 9
(5,749 Views)
Jeff, Correct you are hardily working, not much help.  Obviously if I was more familiar I could shoot a sarcastic comment to myself and get it done.  I am relatively new and have limited programming experience with LabVIEW.  I posted the question to see if someone could help me with my application; perhaps someone keen enough to give me some insight on how it works.  There is always something new to learn—don’s give up Jeff. Brian

 

0 Kudos
Message 4 of 9
(5,743 Views)
Look through the example VIs that ship with LabVIEW. They have examples on working with ini files. I have included an example of the VIs that we use for our applications as well.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 5 of 9
(5,739 Views)

Your comments to Jeff are really uncalled for. He was commenting that an ini file is a great idea and that LabVIEW itself uses ini files to save user settings.

 

All that you have to do is start the example finder and go to the Fundamentals>File Input and Output and look at the read and write configuration file examples.

Message 6 of 9
(5,736 Views)

 

 

Yes, correct I did reach harshly.  Sorry Jeff. 

 

I took it as a sarcastic remark.  My mistake for replying with the message; I feel like an ass.

 

Brian

Message 7 of 9
(5,700 Views)

More or less in order of my favorite to least favorite methods...

 

  • With controls in cluster(s), flatten to XML. Save it as a XML file. Unflatten from XML to read back into Local Variables when program starts back up.
  • Use Open G Configuration file utilities.
  • Use "keys" individially into INI file. Reading the INI file back is intuative if not bulky.
  • Save settings as pure text. Parse text > populate locals.
  • Write settings down on piece of paper. > Read from paper, manually populate the screen.

 

 

Message Edited by Broken Arrow on 10-02-2009 10:54 AM
Richard






0 Kudos
Message 8 of 9
(5,696 Views)

Flüssige überwachung wrote:

 

 

Yes, correct I did reach harshly.  Sorry Jeff. 

 

I took it as a sarcastic remark.  My mistake for replying with the message; I feel like an ass.

 

Brian


I've done it myself----- Thanks for the apology.  I Certainly did not mean to sound sarcastic!  But, in my defense, it IS the obvious solution Smiley Surprised

A "*.ini " saves months of 'whoooooops' programingSmiley Wink


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 9
(5,675 Views)