daro Posted July 13, 2007 Report Share Posted July 13, 2007 Hi to all. How can I change the default value of a control while the program is running, I mean , I have a 4 as a default value of a numeric control, but I want that the user can change that value and save it, so the next time the program run, the control use the last saved value. I just need to do that for that single control, so I don't like to use a init file, is there any property that can do that? Thank you in advance. Quote Link to comment
Karissap Posted July 13, 2007 Report Share Posted July 13, 2007 There is a property node to change the default value but it is only writable when the vi is in edit mode, you could just pass the value to a second vi that references it when the vi has finished running. Quote Link to comment
Karissap Posted July 14, 2007 Report Share Posted July 14, 2007 Here is an example of calling a vi by it's reference and changing the default value of a control when it stops running. http://forums.lavag.org/index.php?act=attach&type=post&id=6345 Quote Link to comment
daro Posted July 14, 2007 Author Report Share Posted July 14, 2007 Great, thank you for your help. Quote Link to comment
Nyang Posted July 14, 2007 Report Share Posted July 14, 2007 QUOTE(Karissap @ Jul 13 2007, 07:52 AM) Here is an example of calling a vi by it's reference and changing the default value of a control when it stops running.http://forums.lavag.org/index.php?act=attach&type=post&id=6345''>http://forums.lavag.org/index.php?act=attach&type=post&id=6345'>http://forums.lavag.org/index.php?act=attach&type=post&id=6345 Would you like to tell me how to find the property node for default value? Thanks in advance Quote Link to comment
Karissap Posted July 14, 2007 Report Share Posted July 14, 2007 QUOTE(Nyang @ Jul 13 2007, 01:55 PM) Would you like to tell me how to find the property node for default value? Thanks in advance That propery is private and can only be accessed by enabling VI scripting in LabVIEW 7.1 using the ini file (a lot harder to enable scripting in newer versions). See the http://forums.lavag.org/VI-Scripting-Readme-First-t1207.html' target="_blank">VI Scripting Readme for how to enable it. Quote Link to comment
Yair Posted July 14, 2007 Report Share Posted July 14, 2007 What's the problem with using an INI file? If you have a single control the code for handling this will be simple and you know that this will work all the time (including in an executable) and that you don't have to save the VI each time. Quote Link to comment
Rolf Kalbermatter Posted July 17, 2007 Report Share Posted July 17, 2007 QUOTE(Karissap @ Jul 12 2007, 11:39 PM) That propery is private and can only be accessed by enabling VI scripting in LabVIEW 7.1 using the ini file (a lot harder to enable scripting in newer versions). See the http://forums.lavag.org/VI-Scripting-Readme-First-t1207.html' target="_blank">VI Scripting Readme for how to enable it. And it is likely to not work as desired in an executable. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.