or: How to talk to your LXI-Compliant Agilent, LeCroy or Tektronix Scope from Linux over LAN
Steve D. Sharples
The code is now being maintained on github by a colleague: https://github.com/applied-optics/vxi11
Please follow the link above to get the code. The following is legacy, and will be left here for a while, but will eventually be deleted.
Website updated: 30 July 2015 (above note).
Related links:
Linux Drivers for
Agilent Infiniium Oscilloscopes (built on this VXI-11 protocol and user library)
Linux Drivers for
Tektronix Oscilloscopes and Arbitrary Function Generators (built on this VXI-11 protocol and user library)
TCP/IP Control of a LeCroy DSO with Linux (uses LeCroy's own VICP protocol)
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 |
Applied Optics Group at EEE, University of Nottingham (who we are)
For those in a real hurry, check out the 30 second quick download and installation instructions.
NOTE: I've published a set of code for Tektronix oscilloscopes and arbitrary function generator, to complement a set of code for Agilent Infiniium oscilloscopes, consisting of a user library and a few example command line utilities. Both the Agilent code and Tek code is built on top of this (the vxi11) code, so you will need both if you want to use it.
You may want to build on to this libraries for your specific instruments - I've currently got libraries for talking to Agilent Infiniium scopes, Tektronix scopes, and Tektronix arbitrary function generators (AFGs) too. LeCroy scope drivers will follow shortly. Basically if you've got a Programmer's Reference for your instrument, and this code, you should be able to cobble something together.
The source code (libraries and a couple of example programs) for talking to Tektronix scopes and AFGs is available here. Similar code for talking to Agilent Infiniium scopes is available here. (You will still need the vxi11 source too.)
This collection of code has been produced because, around June 2006, I grew frustrated at how difficult it seemed to be to do a relatively simple task. None of the major manufacturers had any "out of the box" Linux solutions to talking to their instruments (although often I would talk to technical folks who would try their best to help; Randy White of Tektronix of particular note). One of the solutions offered was to use something called NI VISA; most of this is closed source, it was enormous, and I had worries about legacy issues with changing PC hardware. And on top of that you have to pay for it.
Via Guy McBride at Agilent, I obtained a copy of a vxi11.x RPC file similar to the one included here (although no-one at Agilent seemed to know or care where it came from). After lots of searching on the information superhighway I located what I believe is the original source (or something like it); see the section on vxi11.x below. This source seems to have literally been written from the published VXI11 protocol. I also received from Agilent a simple example program that showed you how to use the protocol; working from this and the (open) source that uses the vxi11.x that is included here, I wrote vxi11_cmd and the user libraries. Also helping me along the way were the VXI-11 RPC Programming Guide for the 8065 (PDF) and the VXI-11 and HP E2050A (PDF) Programmer's Guide. After I wrote the library, I found (and wish I'd found earlier) an article in Test and Measurement World called Linux controls instruments through Ethernet. From there, there was originally a link to a zip-file, including an 8-page Word document and some source code, published by Stefan Kopp of Agilent. The original link is now dead, but you can find a copy via the internet archive wayback machine (click on the blue circle around the number 28 on May). This is well worth a look if you're interested, and something I unfortunately missed completely whilst writing this code.
It is intended as a lightweight base for the vxi11 rpc protocol. If you run rpcgen on this file, it will generate C files and headers, from which it is relatively simple to write C programs to communicate with a range of ethernet-enabled instruments.
If you're using some kind of LAN to GPIB gateway, then you need to supply both the IP address of the gateway, AND the device name. This could be something like "gpib0,5" or similar - consult your LAN to GPIB gateway manual.
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.
I've recently received an email from Stefan Mahr, who says:
You might be interested that your vxi11 package can be compiled on Cygwin/Windows.
If the packages libtirpc-0.2.1-1 rpcgen-2.11.90_20100818-1 are installed and the attached patch [to the Makefile] is applied everything works fine. At the moment I don't know why dynamic linking of libtirpc (-ltirpc) doesn't work, so static linking at the moment.
Many thanks to Stefan Mahr for this information, I hope it's useful to others.
To enable the VXI-11 server, go to the TekVISA LAN Server Control icon at the bottom right hand corner of the scope's Desktop, right click and select Server Properties, then in the small window tick the box that says 'Start server at system powerup'. This should start the server each time.
The rather confusing thing about LeCroys is that even if VICP is selected, the scope still responds correctly to the VXI-11 "*IDN?" query - this, I believe, is for LXI compliance, which states that even if the manufacturer chooses to use a protocol other than VXI-11 for communications, then the device must be "discoverable" by responding correctly to a "*IDN?" query using the VXI-11 protocol. This might lead you to think that everything is working. However, all other queries result in the response, "WARNING : CURRENT REMOTE CONTROL INTERFACE IS TCPIP". If you are running a program and parsing the responses (rather than showing them) it may not be obvious that this is happening.
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
(or, if using a LAN to GPIB gateway:
./vxi11_cmd your.inst.ip.addr gpib0,N
where N is the assigned GPIB channel number of the instrument you want to
query)
*IDN?
This produces a "vxi11" directory containing the vxi11.x RPC protocol itself; vxi11_user.cc and vxi11_user.h user library; vxi11_cmd.cc, a simple demonstration program; a Makefile, a README.txt file, and a copy of the GNU General Public License. To extract the tarball, use tar -xvzf vxi11.tar.gz .
Please read the disclaimer about warranty, etc etc.
All the files, for all released versions so far, are available for viewing or downloading here.
Instructions for compiling are included, however it should hopefully just be a case of typing make .
All trademarks and copyrights are acknowledged.