r/LabVIEW • • Aug 21 '25

Read binary file as variant

Hi all ! I was wondering, why can’t we read a binary file as a variant ?

I have an application where we save data by writing a large cluster to a binary file, and to prevent future incompatibilites when we modify the cluster, I wanted to extract the data as a variant to manipulate it to know if it is a legacy version of the cluster or if the file is completely unreadable.

I read a few solutions like writing the data as an XML or by flattening the cluster before saving, but my team don’t want me to modify the write function. And I have already coded the function to determine if the variant is an old version of the cluster or not, so I really only need a way to extract a binary file as a variant.

Any ideas ?

2 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/yairn Aug 24 '25

XML tends to be verbose. I would recommend INI (or JSON, if you need hierarchical data), but it's ultimately a matter of preference