07-15-2009 08:08 AM
Hey,
So heres my problem:
I'm building a stand-alone application and I want to be able to save the state of multiple VI's into one file and be able to reload that later. The problem is, some of my VI's are called dynamically with reentrant execution (so there is multiple of the same VI) and some are called just once. I've tried doing this using Invoke Node "getAllFlattened Data" and saving it to an XML, but the problem is when I try and reload the XML, is doesn't create those VI's that are dynamically loaded and load those settings. Is there an easier way LabVIEW has a way of dealing with this?
I also looked into configuration VI's however I don't really have the ability in my program to sift through all of the key names and so forth to save those to a file.
Is there a way to just take like a "snapshot" of the way the application is currently running and then be able to restore it later to the same state?
Brad
07-15-2009 08:54 AM
Hi Bard,
why do you need to create the dynamically loaded vi's? How do you create them at the first time? Do you try to store and restore a user configuration?
You can use the xml format, but you should know to which vi the data belongs to.
Mike
07-15-2009 09:08 AM
Thanks for the response.
Some further explanation of what I'm doing.
The part of my program that I want to save includes the "Measurement Display Window" which is a tab based window. Each tab has the same sub-panel on it, with a "Display Window Template" VI being loaded dynamically into each of the sub-panels. This is so that the user can have up to 8 different, indepenedent, displays in which to configure. The data I need to save from the Measurement Display Window includes, which tabs are visible (I hide and show each as the user adds them), data file location, and some boolean values for other options. With the Display Window Template (dynamically loaded into each of the sub-panel on each tab), I need to save data like, range of the graph, update style, and channel names that were selected to be displayed in the Text based view of the data. To add on to this, each Display Window Template has its own "Channel Selection" window where the user can selected different channels for each Template, and likewise tab in the Display Window. From the Channel Selection VI, which is also dynamically loaded with the Template VI, I need to include the data that tells me which channels the user selected in each of the Display Templates. This is the vast majority of the saving. One last VI, "Trigger Window" save the information regarding the trigger(s) that the user may have implemented. This one is not dynamically loaded.
Right now I have an array of the references to the Display Window Template VI's, and I can easily get the reference to the Display Window and Trigger Window, it is the Channel Selection Window that becomes the challenge. But I'm also wondering if there is an easier way to implement this. I'm currently looking into GOOP and LabVIEW Classes and an easier way to keep track of which references are currently open and closed and implementing all the save method VI's in the Display Window Export Class. Do you think this would be a better option?
Any ideas? I know this sounds really confusing, intially saving and loading were not in the requirements for this program so I'm trying to work a little backwords here to implement it.
Thanks,
Brad
07-15-2009 09:14 AM
Hi Bard,
if you have all references then you already know which window is there and you can store this information. You can also get the control references from your vi reference to store these values and ranges.
Mike
07-16-2009 07:27 AM
Thank you for you help.
I have been able to successfully export and import files settings for all the VI's necessary. However, I'm know having a problem that when I import the values, it doesn't actually signal the values even those is "shows" they are indeed there. The way I'm importing the values is like this:
I'm importing an XML file and coverting it down to get the name, type descriptor, and flattened data, then using the setControlValue:FlattenedData Invoke node to apply the settings back to the controls. This invoke node however doesn't signal the values. Is there a way for when I import these values I can signal them?
An example would be, if the default value for the Chart Update Mode is Sweep and I save it into the XML file as Scope, then load it back. It will say Scope but it will continue to behave like Sweep
Any thoughts
Brad
07-16-2009 10:01 AM - edited 07-16-2009 10:01 AM
Hi Bard,
how do you update it? I made an example and it works as expected.
Mike
07-16-2009 10:34 AM
07-16-2009 02:06 PM
Hi Bard,
what type of event is it? You can use the property "value(sgl)" to trigger a value change event.
Mike