LabVIEW Development Best Practices Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving Objects to Disk

I'm looking for best practices for saving objects to disk.

My use case:

I have a distributed system where I'm collecting a bunch of raw data and saving it in a .tdms file.  I also have an array of satellite configuration objects that I would like to save.  The satellite config objects contain information about each satellite and an array of channel config objects, which contain conversion information, serial numbers, etc.  Right now we are taking the array of satellite config objects, flattenning it to XML (using the built-in LV xml schema) and then storing that as a file-level property.

the problem is:

Anytime I edit the config classes and add more information, somehow I'm breaking the mutation history and now I can't load old datafiles.  When I unflatten the xml I get errors.  At the moment we are still in development, so not a huge deal.  We have collected any real meaningful data yet, but I foresee problems in the future.

What does anyone else do to handle this situation?

Am I going about this all wrong, as far as how I'm storing the configuration data?

Would I be better-off just to write my own mutation algorithms?

Any other thoughts?

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
0 Kudos
Message 1 of 4
(4,389 Views)
0 Kudos
Message 2 of 4
(3,317 Views)

thanks David.

I had seen that before, but apparently I missed the following bullet.

You can do load from previous and save to previous mutations in your Serializable's To Serial Form and From Serial Form. Mutations can include renaming the classes.

It seems like exactly what I'm looking for!

Sam

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
0 Kudos
Message 3 of 4
(3,317 Views)

Taggart: Please keep me posted on how the library works for you. There have been a few people who have used it successfully, but they've all been people who could lean on me directly for help. I have tried to make the various options as obvious as possible, but that's not always easy. Take a look at the test VIs. Those show off most of the mutations and conversions that are possible.

0 Kudos
Message 4 of 4
(3,317 Views)