
APDCAM User’s Guide
Page 31/32
3.6.1. Received data memory map
This section defines the memory map after data transfer has been completed to a
buffer. Each stream has its own buffer, therefore normally 4 buffers should be processed
after the measurement. Data from the DAQ Unit is packed into data packets which are
extended with a header by the Gbit Ethernet Controller. The length of the data packet is
specified in the call to
SendTS
(), most often it is set to 1440 bytes, what is the maximum
size. The header is a 32-byte long block, its 8-th byte (first byte is 1) it contains a 1-byte
continuity counter. This can be used to check for any packet loss. Removing these head-
ers one gets a continuos byte stream of data sent by the DAQ Unit in the format shown in
Figure 11.
The following description applies to this.
At the beginning of the data transfer the DAQ Unit sends a 14 byte preamble, if this
feature is enabled in the register table. Sending a preamble is useful as 1-2 bytes might be
left in the Ethernet Controller internal buffers from the last measurement. The preamble
has the following format:
Preamble format
Byte
0 1 2 3 4 5 6 7 8 9 10
11
12
13
Data
12
11
10 9 8 7 6 5 4 3 2 1
TM
AD
Table 11. The preamble format
The values are shown in decimal format. TM indicates the test mode register value of
the corresponding string, e.g 0 means measured data. AD indicates the stream source,
0x11 is stream 1, 0x22 stream 2, etc. After the preamble identical sample data blocks are
sent which contain one sample from each enabled ADC channels of the stream. The sam-
ple bits are packed in a continuous bit stream which is padded with zeros
at the beginning
to fill a full byte. The length of a sample block is shown in
Table 12.
These values can also be read from the BYE_PER_SAMPLE register for all
4 ADC blocks after setting the resolution and channel masks. The bit order of the indi-
vidual ADC samples can be adjusted in the CONTOL register bit 6 of the DAQ register
table. For 0, the LSB is sent first, for 1 the MSB.
Preamble
Sample block 1
Sample block 1
Figure 11. Memory map after removal of the packet headers.