TCP/IP (VICP) Control of a LeCroy DSO with Linux

Steve D. Sharples

Last update (code): 6 October 2004
Last update (website): 11 December 2009

Related links:
Communicating with VXI11 Ethernet Devices from Linux (How to talk to your Agilent or Tektronix Scope from Linux over LAN. Also works with modern LXI-compliant LeCroy scopes.)
Linux Drivers for Tektronix Oscilloscopes and Arbitrary Function Generators (built on the VXI-11 protocol and user library)
Linux Drivers for Agilent Infiniium Oscilloscopes (built on the VXI-11 protocol and user library)
Random links:
Linux on a Dell Latitude CP M233XT | strip_nl: newline (CR) stripper | Eagle PCB -> LPKF Milling Machine Mini-How-To | Agfa Snapscan 310 Scanner with Linux | Installing PCI230/PCI260 Comedi driver on a RedHat 9 system (PDF) | The steve (a new unit of measurement)

Update! 11 December 2009

For the past couple of years, apparently all new LeCroy scopes have been LXI class C compliant. This might not mean much to you, but what it means in practice, is that you can communicate with the instruments using the VXI-11 protocol over ethernet.

I have written a (fairly solid) vxi11 driver for Linux, and in the near future (once our new scope arrives) we will write drivers built on top of this VXI-11 protocol for doing common tasks (grabbing traces etc). To set up your scope to use VXI-11, either use the utilities menu, or your scope's own web page.

In view of this, the Linux implementation here of the VICP protocol should be considered deprecated. It will of course remain available for download for old LeCroy scopes which were not LXI compliant.

Update! 6 October 2004

Anthony Cake from LeCroy has been in touch to tell me about LeCroy's own (open source) implementation of the VICP protocol, which apparently has been on Sourceforge for a while. To quote his email:

I'm writing with regards to your 'LeCroy TCP' library, which I found on your website: http://optics.eee.nottingham.ac.uk/lecroy_tcp/

The code that this was started from had several problems, and the specification has evolved since it was written. We published a reference implementation of the VICP protocol on SourceForge many months ago. This is the actual code that's embedded within our ActiveDSO and ScopeExplorer products. This code is located here: http://sourceforge.net/projects/lecroyvicp/. This reference implementation has been very well tested, and should be relatively platform independent (it's a single .h file). In addition, it includes several techniques to maximize performance, including disabling the TCP nagle algorithm (a killer for real-time performance), and reducing the number of packets sent over the wire for 'small data'.

I'm rather busy with other projects at the moment, but when I have time I'll see about either switching to the LeCroy driver, or implementing the changes into mine. In the meantime, if you need a TCP/IP driver that implements the VICP protocol, it's probably worth checking out the Sourceforge link.

Anyway, on with my stuff...

Very briefly...

We use Linux at work for a lot of very good reasons. We wanted to use a LeCroy DSO (digital storage oscilloscope) to grab data off an experiment. We'd had considerable success in using an old GPIB card with an old (ish) LeCroy DSO, but to save on the cost of buying a PCI GPIB card, and to free up a slot in the PC, we got an ex-demo scope with the ethernet option fitted. Software for Windows-based PCs is available from LeCroy to control their products, however they are not (at present anyway) supporting Linux.

The scope was bought on the understanding that support would be available from LeCroy in the form of source code, and information on protocols and headers and suchlike to enable us to write our own drivers. This was immediately forthcoming, and to their credit LeCroy, despite not supporting Linux directly, were very helpful in supplying simple, easy to read Windows/DOS source code that would enable me to write Linux code. I'd especially like to thank Graham Gibbons, at "LeCroy Applications Europe" for his help.

I guess I should just get this lot out of the way....:

Neither Steve Sharples, nor the University of Nottingham, have any connection with LeCroy Corporation. LeCroy is not "responsible" for this code, nor will they support it. The code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The code was modified to compile under Linux, and available here, released under the GNU General Public License.

What it doesn't do

It's not a version of LeCroy's ScopeExplorer(TM) or ActiveDSO(TM) software. Don't expect to compile the code, run it, and see the equivalent of your scope's screen appear on your PC monitor.

What it does

The code provided is simply a low-level driver for talking to a LeCroy instrument via TCP/IP, using the LeCroy VICP protocol. It will allow you to send commands to the instrument, as detailed in the Remote Control Manual you will have received with your DSO or whatever, and to receive data your instrument sends you. A simple example program is included to demonstrate usage. The driver might be of particular interest to those who have written or used GPIB and/or RS232 drivers to talk to their instrument, and now wish to use TCP/IP. Feel free to modify the program, change the source etc as set out in the terms of the GNU General Public License. I'd obviously be very interested to hear of any improvements, bug-fixes etc... my email address is in the README.TXT file.

At some point I'll include here some code for some utilities that use this driver... you never know, I might eventually write a graphics front-end for this (hmmm... sounds suspiciously like 3rd/4th year undergraduate project!).

Source code

Here's a link to a tarball of the source: lecroy_tcp-1.00.tar.gz
Here's a link to a zip of the source: lecroy_tcp-1.00.zip

Both produce the same thing, a "lecroy_tcp" directory containing the driver source code, a simple example program, a Makefile, a README.TXT file, and a copy of the GNU GPL. To extract the tarball, use tar -xvzf file.tar.gz . To unzip the zipfile, use unzip file.zip .

Please read the disclaimer about warranty, etc etc.

All the files are available for viewing or downloading here.

Instructions for compiling are included, however it should hopefully just be a case of typing make . No "./configure" script is included (not sure how to make these) so it may not work on your particular architecture/flavour of Linux/UNIX. Not very knowledgeable about these things, sorry!