Hello Dennis,
I've been out of the office for a couple of days and have now returned to this issue. Thanks for pointing me at Write Datalog File Example.vi. I have been studying it and have learned a lot. Unfortunately, I'm still at a loss to understand the format of the file produced by the example. I'll walk through what I've learned, and perhaps light will dawn on marble head (mine) as I do so. Or perhaps a light will shine for you that says, "Oh, I see what he's missing. If he just knew this blatently obvious piece of information, then he never would have had any questions to begin with. Let me tell him this and his confusion will vanish!"
So... off to the races.
I see that the example collects 10 records of 100 single precision random numbers. (The "10" and the "100" can be changed at runtime, but I'll go with these numbers for now).
For each 100 sample record, a date and timestamp string is bundled with the sampled data.
A datalog is opened (replacing an existing one with the same name, or creating a new one as needed) with the "Open/Create/Replace Datalog" Palette object. This object is provided a sample record type consisting of a bundle with an empty string and an empty single precision array.
After opening the datalog, the example application enters a "while" loop in which it generates 100 (nominally) single precision random values (between 0 and 1) and a date/time string, bundles the string and the array of single precision values together, and hands that bundle to the "Write Datalog" Pallette object to scribble onto disk. It executes this while loop 10 times (nominally) and the application exits.
That all makes sense to me. Now, I want to look at the file that was produced by running this example...
The first 4 bytes of the file are:
0x44, 0x54, 0x4c, 0x47, which just happen to be the ASCII characters 'D', 'T', 'L', G'.
Those 4 bytes are followed by 41 various and miscellaneous binary valued bytes until the ASCII string "empty array" shows up in the binary data stream.
Following that is a whole bunch more, mostly 0 bytes until finally, 582 bytes into the file, I see a 4 byte number (in big endian format) 0x00000013 (19 in decimal), an ASCII string reading "7/8/2008:3:29:44 PM", a 4 byte number (in big endian format) 0x00000064 (which coincidentally is equal to 100 in decimal), followed by 100 4 byte quantities that look suspiciously like they are single precision floating point values between 0 and 1. (They are probably in big endian order -- I haven't (yet) gone so far as to extract the binary values out of the file and attempt to convert them to floating point using big or little endian order.) BTW, the ASCII string "7/8/2008:3:29:44 PM" just happens to be 19 bytes long.
This pattern: 0x00000013, a 19 character timestamp string, 0x00000064, 100 single precision floating point values, repeats 9 more times in the file.
What I have done is to reverse-engineer enough of the file to be able to guess at its format. I knew going into the exercise that I was writing timestamp strings followed by 100 sample single precision arrays.
What I am missing is the specification from NI that says:
"This is the documented format of a datalog file. Every datalog file shall start with the 4 byte header 'D','T', 'L', 'G' followed by a 4 byte 'machine type' field indicating the type of processor used to create the data, followed by a 2 byte 'format' field indicating the format of the data, etc..." (I'm making that bit up).
Right now, I have no expectation that data I write using another LabView application will start precisely 582 bytes into the file.
Nor do I have any expectation that the data will always consist of a 4 byte length word followed by the data itself.
Nor do I have any expectation that the data will always be in big endian format.
I have a whole lot of intuition, which I can put to good use, and very likely, extract the data I want out of the raw data file, but a written specification beats the best intuition any day.
If anybody can point me at that specification, I would be very grateful. I have found a few similar "what is the format of the datalog file" posts, and, thus far no "the format is given in this piece of documentation" posts. I am hoping that I have just missed that answer. I am expecting that the answer is "NI does not divulge the raw format of such files". If my expectation is correct, I am (more) confused and at a loss to understand what NI gains by not publishing that format.
Does my original question make more sense now? Or have I totally lost everybody who had even the slightest interest in this long boring thread?
--wpd