Data File Format Previous topicFirst topicLast topic

Data File Format

This appendix describes the file format of the data files generated by the functions performing continuous data acquisition followed by storing the data to disk.
The data file includes three parts, Header, ChannelRange (optional) and Data block. The file structure is as the figure below:

                                

Header
The header part records the information related to the stored data and its total length is 60 bytes. The data structure of the file header is as follows:

Header
Total Length: 60 bytes

* If the num_of_channel_range is 0, the ChannelRange block won't be included in the data file.
* The channel_order is set to "custom" only when the card supports variant channel scanning order.

ChannelRange
The ChannelRange part records the channel number and data range information related to the stored data. This part consists of several channel & range units. The length of each unit is 2 bytes. The total length depends on the value of num_of_channel_range (one element of the file header) and is calculated as the following formula:

Total Length = 2 * num_of_channel_range bytes

The data structure of each ChannelRange unit is as follows:

ChannelRange Unit
Length: 2 bytes

Data Block

The last part is the data block. The data is written to file in 16-bit binary format, with the lower byte first (little endian). For example, the value 0x1234 is written to disk with 34 first followed by 12. The total length of the data block depends on the data width and the total data count.

The file is written in Binary format and can't be read in normal text editor. You can use any binary file editor to view it or the functions used for reading files, e.g. fread, to get the file information and data value. PCIS-DASK provides a useful utility DAQCvt for you to convert the binary file. The DAQCvt main window is as the figure below:

DAQCvt first translates the information stored in the header part and the ChannelRange part and then displays the corresponding information in the "Input File" frame of DAQCvt main window. After setting the properties (File Path, Format, …etc) of the converted file and push "Start Convert" button in the "Output File" frame, DAQCvt gets rid of header and ChannelRange parts and converts the data in data block according to the card type and the data width. Finally, DAQCvt writes the converted data to disk. You thus can use any text editor or Excel to view or analyze the accessed data.