LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data files for backward compatability.

I am currently saving the data in my appplication as a datalog file (LabView specific). The data contains strings, clusters, arrays etc.. so it's not a case if simple Binary data)

The problem I have is that the software/program is always being developed and more variable added to be saved. This software is kind of in use and I therfore need the old data files to be backward compatible with the new program.

With datalog files, you have to provide an image of the exact data file structure to load, so obviously with the new data structure, the old files will no longer load. How can I over come this? Is there a simple way.

The only way I thought of, was to save my data in.csv format. For example, I would save an excel/a
rray matrix of say 20 x 100 which would give me 2000 cells to work with (plenty). I could then save all my data into this file, but always saving a 20x100 matrix, so even if I update the program in the future to save a further 5 data values/clusters etc.. for example, the saved matrix would not need to change and it would simply have the same image, but with 5 more cells filled.

Would this work?
I theory it sounds feasable, but do you have another/better method.

At present, I am using datalog file I/O and simply save a few extra blank clusters/doubles etc.. so I have a bit of scope to add thing, but this is not aceptable really.

There would also be other benfits for me if I use a .csv excel file, but it's not critical, other file formats will also be ok.

Thanks for any help/advice.
ADE
0 Kudos
Message 1 of 4
(2,443 Views)
One way is to leave a string for future data. When new data is to be added, it can be flattened and strored in the string. The new data should also have a string for future use...

Another way is to use a datalog file of variant data. Transform the datatype to variant and set a variant attribute to specify the data type/version. When reading a file record, read the type attribute and convert the variant data to proper cluster version and then to the most recent datatype. Keep a control copy of each datatype stored in the file and conversion VIs to convert datatypes to the most recent type.


LabVIEW, C'est LabVIEW

0 Kudos
Message 2 of 4
(2,443 Views)
Many thanks for your help.
I like your second idea, but am struggling to visualise how this works. Do you have any examples of this approach.

As for the first aproach how would you convert/flatten a cluster into a string. The cluster in question itself, contains strings, doubles, boolean's and waveform data arrays. I think this would be a bit long winded to perform, so I'd prefer to adopt your second approach.

Regards
Ade
0 Kudos
Message 3 of 4
(2,443 Views)
I have attached a VI to show how to proceed with variant datalog files. The same could be achieved using flattenned cluster strings with added format header.
The other VI demonstrate how to design cluster with placeholder string for future use. This can be a hassle to retrieve data unbundling and unflattening many levels deep so I have shown a clever way to typecast to a single cluster once the all datafields are filled.


LabVIEW, C'est LabVIEW

Download All
0 Kudos
Message 4 of 4
(2,443 Views)