LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting default values for controls at runtime

Hi,

How can we allow the user to set/change the default values for controls at runtime?
We can do this in the development environment but are unable to do the same in the compiled application (exe).

We are using LV 7.1 and NI-DAQ 7.2 on Win2000 Prof.

Thanks in advance.

- Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 1 of 6
(4,650 Views)
In the development environment, you can change the control values before pressing the "run" button.
You can mimick this situation in an exe, if you put all the controls in a while loop which wait until the user press a "Run" boolean, leaving the user the opportunity to change the initial "default" control values.
Another solution could be use a "prefs" file (just an ordinary spreadsheet file), storing all the initial vals, and to load them at run time. Create, if necessary, an independant vi (editor) to modify the pref file.
Hope this help...
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 6
(4,650 Views)
You can't change the real default values of any front panel object after you build your applicaiton into an executable. Likewise, you can't change the default value of anything while in the developnet environment while your application is running, and for the same reason as the executable.

Changing the default value requires the code to be recompiled. Recompiling cannot be done while the applicaiton is running, or after it's built into an executable.

You can mimic this function by reading the controls and storing values in config files. Then use local variables to update the controls when needed.

You might want to take a look at the Openg toolkit. It has a set of config file vi's that can read an entire front p
anel, write it to a config file and read the file back so you can update the panel as needed.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 3 of 6
(4,650 Views)
Ed,

Thanks!

Also, I am unable to find the "Save VI Control Values" and "Load VI Control Values" VIs mentioned in below linked document.
Kindly advice where to locate them.

http://zone.ni.com/devzone/conceptd.nsf/webmain/1C98B128C80E52BE8625692E0055D456?opendocument

Thanks,
Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 4 of 6
(4,650 Views)
Ed,

Thanks!

Also, I am unable to find the "Save VI Control Values" and "Load VI
Control Values" VIs mentioned in below linked document.
Kindly advice where to locate them.

http://zone.ni.com/devzone/conceptd.nsf/webmain/1C98B128C80E52BE8625692E0055D456?opendocument

Thanks,
Gurdas
0 Kudos
Message 5 of 6
(4,650 Views)
The two VI's mentioned are not part of LabVIEW. They refer to an article that was in one of the LabVIEW Technicle Resource issues.

You could visit LTR's website and find out which issue the VI's were in and purchase that single issue to get the VI's. ($25 I think).

Or you could look into the Configuration File VI's that are part of the OpenG Toolkit I memtioned in my first answer. These are free to use.

Of course you cold also look into building your own using the Config file VI's that come with LabVIEW. On teh Functions palette, look in the 'File I/O>Configuration File VIs'. There's actually enough there to do it your self.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 6 of 6
(4,649 Views)