Electronic Design
Get Instrument Screen Captures and Data Files Quickly Using USB

Get Instrument Screen Captures and Data Files Quickly Using USB

Implementing the USB Media Transport Protocol (MTP) helps facilitate file sharing.

Market research shows users frequently need to get files from an instrument to a PC. The file may be a screen capture file or a data file. There is a new technique, available now on some instruments, for making this task easy. A user simply connects the instrument to a PC with a USB cable and the user is prompted with a dialog to start exploring files with the familiar Windows Explorer file browser. A user navigates to the file of interest and then uses copy/paste or drag/drop to move the file. Connecting an instrument to a PC becomes like connecting a phone, camera, or mp3 player.

Download this article in .PDF format
This file type includes high resolution graphics and schematics when applicable.

User Experience: Connecting with USB

1. An AutoPlay dialog box such as this appears when connecting a PC to an instrument with USB.

Most everyone has connected a phone, camera, or mp3 player to a PC and seen an AutoPlay dialog box (Fig. 1). If a user wants to get a file, the natural thing to do is click on the AutoPlay “Open device to view files using Windows Explorer”. The user then sees information about the instrument storage (Fig. 2).

If the user clicks on “Data, Screen Captures and More,” the user begins to see shared folders and files on the instrument (Fig. 3). The suggested root folder names help a user navigate to a file of interest:

• “Data” contains data files, such as voltmeter readings or swept frequency response data or whatever is appropriate for the specific instrument.
• “PC Software to control contains informative files and hyperlinks that enable users to get PC software to control the instrument.
• “Screen Captures” contains screen capture files.
• “Settings” contains instrument state files.
• “User Files” is a read-write accessible folder where users can add/delete files.
• Readme.html, when opened, displays information about the instrument and the sharing of files in Internet Explorer.

2. Shown is an example of Windows Explorer and instrument shared internal storage and shared external storage.

Suppose the user wants to access a screen capture file. The user clicks on “Screen Captures,” which results in Figure 4.
If the user wants to get screen capture file “Screen Capture 001.jpg” to the PC, they click on it. The PC operating system (OS) automatically transfers the file content from the instrument to the PC and the OS starts the default application to display .jpg files (Windows Photo Viewer, Paint, etc.) (Fig. 5).

If the user likes what they see, the file can be saved to the PC hard drive or some other storage location. That is all. The user did not have to install any PC software. The user did not need to find a USB flash drive, plug it into the instrument, and figure out how to use the instrument front panel keys to get the file onto the USB flash drive. This is so easy – like getting pictures from a camera. The PC OS does the work to get the content and start the application. The only thing the user had to do was a few clicks of a mouse.

3. Shown are instrument shared internal storage root directories.

A similar scenario works for getting saved data files. An instrument might save data in a .csv format. When the user clicks on a .csv file, Excel starts and shows the data.

The user can set up an instrument, save the instrument state to a file, and then copy/paste the instrument state file to a location on the PC. The state file can later be moved from the PC to the instrument where it can be used to set up the instrument state exactly as it was before. Files can be moved from the instrument to the PC and from the PC to the instrument.

MTP File-Sharing Technology

4. Content in a “Screen Captures” folder may appear in this fashion.

PC operating systems natively support several types of file-sharing USB devices. Most devices share files using either the USB Media Transfer Protocol (MTP) or the USB Mass Storage Class (MSC). With MTP:

• The instrument can share files and retain the ability to update the file system. The instrument sends MTP defined “events” for communicating when a new file is created.
• The instrument controls what part of the file system is shared. It does not have to share an entire file system. It can share \dir1\dir2\dir3\shared.
• The instrument controls access capabilities. Sharing can be read-only or read-write.
• The instrument can share multiple storage locations. For instance, it could share one location as read-only (RO) and one as read-write (RW).
• The user, at the PC, can also update/change shared files on the instrument. The OS forwards file system change requests as MTP protocol requests to the instrument. Instrument firmware sees the requests and performs the request if it is not also modifying the shared files.

5. An example of a screen capture file.

Implementing MTP

Instruments can implement MTP as an additional “logical” (not physical) USB interface. Typically a test and measurement instrument implements a USB488 interface to enable PC apps to control the instrument with IVI  software. In many cases, instruments can add an MTP interface with firmware modifications only. No new physical connector and no hardware changes. Devices with two or more USB interfaces are common and are called “Composite USB” devices. An example of a Composite USB device is an “all-in-one” printer.
The MTP protocol specification is available from the USB-IF.

On-Demand

When sharing files with MTP, the instrument retains control of the shared files and instrument firmware knows when files are being accessed by the connected PC. Because of this awareness, MTP enables an “on-demand” feature. If a file is an on-demand file, then when a PC first attempts to read the file, new content is created. In other words, the PC user, by simply clicking on a file, is controlling the instrument, causing it to perform instrument-specific actions. There are several use cases for “on-demand.”

Download this article in .PDF format
This file type includes high resolution graphics and schematics when applicable.

A digital voltmeter might share an on-demand file named “Get 100 readings.NOW.csv”. The user recognizes that it is an on-demand file because of the “.NOW”. When the user clicks on the file, the OS sends an MTP protocol request to the instrument to read the file. The instrument is notified of the request, takes 100 readings, writes the new data into the file, and then sends the file, with the new content, to the PC. The PC starts Excel to display the new content to the user. This kind of on-demand can be used when the data set is able to be generated within timeout constraints of MTP responses. The data set must also be of unchanging size.

MTP is currently supported on Windows and is known to work on some Linux operating systems. The file-sharing technology is also available for Apple computers; however, it requires the user to install software.

TAGS: Systems
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish