The data is stored in big-endian format, so all data will need to be swapped when used on Intel architecture (Linux or MS Windows).
/* Possible values for the 'id' field. */ #define PMS2D_C1 0x4331 // First 2DC #define PMS2D_C2 0x4332 // Second 2DC #define PMS2D_G1 0x4731 // First 2D Greyscale #define PMS2D_G2 0x4732 // Second 2D Greyscale #define PMS2D_H1 0x4831 // First HVPS #define PMS2D_H2 0x4832 // Second HVPS #define PMS2D_P1 0x5031 // First 2DP #define PMS2D_P2 0x5032 // Second 2DP struct P2d_rec { short id; /* 'P1','C1','P2','C2', H1, H2 */ short hour; short minute; short second; short spare1; short spare2; short spare3; short tas; /* true air speed */ short msec; /* msec of this record */ short overld; /* overload time, msec */ unsigned char data[4096]; /* image buffer */ }; typedef struct P2d_rec P2d_rec;
Typical values when in heavy cloud should be on the order of 37 milliseconds for 1 probe attached to the VME interface card and 50-60 milliseconds if 2 probes are attached. The probe can typically fill the buffer in as fast as 3 milliseconds.
Bit 0 0111111111111111111111101 1 1111111111111111111111111 2 0111111111111111111111101 3 1111111111111111111111111 4 0111111111111111111111101 5 1111111111111111111111111 6 0111111111111111111111101 7 1111111111111111111111111 8 0011111111101111111111100 9 0011111111000111111111100 10 0011111110000011111111100 11 0011111100000001111111100 12 0011111000000000111111100 13 0011110000000000011111100 14 1011100000000000001111100 15 1011000000000000000111110 16 0010000000000000000011100 17 0000000000000000000001100 18 1000000000000000000000110 19 0010000000000000000000110 20 0011000000000000000001100 21 0011100000000000000011110 22 1011110000000000000111100 23 1011111000000000001111110 24 0011111100000000011111100 25 0011111110000000111111100 26 0011111111000001111111110 27 1011111111100011111111110 28 0011111111110111111111100 29 1011111111111111111111110 30 0011111111111111111111100 31 1011111111111111111111100 ^ ^^^ | ||| Sync word | Sync word. || || Timing word. | | All '1's, end of particle.A code snippet I use for locating the beggining of a particle:
if (slice == 0x55000000 && ppSlice == 0xffffffff && pSlice != 0xffffffff) StartOfParticle();where slice is the current slice, pSlice is the previous slice, and ppSlice is 2 slices previous.