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: 

how can I set the default value of knob as the value that was indicated in last run

This has been discussed in the forums before.

See here or here for instance.

 

0 Kudos
Message 11 of 14
(533 Views)
Alternatively you could use the Configuration File VIs (Subpalette of File I/O Palette).  You can write basic values to the configuration file (Boolean, String, Path, DBL, U32 or I32) but no arrays or clusters at once. The ini file can have several sections with several keys. In your case it will be load at programm start an written at the end of your program. The ini file can be edited with an external editor. It's an ASCII-file.
0 Kudos
Message 12 of 14
(517 Views)

I do that all the time using Open-G tools Smiley Wink

 

Attached some screenshots to load settings at the start of the software, save settings just before quitting the software and an example of a Settings cluster, just to show you that you can save much more than one knob at the time Smiley Happy

 

Of course you have to download the Open-G tools but they are very usefull Smiley Tongue

Thanks Jim K Smiley Happy !

Download All
0 Kudos
Message 13 of 14
(506 Views)

I do this all the time.  

Use the READ KEY and WRITE KEY vis from FILE I/O - CONFIG FILE VIs.

 

Of course, you have to OPEN CONFIG FILE first and CLOSE CONFIG FILE afterwards.

 

I have a ton of such settings there.

 

I open the file when the program comes up, and close it when shutting down.

 

When a particular window comes up, I use READ KEY to get the previous value of something.

 

When the window closes, I use WRITE KEY to store the current setting.

 

That makes the window come up the next time just like they left it.

 

It stores values in an INI file in the form "Channel Selector Knob = 13"

 

You provide the name (key) you want to use and it stores it.

 

SUGGESTION:  use a typedef to store all your keynames.  Use ONE and ONLY ONE place to turn the typedef into a string for the actual key.  Otherwise you risk misspellings, mis-capitalizations, etc. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 14 of 14
(496 Views)