Linux Drivers for Agilent Infiniium Oscilloscopes

Using the VXI-11 RPC Protocol over Ethernet

Steve D. Sharples

Last update: 16 October 2009, current version: 1.02
Related links:
VXI11 Ethernet Protocol for Linux. You'll need this for these drivers to work.
Linux Drivers for Tektronix Oscilloscopes and Arbitrary Function Generators
TCP/IP Control of a LeCroy DSO with Linux
Random links:
Hardware Linux/open source drivers | Eagle PCB -> PCBTrain Export Mini How-To | Eagle PCB -> LPKF Milling Machine Mini-How-To | strip_nl: newline (CR) stripper | Agfa Snapscan 310 Scanner with Linux | Linux on a Dell Latitude CP M233XT | Installing PCI230/PCI260 Comedi driver on a RedHat 9 system (PDF) | The steve (a new unit of measurement) | Applied Optics Group at EEE, University of Nottingham (who we are)

Skip to the end...

Here's a link to a tarball of the latest source: agilent_scope.tar.gz. Once you've untarred it, have a gander at the README.txt file. You might also want to have a quick butchers at the CHANGELOG.txt file.
You will also need the VXI11 Protocol for Linux (including my vxi11_user libraries).

For those in a real hurry, check out the 60 second quick download and installation instructions.

Introduction

This is a collection of source code that will allow you to talk to Agilent Infiniium oscilloscopes, via the VXI11 Protocol for Linux. It uses my own vxi11_user libraries, built on top of the VXI11 RPC protocol itself. To compile and run this code, you will also need the vxi11.tar.gz tarball. It consists of a user library (agilent_user.c), with a range of functions that perform many of the common tasks that you might want to do with your scope, including (at the time of writing) grabbing traces from the scope, loading and saving settings, setting up the scope etc; and a handful of simple command line utilities for grabbing traces from the scope, loading and saving the scope setup. You can use these as templates to writing your own applications, and I'd be interested in any that you develop!

Description of the Linux agilent_scope code

This collection of source code consists of:

1. library/agilent_user.c (and library/agilent_user.h)

These are (fairly) friendly user libraries. You can "open" and "close" your scope, load and save the setup, set up the scope for waveform capture, grab data, work out how many points your data will be, get the sample rate etc etc. There is not an exhaustive list of all the different things you might want to do (there is no function for "set the acquisition mode to equivalent time" for instance) but the code in the functions provided show you how to write functions for this kind of thing if you so desire. Most things can be achieved very easily via direct commands; so rather than writing a function to set equivalent time mode, you would just use vxi11_send(clink, ":ACQ:MODE ETIM"); for instance. Have a browse through the library, you'll see what I mean.

So most of the guts of the library is about setting up the scope for acquisition, working out how many bytes of data you're going to get, acquiring the data, and so on. In this respect, there is a certain amount of personalisation that you may not necessarily agree with and may want to change (which of course you can do, it's all open source!). For instance, by default, the acquisition memory on Agilent scopes almost always contains a longer time period's-worth of information than is displayed on the screen. I personally find this concept confusing to work with, and so the library functions are written such that the time period of data that you get always corresponds to what you see on the screen.

2. utils/agetwf/agetwf.c

This is a command line utility for grabbing a trace from the scope. After you've compiled the source code, type ./agetwf to see how to use it. For historical reasons, we have our own data format for scope trace data. Each trace consists of a trace.wf file that contains the binary data, and a trace.wfi text file that contains the waveform info. We then use a very cheesy Matlab script, loadwf.m to load the data into Matlab. The wfi file does not contain all the information that Agilent's own "preamble" information contains; on the other hand, you can have multiple traces in the same wf file. So whether you use this format, or modify it, is up to you. The utility is well commented, and so you should be able to adapt it to suit your own purposes, should you wish.

3. utils/agilent_load_save_setup/agilent_save_setup.c

Saves the current Agilent Scope Setup to a ".ass" file, for future use.

4. utils/agilent_load_save_setup/agilent_load_setup.c

Loads an Agilent Scope Setup (".ass") file, and sends it to the scope.

5. loadwf.m

A cheesy Matlab script for loading the trace.wf/trace.wfi files generated by the agetwf utility. This script (and the wfi file format) has been hacked and bodged over more than six years and several generations of digital scopes by several manufacturers, so it isn't very pretty!

6. Makefile

Type "make" to compile the source above. Type "make clean" to remove old object files and the old executables. Type "make install" to copy the utilities to /usr/local/bin/

There are also individual Makefiles in the agetwf and agilent_load_save_setup directories.

7. README.txt

Contains instructions on how to compile the source against the vxi11 code; and some other info.

8. CHANGELOG.txt

Text file containing information about the changes between all the different versions.

9. GNU General Public License

Fairly obvious. All programs, source, readme files etc are covered by this license. In brief:

These programs are free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

These programs are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with these programs; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

60 Second Quick Download and Installation Instructions

This is all in the readme, but then it's nice to cut and paste sometimes...:

wget http://optics.eee.nottingham.ac.uk/vxi11/source/vxi11.tar.gz
tar -xvzf vxi11.tar.gz
cd vxi11
make
Everthing ok so far? Want to see if you can talk to your scope (or any VXI11 instrument)?
./vxi11_cmd your.inst.ip.addr
*IDN?
q
Let's carry on...:
cd ..
wget http://optics.eee.nottingham.ac.uk/agilent_scope/source/agilent_scope.tar.gz
tar -xvzf agilent_scope.tar.gz
cd agilent_scope_X.XX
(where X.XX is the current version number)
make
Everything ok? Want to try and grab a trace?
cd utils/agetwf
./agetwf -ip your.inst.ip.addr -f test -c 1
(Binary data is in test.wf, waveform info is in test.wfi. Use the Matlab script loadwf.m to load into Matlab.)

Links to the source

Here's a link to a tarball of the source: agilent_scope.tar.gz

This produces an "agilent_scope" directory containing the agilent_user.c and agilent_user.h library; a utils directory containing agetwf.c, agilent_save_setup.c and agilent_load_setup.c utilities; and loadwf.m, a Matlab script for reading the files produced by agetwf.

There is also a Makefile, a README.txt file, a CHANGELOG.txt file, and a copy of the GNU General Public License. To extract the tarball, use tar -xvzf agilent_scope.tar.gz . Then have a look at the README.txt file for compiling instructions.

Please read the disclaimer about warranty, etc etc.

All the files, including previous versions, are available for viewing or downloading here.

All trademarks and copyrights are acknowledged.