3.2 - Stream Mode [UE9 Datasheet]
The highest data rates are obtained in stream mode. 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 given the specified resolution and extra settling time if any.
As samples are collected, they are placed in a 4 Mbit FIFO buffer on the UE9, until retrieved by the host. This 4 Mbit buffer can hold over 180,000 samples. Each data packet has various measures to ensure the integrity and completeness of the data received by the host.
The table below shows the maximum streaming data rates for the UE9 versus analog input resolution (assumes no extra settling time). These rates have been tested using Ethernet and various USB configurations, but some systems might require a USB high-high configuration or Ethernet to obtain these speeds. A “USB high-high” configuration means the UE9 is connected to a high-speed USB2 hub which is then connected to a high-speed USB2 host. Even though the UE9 is not a high-speed USB device, such a configuration does often provide improved performance. For all USB configurations, the worst case continuous stream rate seen in testing is 30 ksamples/s.
Stream data rates over USB and Ethernet can also be limited by other factors such as speed of the PC and quality of the network. General techniques for robust continuous streaming include increasing the priority of the stream process, and designing an application to automatically restart the stream if needed.
Table 3.2-1. Recommended Maximum Stream Data Rates
|
| Max Stream |
Index | Resolution | Samples/s |
0-12 | 12 | 50000 |
13 | 13 | 16000 |
14 | 14 | 4000 |
15 | 15 | 1000 |
16 | 16 | 250 |
Sample => A reading from one channel.
Scan => One reading from all channels in the scan list.
SampleRate = NumChannels * ScanRate
For example, if streaming 5 channels, the max scan rate per the table above is 10 kscans/second (calculated from 50 ksamples/second divided by 5).
The time between each sample within each scan, without any extra settling time, is a little less than one over the max stream rate specified in the above table.
The values in Table 3.2-1 are generally worst-case conservative values. This is particularly true for the 12-bit value. The following table shows the actual measured limits for 12-bit streaming (Comm firmware V1.40, Control firmware V1.84), reflecting the fact that stream mode is more efficient with more channels. Note again that Table 3.2-2 shows sample rates not scan rates. Divide by the number of channels to determine the scan rate.
Table 3.2-2. Actual Maximum Stream Data Rates (Resolution=12)
| Max Stream | Max Stream |
| Samples/s | Samples/s |
# Channels | USB high-high | Ethernet |
1 | 57000 | 57000 |
2 | 66000 | 66000 |
4 | 68000 | 74000 |
8 | 68000 | 78000 |
16 | 68000 | 80000 |
When the limits in Table 3.2-2 are exceeded, an error will occur. Probably scan overlap or buffer overflow. The UE9 will not return bad data, so these max data rates can be attempted, and either valid data will be collected or an error will occur.
For information about streaming under Windows using the LabJackUD driver, see Section 4.3.7.
In general, a low-level (not using the LabJackUD driver) Ethernet stream is done as follows:
Open TCP connection on port number PORTA.
Call FlushBuffer.
Open TCP connection on port number PORTB.
Call StreamConfig on PORTA to set the scan rate and load the scan table (list of channels to be sampled each scan).
Call StreamStart on PORTA to start the stream.
The UE9 will begin sending StreamData packets to the host using PORTB.
Call StreamStop on PORTA to stop the stream.