LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading DTLG files from matlab

I wrote a LV program to log a bunch of data.
The data are stored in DTLG files (2D array of dbl). To generate these files, I used the Write File function, and wired a 2D dbl array to the data type as well as to the data input. I wrote one 2D array per file. Now somebody wants to read this data from Matlab, but doesn't want to write a conversion utility. They want to know the binary structure of my DTLG files. I haven't a clue. I can read them in a byte stream read and do back flips and inward 1 1/2 tucks but I always come up with garbage. Can someone tell me what the format of my file should be?

I see the DTLG header tag and the names of the variables comprising my 2D array, but I can't seem to find the correct byte order, n
or the correct starting point for the array data.
jc
Mac 10.4
LV7.1
CLD
0 Kudos
Message 1 of 6
(5,212 Views)
Turns out it can't be done. The answer I received from NI was that NI DTLG files are proprietary and the details, although well-defined, are not for public release. Ouch! Do they know that Mathworks publishes mat file format info?

In the future, I cannot utilize the convenience of the DTLG format because I can't always know when an outside party will need to access the data and demand a format description, and I don't want the burden of constantly writing two sets of files, or of always writing a conversion utility for the data.

Drat!
jc
Mac 10.4
LV7.1
CLD
0 Kudos
Message 2 of 6
(5,212 Views)
jcrooke had commented himself:
Turns out it can't be done. The answer I received from NI was that NI DTLG files are proprietary and the details, although well-defined, are not for public release. ...

Actually, it can be done. I guess NI does not want user to use the format of DTLG files since that may change in future LV versions (as it has done in the past, AFAIK). All your programs relying on the DTLG structure would become useless then.

How the DTLG structure can be guessed is demonstrated in the attached VI (LV 7.0). BUT BE AWARE OF MY WARNING ABOVE!
Message 3 of 6
(5,212 Views)
Thanks. The discussion forum is great when you've got the time to wait for answers. Why couldn't the engineer provide this answer? I caught a lot of heat for this problem and the fact that I had to build a conversion utility, rather than provide file format info. The manager of this project was miffed that I wasted 6 hours trying to decode the DTLG file and ended up batch processing the existing files, instead of giving the matlab guy the format info to do the conversion himself.

To be on the safe side, I will probably avoid storing data on disk as DTLG files.
jc
Mac 10.4
LV7.1
CLD
0 Kudos
Message 4 of 6
(5,212 Views)
You're welcome. I attach to this comment two VIs to demonstrate how you can store the 2D array of DBL in binary form w/o using the DTLG format. One of the VIs includes dimension information, the other does not.

I personally prefer all data storage in the form of ASCII files. They are accessible by all programs and file size is not an issue these days, anyway. For very large files there probably is a speed advantage for binaries. Although binary files are a direct image of the number representation used internally by the processor, one can have two different representations which differ in the order of how the bytes are stored: from MSB to LSB or vice versa. They are called little endian and big endian formats, resp., but I don't re
call which is which. One of them is used in the Intel world, the other in the Motorola hemisphere. That's another reason to prefer ASCII data.

You might also want to inspect the VIs you'll find in the Function pallette-->File I/O-->Binary file VIs section, BTW.


-Franz
Download All
0 Kudos
Message 5 of 6
(5,212 Views)
Thanks for going the extra mile. I'm sure your contributions to this forum will help others, too.

-jayme
jc
Mac 10.4
LV7.1
CLD
0 Kudos
Message 6 of 6
(5,212 Views)