02-02-2006 02:31 PM
02-03-2006 02:59 PM
02-03-2006 03:20 PM
OK. I think I did something similar but now, after you stop the application and then restart it, you get the initial, old values, not the new values that you input before stop. In other words, your settings will always be initialized with fixed values from the subvi that doesn't pop up and I don't want this. I want them to be the ones that i last picked when I updated the settings...
Any other suggestions?
Thank you for your time and will to help
02-03-2006 05:45 PM
If you are running the program in LabVIEW, you can use an invoke node on the subVI to "Make Current Values Default" and then save the subVI.
If you are running an executable, the easiest way is to save and load the settings in some kind of file (.ini files work well since there are good VIs for reading and writing these). Make Current Values Default only works on an executable until it is removed from memory. When reloaded from disk, it will come up with what the settings were at the time that the executable was compiled.
Rob
02-06-2006 07:10 AM
Thank you Rob.
I think you are pretty close to the answer...
Nevertheless, I do not want some default values to be always available for the vi. I want the current settings to become 'default' or the settings for the next time I open that main vi.
Maybe this is what you said already but I did not understand. Would you have a simple example to show me?
Thanks a lot.
02-06-2006 10:20 AM
02-06-2006 10:32 AM
Thank you UncleBump (I enjoyed the name by the way).
I do have the settings in a cluster but I do not know how to do this:"you could flatten that into a binary string, and write it to disk in your last state. Then open this file in your initialize state." Sorry, would you have an example?
Meanwhile I came up with this solution: I have the cluster with settings in an event structure window; I made an indicator (that I hide) of the cluster in that window and then a global variable for that indicator. Then, I put the global variable outside the state machine to initialize the 'loop'. I also put shift registers on the while loop that includes the event structure. Thus, when I upgrade the settings they upgrade also in the initializing global variable. It appears this works. Every time I open the program I have the latest settings available and if I change any setting it imediatly becomes available to the acquire program from adjacent event case due to shift registers, and updates the initializing variable also. I still need to test this better... Do you see any problem?
Would this work in an executable? I would have to try but if you know the answer, please, let me know.
Thank you.
02-06-2006 11:37 AM
Try changing your settings and when you stop the program, quit LabVIEW. Restart LabVIEW and see if the changed settings were remembered. If you did not save your VI after you changed the settings then they will not be remembered. The same is true for an executable. You can not write to the executable.
I think that the easiest is for the settings to come from outside the program (a separate file). I have included one of my early test VIs for this.
Rob
02-06-2006 12:17 PM
Thank you Rob. It's a start.
unfortunately it looks kinda complicated for me now. I'll take a closer look...maybe my mind will open...
Thanks