11-22-2010 02:50 PM
I am using Labview for data logging purposes building my own data logger for binary files. I want to embed an identifier of some sort in the header of the file such that I can take the identifier and build a cluster to pass in as the data type for reading a sample of data from the rest of the file. This includes nested clusters in the cluster. If anyone has any experience the help would be appreciated. Thanks
11-22-2010 05:46 PM - edited 11-22-2010 05:46 PM
You cannot programmatically build a cluster at run-time like that. That would require being able to change the code at run-time, and you cannot do this since an application cannot modify itself. Scripting will allow you to programmatically build a cluster, but it's not designed to be used in the way you're envisioning.
It sounds like perhaps a polymorphic VI would be better suited to what you are trying to do. You would write a VI to handle each of your possible formats and then you can use a case structure to pick out which VI to run to read your file based on the identifier in the header file.
11-23-2010 09:16 AM
Hello,
Have you considered an XML implementation? You could flatten LabVIEW Object data as XML strings, which in turn will be read into LabVIEW by providing a reference data type. There are built in XML schema VIs in LabVIEW. There are also a number of 3rd party libraries, like GXML, if you prefer a different type of organization and parsing algorithm.
Cheers,
Patrick Corcoran
Application Engineering Specialist | Control
National Instruments