LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting control default values

I am creating an executable VI fro runtime use. I would
like to set some controls to default values. However, I
would like to be able to let the end user change those
defaults later if required. Currently he can change to the
corrected values, but when he exits the app and returns
the controls will be back at the defaults. Is there an
easy way to let him set new defaults?

Thanks
Jim
SR Racing
0 Kudos
Message 1 of 11
(3,804 Views)
Jim a écrit :

> I am creating an executable VI fro runtime use. I would like to set some controls to default values. However, I would like to be able to let the end user change those defaults later if required. Currently he can change to the corrected values, but when he exits the app and returns the controls will be back at the defaults. Is there an easy way to let him set new defaults?

Hi,

There must be some cool way to do this using the InvokeNode VI familly but... I would suggest you use an "ini" file to set and define your controls initial values. In the beginning, you shall always read values from the "ini" file and write them to the controls using write-mode local variables. Then possibly implement an sub-module that will write the current values t
o "ini".


oz
0 Kudos
Message 2 of 11
(3,803 Views)
I tried to use the 'make current values default' invoke node to achieve the
result of saving all the current values stored in the controls to their
default values but it didn't work. They are always lost. I am now using the
registry to store the control's values. I am also going to have a selection
of pre-sets for the user. I think this is better than ini files.

> > I am creating an executable VI fro runtime use. I would like to set
some controls to default values.

> There must be some cool way to do this using the InvokeNode VI familly
but... I would suggest you use an "ini" file to set and define your controls
initial values.
0 Kudos
Message 5 of 11
(3,803 Views)
Hmm.. in what way is the registry better than saving to a .ini file?

Even if you're not going to deploy to a client's machine when the
application is finished, you still may have to move your work to another
machine, reinstall/replace the OS, whatever. In which case you then have to
mess about extracting your settings from the old registry and putting them
into the new. If it's all in an .ini file in the same directory as the VI
then copying user.lib is sufficient to move the whole lot to a new location.

"New" does not necessarily mean "Better"

James Annesley wrote in message
news:3abf434c@newsgroups.ni.com...
> I tried to use the 'make current values default' invoke node to achieve
the
> result of saving all the current va
lues stored in the controls to their
> default values but it didn't work. They are always lost. I am now using
the
> registry to store the control's values. I am also going to have a
selection
> of pre-sets for the user. I think this is better than ini files.
0 Kudos
Message 7 of 11
(3,803 Views)
Hi Jim,

I wrote some VIs that do this work for me and make the Application development easy. I use references to those controls that I want to save and load and store their values in an ini file with LabVIEW built in ini file VIs. It is prepared for multi user environment. If you are interested in this solution let me know so I can send you the VIs and a demo. To my knowledge there is no official way to save a control's default value in the Application like you can do in the development environment.

Regards,
Andras Ferencz
0 Kudos
Message 3 of 11
(3,803 Views)
Andras, Yes I would be interested in seeing your VI's if
you dont' mind. Thanks.

Jim
sracing@mindspring.com

>I wrote some VIs that do this work for me and make the
Application development easy. I use references to those
controls that I want to save and load and store their
values in an ini file with LabVIEW built in ini file VIs.
It is prepared for multi user environment. If you are
interested in this solution let me know so I can send you
the VIs and a demo. To my knowledge there is no official
way to save a control's default value in the Application
like you can do in the development environment.<
0 Kudos
Message 4 of 11
(3,803 Views)
What I have done in the past for this is to Read the default values from a text file. If user wants to change the default values they can change the text file. Or have the application write to the text file to change the defaults. I use the intermediate file I/O for this.

Dan Shangraw, P.E.


   

0 Kudos
Message 6 of 11
(3,804 Views)
Hi Jim,

Have a look at (The LabVIEW Technical Resource) site.
I found an article about "Remembering Control Values"
Here is the web address.
http://www.ltrpub.com/pdf/excerpts/AEremember.pdf

Hope that help.


Rejean Lafortune

CAE Electronics Ltd.
Avionics Interface Engineering
0 Kudos
Message 8 of 11
(3,803 Views)
Dear Sirs
 
I use the "save current value default.vi" from NI websit, the web address is:
 
I had tired this VI, it works well in debug model, and saves all current values as default value, but when it was built to APP, it doesn't work. why?
Could you help me?
Thanks!
 
0 Kudos
Message 9 of 11
(3,532 Views)
Hi Milkystone,

the reason it is not working is because the default values are stored in the binary data. And the run time engine don't allow you to mess with the executable.

Ton

Message Edited by TonP on 05-11-2006 08:15 AM

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 10 of 11
(3,526 Views)