MIDAS - The Multiple Instance Data Acquisition System

Tape Server - data block format

The tape server writes a 24 byte control block at the beginning of each data block.

This control block contains an identification of the type of data following and also fields which allow the hardware architecture of the data source to be determined. This is important since the data may not be written by a processor having the same architecture as the data source. As an extreme case consider a data tape being read by an x86_64 Linux system which has been written by a PowerPC Embedded core system containing data from a VME based source.

The structure defined below can be used to read the 24 byte header into. It is constructed from types defined in stdint.h to avoid issues with differing sizes of int/short/long on different systems.

For proper processing the data block size, definied in the TapeServer configuration file must be known as the data length given in the header only gives the length of useful data while the data block itself might be padded to the full block size. This was once a neccesity when data was written to actual tapes and the behaviour has been kept to avoid breaking existing sort codes.


#include <stdint.h> // 24 byte data block header typedef struct s_data_header {     char header_id[8]; // contains the string EBYEDATA     int32_t header_sequence; // within the file     int16_t header_stream; // data acquisition stream number (in the range 1=>4)     int16_t header_tape; // No longer used (= 0)     int16_t header_MyEndian; // written as a native 1 by the tape server     int16_t header_DataEndian; // written as a native 1 in the hardware structure of the data following     int32_t header_dataLen; // total length of useful data following the header in bytes } DataBlockHeader;

 

Back to documentation index documentation index


© 2021 NPG - STFC