Well I thought it was a good use case for LabVIEW Data Tools...
Look at the attached example. The record type is provided to the VI as a cluster. When there are many ways to read the same datatype (PString, LVString, Fixed length string), the format in included in the element label. The cluster may be any combination of datatypes and is accepted on input as a variant.
Using the LabVIEW Data Tools VIs, the cluster is converted to an array of variants (its elements). In a loop, each element is read on file. Binary numbers are read according to their length. Strings are read and converted to LabVIEW strings according to the format provided on the label (dataname). The data is then converted back to a variant cluster. On t
he caller diagram, this variant cluster is converted to a typed cluster record as shown, using "To G Data" function.
The main advantage here is that you have a single VI that can read all the record types. You have to create a cluster for each different record type that you expect to use but the same VI is used to read the records from file.
To use the attached example, you have to download and unzip the
lvdata and
error packages at http://sourceforge.net/projects/opengtoolkit. Copy the VIs folders in your user.lib directory.
Post again for any question or problem about this code.