User manual

Programmer’s Guide Page 43 of 66
3.11.7.2. Raw data
The complete data should only be read out using the gated data mode described below. An appropriate User Gate can
be defined to access all of the data.
3.11.7.3. Gated data
Data can be read for both user and threshold gate operation using readMode = 7 (ReadModeSSRW).
The waveform descriptor structure contains the value actualDataSize giving the total number of data bytes read. A
time stamp block, measuring the trigger time, will mark the beginning of each segment. Segment time stamps are
mixed in with the data and not available through the usual segDesc array. The entire time stamp is a 56-bit integer
counting in units of 100 ns.
Here is the Time Stamp format:
Marker block
31..24 (8 bits)
23..0 (24 bits)
Flag = 00000100 (0x04)
Time Stamp MSB
Time Stamp LSB
The time stamp may be followed by a variable number of blocks of data with the following format:
Gate block
31..24 (8 bits)
23..0 (24 bits)
Flag = 00000000
Gate position from the origin of the acquisition (not the segment!)
31..0
Gate length (number of Data bytes, always a multiple of 4)
31..24
23..16
15..8
7..0
Data3
Data2
Data1
Data0
Data4
When reading such data you should carefully check that you terminate correctly and do not read beyond the end of
the transmitted data nor generate unphysical time coordinates for the data.
3.11.7.4. Waveform storage requirements
When using the routine AcqrsD1_readData you must allocate waveform storage and inform the driver about the
number of bytes available.
Raw data readout requires exactly the number of bytes corresponding to the number of segments times the number of
data points per segment.
User gate readout for each segment requires 8 bytes for the time stamp and an overhead of 8 bytes for each gate. This
must be added to the total number of samples in all of the gates to get the required length for each segment and
multiplied by the number of segments to get the waveform array length.
For threshold gate readout the program should allocate the space needed for the worst case. This means 8 bytes for
the time stamp, 8 bytes for a gate block header and space for the total number of samples/segment. This must be
multiplied by the number of segments to get the waveform array length. It should be noted that the FPGA will
generate a single gate block if there are less than 32 data points "below" threshold between two desired data points.
3.11.8. Reading AP family Peak
TDC
Analyzer Data and Histograms
3.11.8.1. Reading the gated data
The gated data of the current event can be read out as described in 3.11.7.3 Gated data. This is the only output
format that gives access to the segment time stamps.
3.11.8.2. Reading the data in the peak regions
The data of the peak regions in the current event can be read out using readMode = 10 (ReadModePeakPic).
The waveform descriptor structure contains the value actualDataSize giving the total number of data bytes read.
There will be a variable number of blocks of data with the following format: