pythonvxi11 (1) - Linux Manuals

pythonvxi11: Python VXI11 Documentation

NAME

pythonvxi11 - Python VXI11 Documentation

This Python package supports the VXI-11 Ethernet instrument control protocol for controlling VXI11 and LXI compatible instruments.

See also:

Python VXI11 home page
GitHub repository

Contents:

INTRODUCTION TO PYTHON VXI11

Overview

This Python package supports the VXI-11 Ethernet instrument control protocol for controlling VXI11 and LXI compatible instruments. The implementation is pure Python and highly portable.

It is released under the MIT license, see LICENSE for more details.

Copyright (C) 2012-2013 Alex Forencich <alex [at] alexforencich.com>

See also:

Python VXI11 home page
GitHub repository

Features

Supports Python 2 and Python 3
Pure Python
Highly portable
Communicates with instruments over the VXI11 TCP/IP instrument control protocol

Requirements

Python 2 or Python 3

Installation

To install the module for all users on the system, administrator rights (root) are required.

From source

Download the archive, extract, and run:

python setup.py install

Packages

There are also packaged versions for some Linux distributions:

Arch Linux
Python VXI11 is available under the name "python-vxi11-git" in the AUR.

PYTHON VXI11 EXAMPLES

Opening a connection

Connect to an Agilent MSO7104A oscilloscope on IP address 192.168.1.104:

>>> import vxi11
>>> instr =  vxi11.Instrument("192.168.1.104")
>>> print(instr.ask("*IDN?"))
'AGILENT TECHNOLOGIES,MSO7104A,MY********,06.16.0001'

Connect to an Agilent E3649A via an HP 2050A GPIB bridge:

>>> import vxi11
>>> instr = vxi11.Instrument("192.168.1.105", "gpib,5")
>>> print(instr.ask("*IDN?"))
'Agilent Technologies,E3649A,0,1.4-5.0-1.0'

Configuring connections

Open a connection and set the timeout:

>>> import vxi11
>>> instr = vxi11.Instrument("192.168.1.104")
>>> instr.timeout = 60*1000
>>> print(instr.ask("*TST?"))
'0'

VXI11 --- VXI11 DRIVER

This module provides a VXI11 TCP/IP instrument driver.

Functions and Exceptions

exception vxi11.Vxi11Error
Exception raised on various occasions; argument is a string describing what is wrong.

Instrument class

class vxi11.Instrument(host, name=None, client_id=None, term_char=None)
VXI-11 instrument interface client
abort()
Asynchronous abort
ask(message, num=-1, encoding='utf-8')
Write then read string
ask_raw(data, num=-1)
Write then read binary data
clear()
Send clear command
close()
Close connection
local()
Send local command
lock()
Send lock command
open()
Open connection to VXI-11 instrument
read(num=-1, encoding='utf-8')
Read string from instrument
read_raw(num=-1)
Read binary data from instrument
read_stb()
Read status byte
remote()
Send remote command
trigger()
Send trigger command
unlock()
Send unlock command
write(message, encoding='utf-8')
Write string to instrument
write_raw(data)
Write binary data to instrument

APPENDIX

License

Copyright (c) 2012-2014 Alex Forencich and Michael Walle

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

genindex
modindex
search

AUTHOR

Alex Forencich

COPYRIGHT

2013, Alex Forencich