07-09-2015 02:41 PM
I have a cluster of buttons. Each button event causes a test to run. I color code the buttons that have been tested pass(green)/fail(red). The problem is that I want to store the progress even after the program is shut down. Maybe I could store the button control property COLOR[4] inside XML for use when I run the program at a later time. How can I do this?
07-09-2015 03:37 PM
When passing the control to XML and back, it only passes the value.
07-09-2015 03:45 PM
If you are running your program "in Development mode" (meaning you start LabVIEW, load your VI, then push the Run button), you can use the property of the VI "Make Current Values Default", which will set your controls so that the default value (when it is next run) is the current value. No muss, no fuss.
Bob Schor
07-09-2015 03:52 PM
It's going to be deployed as exe. Any way to do that in Run-time?
07-09-2015 04:03 PM
Need to see executable code (no pictures of code, please). That will help determine what you really mean by your colored buttons, and once we know, we can make suggestions.
Bob Schor
07-09-2015 05:03 PM
07-09-2015 05:32 PM
I'd take a look at ini files. Save the information you want the button to hold onto in the ini file and create an initialization state at the beginning of your code to read from that ini file and setup the buttons as you want to see them.
07-14-2015 03:48 AM
If you install the OpenG toolkit (free through VI Package Manager), there are VIs that can save/load the values of controls/indicators on a front panel to an INI file.
07-14-2015 08:59 AM - edited 07-14-2015 09:09 AM
Just a suggestion if you use the LabVIEW installer. Writing to the application directory (Program Files) requires Admin permission in Win7. I don't like creating applications that require this.
Keeping this in mind, I go with two options
Personally, if the user doesn't need to edit it, I go with the registry. It's what nearly all commercial programs do. It also allows a per-user experience.
I'll toss in my current VI's with two caveats.
(P.S. I know these only do value. I just wanted to give an example. You'll have to adapt slightly to your color requirements)
I wouldn't mind hearing what other people think.
07-14-2015 09:13 AM
"Just a suggestion if you use the LabVIEW installer. Writing to the application directory (Program Files) requires Admin permission in Win7. I don't like creating applications that require this."
If you 'unlock' (from the installer build spec settings) the installation directory users will be able to read/write files in the program files directory.
This is not recommended practice though - the user data directory is the Microsoft preferred location for these sorts of things.