USB high-high
USB other
# AIN
[miliseconds] [miliseconds]
0
0.6
4
<- Write/Read all DIO, DACs, Timers and Counters
1
1
4
4
2.4
4
8
4.7
9.2
16
8.3
12.2
Table 3.1-1. Typical Feedback Function Execution Times (QuickSample=0, LongSettling=0)
USB high-high
USB other
# AIN
[miliseconds] [miliseconds]
0
0.6
4
<- Write/Read all DIO, DACs, Timers and Counters
1
0.7
4
4
1
4
8
2.1
8
16
3
8
Table 3.1-2. Typical Feedback Function Execution Times (QuickSample=1, LongSettling=0)
USB high-high
USB other
# AIN
[miliseconds] [miliseconds]
0
0.6
4
<- Write/Read all DIO, DACs, Timers and Counters
1
4.2
5.2
4
16
17
8
31
36
16
60
62
Table 3.1-3. Typical Feedback Function Execution Times (QuickSample=0, LongSettling=1)
A “USB high-high” configuration means the U3 is connected to a high-speed USB2 hub which is then connected to a high-speed
USB2 host. Even though the U3 is not a high-speed USB device, such a configuration does provide improved performance.
Typical examples of “USB other” would be a U3 connected to an old full-speed hub (hard to find) or more likely a U3 connected
directly to the USB host (even if the host supports high-speed).
The analog inputs have a QuickSample option where each conversion is done faster at the expense of increased noise. This is
enabled by passing a nonzero value for put_config special channel
LJ_chAIN_RESOLUTION
. There is also a LongSettling option
where additional settling time is added between the internal multiplexer configuration and the analog to digital conversion. This
allows signals with more source impedance, and is enabled by passing a nonzero value for put_config special channel
LJ_chAIN_SETTLING_TIME
. Both of these options are disabled by default, so the first table above shows the default conditions.
The first row in each of the above tables (# AIN = 0) includes a write and read to all I/O on the U3 besides analog inputs (digital I/O,
DACs, timers, and counters). The times in other rows basically consist of that fixed overhead plus the time per analog input
channel, so times can be interpolated for other numbers of channels.
How about for 2 analog input channels with QuickSample=0 and LongSettling=0? You know that 1 channel takes about 1.0 ms and
4 channels takes about 2.4 ms. That means it takes about (2.4-1.0)/(4-1) = 0.46 ms/channel plus overhead of about 0.6 ms, so 2
channels would take about (2*0.46)+0.6 = 1.5 ms.
How about for 20 channels? This is a little different because the commands and/or responses for 20 channels can’t fit in one low-
level packet. From Section 5.2.5, the Feedback command has room for 57 bytes of command data and 55 bytes of response
data. From Section 5.2.5.1, the AIN low-level IOType has 3 command bytes and 2 response bytes. That means the low-level
Feedback command can hold 19 commands and 27 responses. Thus the commands are limiting and 19 channels is the most we
can get into 1 low-level Feedback packet. The timing for 20-channels can then be calculated as a 19-channel read plus a
subsequent 1-channel read. If you do an Add/Go/Get block with 20 channels the UD driver will split it like that.
The tables above were measured with U3 hardware version 1.21 which started shipping in late August of 2006. The times could
be up to twice as long with hardware version 1.20 or less.
3.2 - Stream Mode
The highest input data rates are obtained in stream mode, which is supported with U3 hardware version 1.21 or higher. Hardware
version 1.21 started shipping in late August of 2006. Contact LabJack for information about upgrading older U3s. Stream is a
continuous hardware timed input mode where a list of channels is scanned at a specified scan rate. The scan rate specifies the
interval between the beginning of each scan. The samples within each scan are acquired as fast as possible.
As samples are collected, they are placed in a small FIFO buffer on the U3, 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.
Since the data buffer on the U3 is very small it uses a feature called auto-recovery. If the buffer overflows, the U3 will continue
streaming but discard data until the buffer is emptied, and then data will be stored in the buffer again. The U3 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.
The table below shows various stream performance parameters. Some systems might require a USB high-high configuration to
obtain the maximum speed in the last row of the table. A “USB high-high” configuration means the U3 is connected to a high-
speed USB2 hub which is then connected to a high-speed USB2 host. Even though the U3 is not a high-speed USB device, such
a configuration does often provide improved performance.
Stream data rates over USB can also be limited by other factors such as speed of the PC and program design. One general
technique for robust continuous streaming would be increasing the priority of the stream process.
A sample is defined as a single conversion of a single channel, while a scan is defined as a single conversion of all channels
being acquired. That means the maximum scan rate for a stream of five channels is 50k/5 = 10 kscans/second.
Low-Level
UD
Max Stream
ENOB
ENOB
Noise
Interchannel
Res Index
Res Index
(Samples/s)
(RMB)
(Noise-Free)
(Counts)
Delay (µs)
0
100
2500
12.8
10
±2
320
1
101
10000
11.9
9
±4
82
2
102
20000
11.3
8.4
±6
42
3
103
50000
10.5
7.5
±11
12.5
Table 3.2-1. Streaming at Various Resolutions
Full resolution streaming is limited to 2500 samples/s, but higher speeds are possible at the expense of reduced effective
resolution (increased noise). The first column above is the index passed in the Resolution parameter to the low-level StreamConfig
function, while the second column is the corresponding index for the Resolution parameter in the UD driver. In the UD driver, the
default Resolution index is 0, which corresponds to automatic selection. In this case, the driver will use the highest resolution for
the specified sample rate.
23