PyVISA Documentation
Release 1.8
PyVISA Authors
May 04, 2016
1 General overview
2 User guide
3 More information
Python Module Index
Contents
3
5
21
175
i
ii
PyVISA Documentation, Release 1.8
PyVISA is a Python package that enables you to control all kinds of measurement devices independently of the
interface (e.g. GPIB, RS232, USB, Ethernet). As an example, reading self-identification from a Keithley Multimeter
with GPIB number 12 is as easy as three lines of Python code:
>>> import visa
>>> rm = visa.ResourceManager()
>>> rm.list_resources()
('ASRL1::INSTR', 'ASRL2::INSTR', 'GPIB0::12::INSTR')
>>> inst = rm.open_resource('GPIB0::12::INSTR')
>>> print(inst.query("*IDN?"))
(That’s the whole program; really!) It works on Windows, Linux and Mac; with arbitrary adapters (e.g. National
Instruments, Agilent, Tektronix, Stanford Research Systems).
Contents
1
PyVISA Documentation, Release 1.8
2
Contents
CHAPTER 1
General overview
The programming of measurement instruments can be real pain. There are many different protocols, sent over many
different interfaces and bus systems (e.g. GPIB, RS232, USB, Ethernet). For every programming language you want
to use, you have to find libraries that support both your device and its bus system.
In order to ease this unfortunate situation, the Virtual Instrument Software Architecture (VISA) specification was de-
fined in the middle of the 90ies. VISA is a standard for configuring, programming, and troubleshooting instrumentation
systems comprising GPIB, VXI, PXI, Serial, Ethernet, and/or USB interfaces.
Today VISA is implemented on all significant operating systems. A couple of vendors offer VISA libraries, partly
with free download. These libraries work together with arbitrary peripherical devices, although they may be limited
to certain interface devices, such as the vendor’s GPIB card.
The VISA specification has explicit bindings to Visual Basic, C, and G (LabVIEW’s graphical language). However,
you can use VISA with any language capable of calling functions in a shared library (.dll, .so, .dylib). PyVISA is
Python wrapper for such shared library ... and more.
3
PyVISA Documentation, Release 1.8
4
Chapter 1. General overview