5.2.12 StreamData
After starting the stream, the data will be sent as available in the following format. Reads olde
data from buffer. Requires U3 hardware version 1.21.
st
• SamplesPerPacket: From StreamConfig function.
• TimeStamp: Not currently implemented during normal operation, but after auto-recovery
this reports the number of packets missed (1-65535).
• PacketCounter: An 8-bit (0-255) counter that is incremented by one for each packet of
data. Useful to make sure packets are in order and no packets are missing.
• Sample#: Stream data is placed in a FIFO (first in first out) buffer, so Sample0 is the
oldest data read from the buffer. The analog input reading is returned justified as a 16-
bit value. Differential readings are signed, while single-ended readings are unsigned.
• Backlog: When streaming, the processor acquires data at precise intervals, and
transfers it to a FIFO buffer until it can be sent to the host. This value represents how
much data is left in the buffer after this read. The value ranges from 0-255, where 256
would equal 100% full.
tream mode on the U3 uses a feature called auto-recovery. If the stream buffer fills up, the U3
will go into auto-recovery mode. In this mode, the U3 no longer stores new scans in the buffer,
but rather new scans are discarded. Data already in the buffer will be sent until the buffer is
empty, and every StreamData packet will have errorcode 59. Once the stream buffer has been
emptied, the U3 will start to buffer new scans again. At this point, the next packet returned will
have errorcode 60. This packet will have 1 dummy scan where each sample is 0xFFFF, and
this scan separates new data from any pre auto-recovery data. Also, the TimeStamp
parameter in this packet contains the number of scans that were discarded, allowing correct
time to be calculated. The dummy scan is included in the TimeStamp value.
Response:
Byte
0 Checksum8
10xF9
2 4 + SamplesPerPacket
30xC0
4 Checksum16 (LSB)
5 Checksum16 (MSB)
6-9 TimeStamp
10 PacketCounter
11 Errorcode
12-13 Sample0
62 (max) Backlog
63 (max) 0x00
S
102