Overview

The term "debinning" refers to storing multiple copies of a data element in a file.  The purpose of debinning is to increase the speed of parallel read access to the file.

Note: Debinning by itself does not introduce new detector values, it only resamples existing values.

"Major" frames record encoder values that were acquired synchronous to a "major" trigger. They occur at a relatively low rate, limited by the maximum readout rate of the encoder.

"Minor" frames record copies of the most  recent major frame values. They occur at a relatively high rate, not limited by the maximum readout rate of the encoder.

Encoder Header Update

A new "innerCount" field is added to the encoder frame to enumerate the minor (high rate) frames between the major (low rate) frames.  Note that the size of the encoder header remains unchanged, as the two bytes after "frameCount" were reserved for future use.


Old encoder header format
typedef struct {
    uint16_t    frameCount;         // network byte order
    uint8_t     reserved1[2];
    uint16_t    majorVersion;       // network byte order
    uint8_t     minorVersion;
    uint8_t     microVersion;
    char        hardwareID[16];
    uint8_t     reserved2;
    uint8_t     channelMask;
    uint8_t     errorMask;
    uint8_t     mode;
    uint8_t     reserved3[4];
} encoder_header_t;
New encoder header format
typedef struct {
    uint16_t    frameCount;         // network byte order
    uint16_t    innerCount;         // network byte order
    uint16_t    majorVersion;       // network byte order
    uint8_t     minorVersion;
    uint8_t     microVersion;
    char        hardwareID[16];
    uint8_t     reserved2;
    uint8_t     channelMask;
    uint8_t     errorMask;
    uint8_t     mode;
    uint8_t     reserved3[4];
} encoder_header_t;


Limitations

The "innerCount" field is 16 bits,  so the maximum ratio of minor frames to major frames is 64K.

The "major" and "minor" triggers must overlap. If necessary, a timing sequence can be used to generate the major trigger.

  • No labels