LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

i've create an obeject with goop wizard,how can i save an istance of this object on file??

I've create an object with GOOP Wizard, how can i save an istance of that object on file? How can I retrive it form file?
What I mean is in a C pseudo-code like this:
-object NameObject;
-saveonfile(sizeof(NameObject),char(NameObject)...);

code examples are greatful!
Thanks to the crew!
0 Kudos
Message 1 of 3
(2,743 Views)
A GOOP object's data is stored in a cluster. To save and load this from file, create two method VIs called "MyClass Save to File.vi" and "MyClass Load from File.vi". In these VIs you will need to choose the implimentation that writes this cluster to file and reads it back from file. You can save to datalog file, XML, INI, or whatever format you want. But, the drawback is that you will need to impliment this yourself. You will also want to consider the implications of changing the version (structure) of your GOOP object's data store. Will you allow old versions to be loaded? How will the conversion from the old version to the new version be done? Another factor to consider is that objects aren't just data, they can have states that are not achievable simp
ly by reloading thier data store. For example, what if some of the data are refnums? A reference to some other object may loses its context between saving to disk and reloading from disk.

To get you started, the tool that I use to flatten/unflatted GOOP data stores to/from disk are two VIs in the Variant Configuration File IO library of the OpenG Toolkit called Write Key (Variant).vi and Read Key (Variant).vi. These will allow you to flatten just about any LabVIEW data structure to an INI file format and read it back again.

Best of luck,

-Jim
0 Kudos
Message 2 of 3
(2,743 Views)
Hi Jim!

Thank's very much i'll get i try an the Open G, seems quite nice!

Ciao
0 Kudos
Message 3 of 3
(2,743 Views)