Sustaining Usb Streams PDF
Sustaining Usb Streams PDF
The new technology helps engineers achieve high-performance applications on USB, which previously was possible only on an internal bus such as PCI. This white paper describes the challenges associated with high-speed data acquisition on USB and reasons why NI signal streaming technology is essential to any USB data acquisition (DAQ) device. Since the introduction of the PCI bus in 1993, the adoption and use of PC-based data acquisition technologies have grown to an all-time high, with more than 6 million new measurement channels sold in 2006 from National Instruments alone. With more than 2 billion ports around the world (usb.org), the Universal Serial Bus (USB) has radically changed the data acquisition landscape, as more and more engineers now prefer to build a data acquisition system based on the external, portable, and easy-to-use USB bus. As experienced by early adopters of USB-based test, measurement, and control products, a significant performance gap exists between the USB devices and their PCI counterparts. This performance gap between PCI and USB DAQ products is not caused by the inability to place high-performance components on USB DAQ devices but by the sheer nature of the Universal Serial Bus. USB exhibits lower bandwidth, slower latency and host-initiated data transfers. Because of these challenges, early USB-based applications were limited to data storage, basic data acquisition, and a replacement for GPIB and serial in instrument control. To optimize the use of the Universal Serial Bus and deliver high-performance data acquisition, National Instruments created NI signal streaming technology. NI signal streaming combines three innovative hardware- and software-level design elements to enable sustained high-speed and bidirectional data streams over USB. The new technology helps engineers achieve high-performance applications on USB, which previously was possible only on an internal bus such as PCI.
more important than data accuracy, such as streaming audio and video. Bulk data transfer delivers large data transfers with no loss of data; often used for applications where lots of data must be transferred with no loss of data such as external hard drives. With built-in error checking and large data transfer capabilities, bulk data transfer is the logical choice for USB data acquisition. But in practice, bulk transfers can achieve fast performance when only a single stream of data is sent through the USB port. Any additional streams can considerably reduce transfer rates, especially if the transfers are bidirectional.
Traditional approach
Three technical issues contribute to the inability of USB to meet throughput and latency expectations for high-performance data acquisition. The first issue is the inefficient use of a processor for data management. The current standard for data management between the data acquisition front end and USB endpoints is a slow, commercial off-the-shelf (COTS) processor. Its purpose is to divert the appropriate information to each individual USB endpoint. Compared to a custom design, it is an inexpensive solution with a fairly easy implementation. Figure 1. Traditional USB DAQ architectures use a low-performance processor to connect the DAQ front end to the USB endpoints. These processors are instruction-based, single-threaded pieces of silicon that create a switch-like behavior. Only able to run a single instruction at any given time, they are the bottleneck of all typical USB DAQ devices. Any higher-priority tasks, such as handling control requests from the host, may delay the processor in handling data transfers, causing low throughputs and possible buffer underflow/overflow errors. Due to its architecture, a processor cannot simultaneously manage several data streams and handle incoming control requests, making high-performance data acquisition impossible. In other words, USB cannot achieve the PCI DMA-like performance of streaming multiple I/O types simultaneously. Another issue is latency. Latency is defined as the time delay between initiating a request for data and the beginning of actual data transfer. USB has higher latency than PCI because of its OS-based access and serial nature. A typical single-point voltage acquisition could require dozens of register-level instructions, which, when multiplied by 1 ms of latency, is unacceptable. Finally, there is a trade-off between data throughput and latency. To have a fast data throughput rate, engineers need to move larger data sets at every transfer. Doing so reduces the responsiveness of the system and increases system latency, thus leaving the device unresponsive during each large transfer. What is truly needed is a data transfer method that uses both the streaming capabilities of isochronous data transfers and the 100 percent error-free transfer of bulk. To address these needs, National Instruments created an innovative patent-pending USB data streaming technology NI signal streaming.
Message-based instructions
As discussed earlier, USB has a higher latency than PCI. This delay is amplified when a single-point voltage measurement requires the transmission of several dozen register-level commands. NI signal streaming provides message-based communication to avoid lengthy transmissions the host needs to send only a single, high-level message such as acquire.commit through USB. The device processor then converts the message into the dozens of register-level commands that are necessary to properly set up the system timing controller. Figure 3. Using message-based instructions avoids dozens of register-level commands.
For devices with NI signal streaming, added intelligence on the device allows it to prematurely stop large data set transfers and send an early completion notification to the USB host without compromising data integrity. This effectively allows the device to respond faster to requests and send smaller sets of data when needed.
Summary
USB has evolved from a low-speed peripheral bus for accessories, such as mice and keyboards, to a high-speed bus capable of satisfying data-intensive applications. NI signal streaming combined with the error correction, noise rejection, power management, and power distribution inherent to the USB protocol, yields a robust, secure, and reliable USB bus for use in measurement and control products. With the introduction of NI signal streaming technology, USB devices now rival the performance users typically expect from plug-in buses. By addressing performance concerns with fast data transfers, reduced communication overhead, and increased device responsiveness, NI signal streaming is a necessary technology for any USB DAQ device. Whether streaming multiple measurement types in the megahertz range or logging sensor data at several hertz, NI signal streaming provides the performance required for USB DAQ applications.