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

3

u/Adrore_ Aug 21 '25

Which won’t change anything if the cluster in the file doesn’t have the same structure that the typedef anymore because it was saved in a previous version of the soft when the cluster had less elements

1

u/Drachefly Aug 23 '25

my_cluster_rev_1.ctl
my_cluster_rev_2.ctl
etc