Get USB instrument data without programming
Andy Purcell- August 15, 2012Engineers often need to move measurement data into computers for storage and analysis. The data might be a captured oscilloscope trace, spectrum analyzer data, or an array of voltage readings from a DMM ready to be used in a PC spreadsheet application. But, instruments have traditionally needed to be polled through bus commends to transfer data. If an instrument could appear like a USB mass-storage device, then you could download entire data files and more easily process or store the data.
When a PC sees a USB mass storage device, a PC file explorer can transfer files from the instrument. This means getting data without installing any software. There are no programs to run, no instrument drivers to install, and no instrument specific SCPI (standards commends for programmable instruments) syntax to learn. To the PC, the instrument appears to act like a rather large USB flash drive. Connecting an instrument to a PC becomes like connecting a consumer electronic device such as a camera or electronic reader.
The technique involves having the instrument firmware take advantage of “composite USB.” Composite USB is not new – it is defined in the USB 2.0 specification as a device with multiple interfaces that can be controlled independently of each other. This is all done with just one physical connection. Figure 1 is a high level block diagram of a composite USB instrument.
Figure 1. A Composite USB instrument block diagram shows that both USB mass storage and instrument firmware communicate through the PC’s USB connection.
The low level USB physical layer protocol enables packets to be routed to specific USB interface endpoints. When a packet is received, the appropriate device firmware handles the packet.
When a composite USB instrument is connected to a PC, the PC operating system enumerates the device and loads a driver for each USB interface. Figure 2 shows a PC “Device Manager” window after connecting a composite USB instrument. The USB mass-storage interface appears under “Disk drives” as a “USB Device” and the USB488 interface shows up under “Test and Measurement Devices”.
Figure 2. A Composite USB instrument appears as two devices in PC Device Manager.
Because the USB mass storage interface in the instrument appears to the PC as just another disk drive, and is natively supported by the PC operating system, a PC file explorer (Windows Explorer) can be used to view the file system being shared by the instrument. Figure 3 shows a Windows Explorer window and the various kinds of files that might be shared by an instrument.
Figure 3. The PC file-explorer window shows instrument folders and file types.
As can be seen in Figure 3, the instrument can share folders and many file types.
Also notice the PC file explorer window left pane shows an instrument specific label and icon. This happens automatically when the PC detects the presence of a file named “autorun.inf” on the instrument file system. The label and icon can be helpful to identify the instrument if several instruments are connected.
Page 1 of 2Next >