3.2 - Stream Mode [U6 Datasheet] | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


3.2 - Stream Mode [U6 Datasheet]

Stream Mode Overview

The fastest data rates on the U6 occur when operating in stream mode.  Much of the command response overhead is eliminated in stream mode because the U6 is responsible for initiating IO operations.  Collected data is stored in the U6's stream buffer it is retrieved by the host application.  The end result is a continuous data stream, sampled at regular intervals, collected with a minimum number of command response data sets [1.]

As samples are collected, they are placed in a small FIFO buffer on the U6, until retrieved by the host.  The buffer typically holds 984 samples, but the size ranges from 512 to 984 depending on the number of samples per packet.  Each data packet has various measures to ensure the integrity and completeness of the data received by the host.

The U6 uses a feature called auto-recovery.  If the buffer overflows, the U6 will continue streaming but discard data until the buffer is emptied, and then data will be stored in the buffer again.  The U6 keeps track of how many packets are discarded and reports that value.  Based on the number of packets discarded, the UD driver adds the proper number of dummy samples (-9999.0) such that the correct timing is maintained.

Table 3.2.1 and 3.2.2 provide typical stream-related performance results [2.]. The tabulated data is useful for determining what types of signals can be analyzed using a U6.  The U6 is capable of streaming analog data [3.] at regular discrete intervals.  As a result, various discrete time signal analysis tools can be utilized to interpret data.

Table 3.2.1. Stream scan rates for stream mode over various gain, resolution index, channel count combinations.


A distinction between the terms scan and sample must be drawn to better interpret the data from Table 3.2.1.  A sample and a scan represent two separate parameters which make up a U6 data stream.  The definitions for each parameter are as follows:

Sample - A reading from one channel/address.
Scan -  One reading from a list of channels/addresses (scan list).

The scan rate, by definition, is a fraction of the sample rate where the fraction is the inverse of the number of channels being read in a single scan.  The scan rate is defined as:

ScanRate = SampleRate / NumChannels

The U6 has a maximum sample rate of 50 ksamples/second.  The stated maximum sample rate is achievable when a stream is configured with Range = +/-10V and ResolutionIndex = 0 or 1 [4.].  This is reflected in the first row of data in table 3.2.1 (highlighted).  The reported scan rate is simply the maximum sample rate divided by the number of channels in the scan list (within ~10%).  Note that the sample rate and scan rate for a single-channel stream are equal since the NumAddresses = 1.

The maximum scan rate will decrease at higher resolution index and range settings simply because analog conversions take longer to complete.  Table 3.2.2 illustrates how analog conversion times increase at higher resolution index and range settings.


Table 3.2.2. Stream performance characteristics for single-channel stream over various gain and resolution index combinations.

1.  The number of command response data sets used to retrieve stream data from the U6 depends on the number of data points allowed to accumulate in the in the U6's stream buffer

2.  Some systems might require a "USB high-high" configuration to obtain the maximum speeds listed.  A “USB high-high” configuration means the U6 is connected to a high-speed USB2 hub which is then connected to a high-speed USB2 host.  Even though the U6 is not a high-speed USB device, such a configuration does often provide improved performance.  

3. Channel 14 is not stream-able. The readings from the internal temperature sensor(channel 14) need extended settling time and this takes too long for stream-mode.

4.  Stream mode only supports resolution index values 0-8 (24-bit ADC not supported).  Therefore, setting the resolution index to 0 is equivalent to resolution index = 1.



Any reason that "Stream mode is not supported on the hi-res converter (resolutions 9-12 not supported in stream)"?

I think it will be better to support streram mode on the hi-res converter.

A few reasons:

1.  The fastest data rates you can do with the 24-bit sigma-delta converter are achievable in command-response mode.

2.  Each sample in stream mode is returned as 16 bits on the U6.  It would be a major change to allow for 24 or 32 bits.

3.  The way communication with the sigma-delta chip works, is not at all compatible with the interrupt structure of stream.  This is really the biggest hurdle.

Can you please explain more about Peak to Peak Noise (16 bit counts)?

Suppose I take example of Gain/Range : 100/0.1V, 8 bit resolution index, peak to peak noise column says +/-1.0.

Does this mean that out of 16 bit data I am getting, noisy bit shall be 1?


Peak-to-peak noise is determined by collecting perhaps 1000 points with a channel jumpered to GND, and taking the max count minus the min count.  A typical 16-bit binary data set might return mostly 32768, one value of 32767, and one value of 32769, which would mean that max-min = 2, which we spec as +/-1.  This is excellent performance for a 16-bit ADC.  Our 16-bit ADC has much lower noise than any other I have seen.

boki's picture

How do maximum scanning rates change when using a Mux80 expansion? I would like to monitor about 60 channels at Resolution 1 for example.

I would also like to know could you set up a streaming mode for say 15 channels and have 35 channels in command/response mode at the same time? Or similarly have two different streaming modes at the same time where in the first mode you will have 15 channels in Resolution 1 and in the other mode you will have 35 channels in Resolution 2? What would be the scan rates for these cases?  

Thank you!

labjack support's picture

The important relationship is:

ScanRate = SampleRate*NumChannels

Besides the fact that NumChannels can be much higher, the Mux80 has not special impact on this formula.  Mux80 channels act just like
normal channels.

If using ResIndex=1 and Range=+/-1V, the max sample rate is about 4.4k, so the max scan rate with 44 channels would be about 100 scans/second.

One U6 can only have one active stream at one scan rate.  In stream mode, all channels use the same ResolutionIndex.  Different channels can use different ranges, and the timing per Section 3.2 is based on the smallest range used by any channel.

Stream mode takes over the analog input system, so while a stream is active analog inputs are not available via command-response mode.

jmanjarresc3's picture

When we use stream mode to make a simple measurement and a differential one together . How many channels are counted 2 or 3

labjack support's picture

A differential measurement counts as 1 channel.  The hardware does a single ADC conversion and transfers a single value.