Q10009 Format of DAPstudio log file data

I have an existing data set logged using Microstar's DAPstudio software. The data set consists of multiple blocks of data. What is its format? How do I get this data into Matlab for analysis?

The DAP logs data values are in a compact format with the Intel byte ordering (as this is running under a Windows system). Thus, if your file has 24000 bytes of LONG data type, you have 6000 values in your logged file.

As long as all of your data are of the same data type, you can easily read the data into Matlab as a matrix. The four basic data types that DAPL processes are all compatible with Matlab. These are:

- WORD - 16 bit signed fixed point integer

`'int16'`

in MATLAB - LONG - 32 bit signed fixed point integer

`'int32'`

in MATLAB - FLOAT - 32-bit IEEE floating point

`'float'`

in MATLAB - DOUBLE - 64-bit IEEE floating point

`'double'`

in MATLAB

When sampling, you get values for each channel. As time
advances, you will get more groups like this, so the data arrive in
a *multiplexed order by channel*. Matlab arranges its data so
that consecutive data are placed into a matrix one column at a time,
so use the row index to access each channel, and the column index
to move through the time sequence.

To access the data from Matlab, you can use the low-level file
functions ` fopen, fread, fwrite, `

and `fclose`

.
The following shows an example for a file with 6000 WORD ('int16')
values in each block, and the data are from 10 channels... thus a
10 row, 600 column matrix.

fh = fopen('c:\path\to\my\data.bin','r') mymatrix = fread(fh,[10,600],'int16') % First block ... mymatrix = fread(fh,[10,600],'int16') % Subsequent block ... fclose(fh)