Skip to main content
Skip table of contents

StreamData

U3 and U6

After starting the stream, the data will be sent as available in the following format. Reads oldest data from buffer.

U3: Requires U3 hardware version 1.21 or higher.

Response:

 

Byte

 

0

Checksum8

1

0xF9

2

4 + SamplesPerPacket

3

0xC0

4

Checksum16 (LSB)

5

Checksum16 (MSB)

6-9

TimeStamp

10

PacketCounter

11

Errorcode

12-13

Sample0

62 (max)

Backlog

63 (max)

0x00

  • SamplesPerPacket: From StreamConfig function.

  • TimeStamp: Not currently implemented during normal operation, but after auto-recovery bytes 6-7 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.

Stream mode uses a feature called auto-recovery. If the stream buffer gets too full, the device will go into auto-recovery mode. In this mode, the device 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 contains less samples than SamplesPerPacket, and every StreamData packet will have errorcode 59. Once the stream buffer contains less samples than SamplesPerPacket, the device will start to buffer new scans again. 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. Note that the dummy scan could be at the beginning, middle, or end of this packet, and can even extend to following packets. Also, the TimeStamp parameter in this packet contains the number of scans that were discarded, allowing correct time to be calculated. The dummy scan counts as one of the missing scans included in the TimeStamp value.

UE9

Not supported over UDP. After starting the stream, the data will be sent as available in the following format. Data is sent 16 samples at a time in a 46 byte packet. Reads oldest data from buffer.

Note that USB stream data is a special case where each 46-byte data packet is padded with 2 zeros on the end (not part of the protocol), and then 4 of these 48-byte blocks are grouped together and sent in 3 transfers over the 64-byte endpoint. See the USB Section for more information.

Response:

 

Byte

 

0

Checksum8

1

0xF9

2

0×14

3

0xC0

4

Checksum16 (LSB)

5

Checksum16 (MSB)

6-9

TimeStamp

10

PacketCounter

11

Errorcode

12-13

Sample0

14-15

Sample1

16-17

Sample2

18-19

Sample3

20-21

Sample4

22-23

Sample5

24-25

Sample6

26-27

Sample7

28-29

Sample8

30-31

Sample9

32-33

Sample10

34-35

Sample11

36-37

Sample12

38-39

Sample13

40-41

Sample14

42-43

Sample15

44

ControlBacklog

45

CommBacklog

  • TimeStamp: Reserved.

  • 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 and Sample15 is the 16th oldest sample. This stream data packet always returns 16 samples regardless of the number of channels in the scan list.

  • ControlBacklog: When streaming, the Control processor acquires data at precise intervals, and transfers it to the Comm processor which has a large data buffer. The Control processor has a small data buffer (256 samples) for data waiting to be transferred to the Comm processor, and this ControlBacklog parameter specifies the number of samples remaining in the Control buffer. If this parameter is nonzero and growing, it suggests that the Control processor is too busy.

  • CommBacklog: The Comm processor holds stream data in a 4 Mbit FIFO buffer (512 Kbytes, 11397 StreamData packets, 182361 samples) until it can be sent to the host. The lower 7 bits of CommBacklog specifies how much data is left in the buffer in increments of 4096 bytes. The MSb of CommBacklog is set on buffer overflow, but in such a case the lower 7 bits still specify the amount of valid data (before overflow) in the buffer.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.