From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Format of Byte-Stream File Comprised of Variants

I am interested in storing various forms of data in a single file, and then being able to access this file from other environments (VB). As an example, I might want to store a 2D array of U32, a 1D array of strings, and a single string within the same file.
It appears one way to do this is to convert each data object to a variant, then write the variant to a byte-stream file. LabView is able to read this back without problem, but I would like to be sure that this data would be readable from other programming environments (e.g. Visual Basic). To do this, I need to know how LabView stores variant data. This topic does not appear in Application Note 154, "LabView Data Storage".
Thanks,
Andy
0 Kudos
Message 1 of 3
(2,422 Views)
Andy,
LabVIEW stores a variant on file putting the content's own type descritor and flattened data, along with length header and some filling. Type descriptors and flattened data are LabVIEW internal formats so I do not think that it may be compatible with VB file format.
What you can to is to create a common text file format and write LabVIEW and VB routines to parse them for reading and writing.


LabVIEW, C'est LabVIEW

0 Kudos
Message 2 of 3
(2,422 Views)
Thanks for the answer. The reason the storage-as-variant approach is appealing is because you can readily store data of different type and different lengths, in a more efficient manner. As an example, if you wished to store 2 2D arrays of different length in one text file, you would need to fill in the array with less elements with "NAN" or something similar. This takes up additional space, especially if the arrays sizes are vastly different.
I guess I pretty much assumed that VB wouldn't recognize the format by itself, but I would like to know the file format is so I can write a VB data-import routine.
Thanks again,
Andy
0 Kudos
Message 3 of 3
(2,422 Views)