libvxi11

VXI-11 instruments access library

GPL-3.0 License

Stars
9

--- Introduction: ---

This is basically the VXI11Discovery project at https://github.com/mgmarino/VXI11Discovery re-organized to have the code for discovery and handling of VXI11 devices altogether in the same project using autotools.

VXI11 handling code itself that is included as a sub project of VXI11Discovery is a patched version of Steve Sharples' VXI11 ethernet protocol library, availble at: http://optics.eee.nottingham.ac.uk/vxi11/

If you use Python code to access VXI11 instruments you may be interested in checking this Python native implementation: https://github.com/alexforencich/python-vxi11

Doxygen documentation may be found here: http://f4exb.free.fr/libvxi11/doc/html/

--- Building: ---

Prerequisites: a. autoconf and automake (the "autotools") b. rpcgen (the RPC code generator) c. compiler ...

  1. Clone this repository with git clone
  2. In your local copy of the repository run the ./bootstrap.sh command
  3. Create a build directory. Ex: /opt/build/libvxi11
  4. cd /opt/build/libvxi11
  5. Assuming:
    • /opt/install/libvxi11 is where you want to install the library
    • /shared/development/github/libvxi11 is your local copy of the repository
      do:
    • /shared/development/github/libvxi11/configure --prefix=/opt/install/libvxi11
    • make (you may use the -j command to speed up things)
    • make install

--- The original Discovery code README is the following: ---

This distribution provides code to demonstrate how one broadcasts to find devices with certain services. The code was originally written to search for VXI11 devices, but is general to look for other devices with PROG and VERSION numbers. This code provides:

/*

  • The following is based on clnt_broadcast, with important differences that it
  • is only searching for devices which have the requested services. There is
  • also a timeout variable which doesn't normally exist in clnt_broadcast. If
  • found_callback is non NULL, this function is called when a device is found
  • with the requested service.
    */
    clnt_find_services(uint32_t prog, uint32_t vers, uint32_t proc,
    struct timeval *t, resultfoundproc_t found_callback);

which is based on Apple's open source clnt_broadcast available in rpc.subproj/pmap_rmt.c at:

http://www.opensource.apple.com/source/Libinfo/Libinfo-324/rpc.subproj/

Because of this the two files:

clnt_find_services.h clnt_find_services.c

are subject to the open-source license specified in those files. There is an additional file:

example.cc

which searches a local subnet and outputs information on the VXI11 devices connected using the VXI11 devices access code from Steve Sharples' patched code. This file is released under GPL 3.0 license meaning you can use it for whatever (including inspiration).

./example Example output: Found: 192.168.1.29 : TCP 1024; UDP 0 Output: Agilent Technologies,33220A,MY44036260,2.02-2.02-22-2

Found: 192.168.1.30 : TCP 1024; UDP 0 Output: THURLBY THANDAR, CPX400DP, 355211, 1.01 - 3.00

Compatibility: This has been tested on Mac OS X systems (Lion) and on Ubuntu.

--- The original VXI11 devices handling code README from Steve Sharples' repository is the following: ---

RPC PROTOCOL FOR COMMUNICATING WITH VXI11-ENABLED DEVICES OVER ETHERNET FROM LINUX

(including instruments such as oscilloscopes, by manufacturers such as Agilent and Tektronix, amongst others).

By Steve D. Sharples, June 2006.

This is a collection of source code that will allow you to talk to ethernet- enabled instruments that use the VXI11 protocol, from Linux. This includes a wide range of instruments (including oscilloscopes, logic analysers, function generators etc) by a wide range of manufacturers (including Tektronix and Agilent to name just a couple). An interactive "send and receive" utility is included as an example.

You may want to build on to this libraries for your specific instruments - I'm currently working on libraries for talking to Agilent Infiniium scopes, and will probably do the same for Tektronix scopes too. Basically if you've got a Programmer's Reference for your instrument, and this code, you should be able to cobble something together.

This collection of code has been produced because 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). One of the solutions offered was to use something called NI VISA; parts of this are closed source, it was enormous, and I had worries about legacy issues with changing PC hardware.

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.

This collection of source code consists of:

(1) vxi11.x This file, vxi11.x, is the amalgamation of vxi11core.rpcl and vxi11intr.rpcl which are part of the asynDriver (R4-5) EPICS module, which, at time of writing, is available from: http://www.aps.anl.gov/epics/modules/soft/asyn/index.html More general information about EPICS is available from: http://www.aps.anl.gov/epics/ This code is open source, and is covered under the copyright notice and software license agreement shown below, and also at: http://www.aps.anl.gov/epics/license/open.php

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, such as oscilloscopes and function generators by manufacturers such as Agilent and Tektronix (amongst many others).

(2) vxi11_user.cc (and vxi11_user.h) These are (fairly) friendly user libraries. At the core are 4 key functions: vxi11_open(), vxi11_close(), vxi11_send() and vxi11_receive(). These allow you to talk to your device. There are also some other functions that I considered to be generally useful (send_and_receive, functions for sending and receiving fixed length data blocks etc) that are all non-instrument- specific.

(3) vxi11_cmd.c This is a fairly simple interactive utility that allows you to send commands and queries to your vxi11-enabled instrument, which you locate by way of IP address. I recommend you start with *IDN? It shows you how the vxi11_user library works

(4) Makefile Type "make" to compile the source above. Type "make clean" to remove old object files and ./vxi11_cmd. Type "make install" to copy ./vxi11_cmd to /usr/local/bin/

(5) GNU_General_Public_License.txt Fairly obvious. All programs, source, readme files etc NOT covered by any other license (e.g. vxi11.x, which is covered by its own open source license) are covered by this license.

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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

The author's email address is [email protected] (you can work it out!)