Simple connections employing USB can replace more expensive GPIB setups in test instrumentation.
Aaron Fernando, B&K Precision Corp.
Engineers from a variety of industries use USB and USBTMC (USB Test & Measurement Class) to remotely control test and measurement instruments from a host computer. It is useful to compare USBTMC to the widely used GPIB interface. The process of setting up an instrument for remote communication using USBTMC is relatively simple.
Typically, end-users are looking for a simple way to connect test instruments to a computer for automated control and measurement recording. For many years, these connections typically followed the IEEE 488 format. This is a short-range digital communications eight-bit parallel multi-master interface bus specification first created as HP-IB and now commonly called GPIB. In recent years, it has also become attractive to make simple test-instrument connections via USB. Although USB provides the hardware, it is the TMC (Test and Measurement Class) driver that standardizes the process of initializing and programming test instruments remotely.
The USBTMC driver provides simple plug-and-play operation and GPIB-like communication at a relatively low cost. Remote communication is made possible by a standard USB cable where data transfers in a binary and/or ASCII format. The TMC driver on the PC and the instrument TMC firmware provide two-way communication for reading and writing instrument commands.
Unlike USB raw connections, the TMC driver does not require any complicated setup or configuration procedures. The only requirement for plug-and-play operation with a USBTMC-supported device is installation of a VISA (Virtual Instrument Software Architecture) I/O library which contains all the necessary drivers for remote communication. Input and output functions are handled with the VISA write command strings such as “*IDN?” and the VISA read response string from the instrument.
The application determines whether or not a USBTMC scheme makes sense. For simple benchtop or laboratory applications, USBTMC is often the preferred interface for remote communication. In addition to USB and LAN interfaces, GPIB also remains widely used, especially in larger ATE systems.
Although GPIB has been the staple interface for over 40 years, its cost has remained rather high. Compared to GPIB, the ubiquitous use of USB by system and computer manufacturers make it commonly available and easily accessible. Most modern PCs have at a minimum of four to six standard USB interfaces. In contrast, GPIB takes place via controller cards added to a PC and can cost an additional $200 or more. Alternatively, USB-to-GPIB controller adapters range from $500 to $1,000. The GPIB cables alone (depending on length), cost anywhere from $80 to over $300.
All in all, GPIB can be an expensive proposition for simple benchtop applications. Most instrument manufacturers, including B&K Precision, now provide USB connections and support for their equipment, making USBTMC a more attractive option.
Nevertheless, both interfaces have their own advantages and disadvantages. Specifically, consider the approximate cost for a five-meter cable – a mere $6 for USB compared to $170 for GPIB. USBTMC is built upon the USB 2.0 standard which supports a theoretical bandwidth of up to 480 Mbps (60 MB/sec). However, with isolation it is de-rated to 12 MB/sec. This speed is still much higher than GPIB at 1 MB/sec.
USBTMC-compliant instruments are also backward-compatible with GPIB protocols that comply with IEEE 488.1 and IEEE 488.2 standards. These standards are important because they define a set of instrument-specific commands known as Standard Commands for Programmable Instrumentation (SCPI). In a nutshell, USBTMC requires little effort to setup thanks to its true plug-and-play operation, especially useful in cases where instruments are often interchanged.
Rated for a longer cable length, GPIB does still have some advantages over USB. The higher noise immunity and ruggedness of GPIB connectors appeals to many engineers working around large ATE systems and numerous arrays of test racks. And sometimes engineers are more comfortable with GPIB and cannot justify spending the time or money to replace existing GPIB systems.
Many manufacturers, including B&K Precision, label some USB-compliant instruments ‘USBTMC’ directly. Other instruments labeled ‘USB’ or ‘Device’ might still be USBTMC compliant, so it’s best to check the instrument specifications or documentation to verify compatibility.
The initial setup of a USBTMC instrument only requires VISA software installation. NI-VISA is widely used software provided by National Instruments Corp. that implements this architecture. This package also includes the Measurement & Automation Explorer (NI-MAX) which allows for auto-detection and remote communication with test instruments from a PC.
Once NI-VISA is installed on the computer, the connection and powering-up of any USBTMC device would trigger the automatic installation of the correct instrument drivers. Check the device manager on a Windows system to verify a resource called “USB Test and Measurement Device” is available. A common problem faced by Windows users is the automatic download of incorrect drivers as a result of not first downloading and installing VISA software before connecting the instrument to the computer; be sure that the instrument communication setting is set to USBTMC.
Moving forward, test and measurement manufacturers will continue to incorporate USB and USBTMC as a standard interface. GPIB connectivity is now commonly offered as a more expensive option and is reserved for larger test systems. For simple benchtop applications, the combination of plug-and-play connectivity, low cost, and GPIB emulation combine to make USBTMC a more widely used option for test and measurement equipment.
In that regard, B&K Precision moderates a github repository resource where users can find code samples in a variety of languages, LabVIEW drivers, and USBTMC utilities for Linux environments. Users can also find a full step-by-step tutorial video on installing the required software and setting up an instrument for remote communication using USBTMC on the B&K Precision YouTube page.
Tabb Mayo says
Alas, my experience is somewhat different. I agree that VISA appears to be the interface to use but I could not gain access to it. I downloaded the NI-VISA distribution and it successfully installed or so it said. I even found the “references” in the VBA list. However, when I tried to call any NI-VISA type or method, VBA reported that these were not defined. I interpret this to mean, not included in the C language sense. I tried everything I knew to do, even tampering with the registry through regsvr32 but to no avail.