LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reinitialize default value upon closing the program

Solved!
Go to solution

Hi guys,

 

Although I should be working on the main chunk of my program, I'm thinking of convenient features for the user.

 

One feature is having the user input be defaulted to the current value upon closing. 

 

For example, in my situation the user will have to specify the GPIB address of multiple instruments. 

After the program has been executed and terminated, the default values will be changed to the current GPIB addresses

as the GPIB addresses of the equipment will likely not be change. 

 

I notice the "VISA resource name" function-> Data Operations -> Make Current Value Default.

Is there a programmical way of changing this?

 

Thanks,

William

 

0 Kudos
Message 1 of 5
(3,165 Views)
Solution
Accepted by topic author SeriousTyro

You cannot change the default values of a running VI.  Instead, write the data to a config file at closing. When the program opens, read the config file and set the values to what is in the file.

 

Lynn

Message 2 of 5
(3,161 Views)

Awesome. I would see config files when browsing through program folders and took them for granted. Didn't think about using it until you pointed it out.

 

Thanks. Smiley Very Happy

0 Kudos
Message 3 of 5
(3,128 Views)

Not sure if you are familiar with OpenG but they have a Write Panel to INI and Read Panel from INI which will save all controls on a front panel to a human readable INI file.  I usually write this to a temporary file on the start of a test, then read it on the start of the application.  This way if the program dies unexpectedly (ie power outage, or BSOD), the previous settings will be remembered.

0 Kudos
Message 4 of 5
(3,104 Views)

Thanks,

 

I'll look into that. 

0 Kudos
Message 5 of 5
(3,086 Views)