Six Things You Need to Know about USB Instrument Control
With plug-and-play connectivity and the near ubiquity of USB ports on modern PCs and laptops, USB has become a popular choice for controlling stand-alone instrumentation. As more instrument manufacturers begin to include USB ports on their devices, it is important to understand several issues surrounding USB to ensure the longevity of your test system.
1. USB 2.0 Does Not Necessarily Mean High-Speed
Many of today’s test applications require the transfer of large amounts of data from instrument to PC. When choosing instrumentation, you need to know which transfer rates your PC supports. The USB standard provides three data transfer rates:
- Low-Speed – Data transfer at 1.5 Mb/s. Devices such as mice and keyboards typically use this lowest transfer speed.
- Full-Speed – Data transfer at 12 Mb/s. Until the introduction of Hi-Speed USB in 2000, this was the fastest transfer speed for USB.
- High-Speed – Data transfer at 480 Mb/s. Introduced in the Hi-Speed USB standard, the high-speed transfer rate made USB a viable option for sending large amounts of data such as audio and video.
While the USB 2.0 specification introduced the high-speed transfer rate, it also maintained backward compatibility with the lower-speed rates. As such, devices are often called USB 2.0-compatible while only supporting the low- and full-speed transfer rates. When purchasing new instrumentation, look for the phrase “Hi-Speed USB” to ensure that the instrument can support the fastest transfer rates.
2. A USB Type B Device Port Is Required for Instrument Control
There are two different types of USB ports that can appear on instrumentation – Type A host ports and Type B device ports. Type A host ports, recognized by their flat, elongated appearance, are more common, but you cannot use them for instrument control. You only can use these connectors to control other USB devices – typically to save data to USB memory sticks or add mouse and keyboard support to an instrument. To control an instrument from a PC, you need Type B device ports, recognized by a more square shape. When examining instrument data sheets, look for references to USB device ports or USB instrument control to make sure you can remotely control your instrument.
Figure 1. The USB Type B device port offers PC instrument control.
3. The USB Test and Measurement Class Simplifies Application Development
Because USB instruments do not adhere to a set communication protocol, programming them can be a major challenge. To help remedy this, the USB Implementers Forum (USB-IF) defined a specific device class called the USB Test and Measurement Class (USBTMC). Designed to emulate the IEEE 488.1 standard, you can program instruments that support USBTMC like their GPIB counterparts. This device class greatly simplifies instrument control because you can use industry-standard application programming interfaces (APIs) such as NI-VISA to send and read instrument commands without having to implement the lower-level communication protocols.
For devices that do not support USBTMC, you need to use either a vendor-provided driver or program the device in USB RAW mode. NI-VISA provides support for communicating in USB RAW mode, but you need to contact the instrument vendor for the specifics of its communication protocol.
4. You Can Reduce (or Eliminate) Setup Time with Plug-and-Play Connectivity
One of the greatest advantages of USB compared to other buses is its support of plug-and-play connectivity. Using tools such as the NI Measurement & Automation Explorer (MAX), USBTMC instruments are automatically detected and configured for the system. Unlike Ethernet/LAN, there is no need to enter IP addresses or hassle with company firewalls to connect to your instrumentation.
USB plug-and-play connectivity also has led to the development of interactive tools that can instantly load when you connect a USB instrument. One example is the National Instruments SignalExpress Tektronix Edition . Immediately after you connect a compatible Tektronix instrument to the PC via USB, the PC detects the connected instrument and shows an autoplay dialog. With a single mouse click, NI SignalExpress Tektronix Edition connects to the instrument, begins displaying live data acquisition, and provides remote instrument control.
Figure 2. Windows XP automatically detects specific USBTMC Tektronix instrumentation, which NI SignalExpress Tektronix Edition can then control.
5. You Can Get USB Connectivity From Your Current Instrumentation
With GPIB converters, you can gain many advantages of USB instrument control such as plug-and-play connectivity, ease of use, and easy access to USB ports while still using your current GPIB instrumentation. You can accomplish this through devices such as the NI GPIB-USB-HS, a Hi-Speed USB device that can turn any USB port into a fully functional GPIB controller. Because you can use your current instrumentation, you can conserve your investment in hardware and software and save money in development costs without programming new instrumentation.
6. Industry-Standard Software Interfaces Help Ensure the Longevity of Your Test System
While USB is a popular communication bus today, the history of the computer industry has shown that today’s hot technology could be obsolete tomorrow. Because of this history, it is important to make decisions to ensure the longevity of your test system even if communication buses change. You can do this by using the Virtual Instrument Software Architecture (VISA) and National Instruments LabVIEW plug-and-play instrument drivers. With these technologies built on top of the communication bus, you can program your systems with a standard API regardless of the bus you are using – whether it is GPIB, USB, serial, or Ethernet/LAN. As long as the instrument’s programming interface does not change, switching between communication buses requires little or no code modification and helps ensure the longevity of your test system.
Matthew Friedman
Product Marketing Engineer
matthew.friedman@ni.com
Learn more about controlling your instruments over USB or any other bus.
This article first ran in the April 18, 2006 issue of NI News.
Reader Comments | Submit a comment »
Low/Full/Hi-Speed vs. USB 1.1/2
In your article I'm missing the connection
of Low/Full/Hi-Speed versus USB 1.1/2 etc.
How do these terms correlate, do they have
the same meaning?
Kind regards, Sven.
- Sven Girsperger, Geoflight. sven.girsperger@bluewin.ch - Apr 19, 2006
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
