pyvLab
Despription
If you need to control gpib/visa-instruments, pyvLab could be the right thing for you.
For example you can control the Keithley 2400, 2000, 6487, the Rohde&Schwarz Singalgenerator SMP02, the R&S Network Analyzer ZVC, etc.
It's easy to add support for new instruments.
Technical it is a graphical frontend for the pyVisa package. PyVISA enables you to control all kinds of measurement equipment through various buses (GPIB, RS232, USB) with Python programs.
It should be possible to control all instruments pyVisa supports.
Please see
http://pyvisa.sourceforge.net/ for more details!
Download/Project page
The pyvLab project page contains the bug tracker and the download area:
Download/Project page
Screenshots
Simple example:

(pyvLab runnung under Windows, real measurement data)
In the above screenshot a Keithley2400 is used to set source voltage between -10 and 10 volt (in 201 steps)
and the current is measured. The voltage and the current are plotted (x,y).
On every step the current is read out 5 times (with at least 100ms time between
two readings) and the average is taken.
This value (and the current voltage) is saved to a file "4K-Kontakt P15-GateO-000", "4K-Kontakt P15-GateO-001", ...
When the measurement has finished, the programm will exchange the -10 and the 10 volt value ("Reverse range
after measurement), so that if you repeat this measurement it starts with 10 volts (so there will be no current
jump from 10 to -10 volt).
More complex example:

(pyvLab running under Linux, no real measurement data shown, just random numbers -> see pseudovisa capability)
In the above screenshot a Rohde&Schwarz signalgenerator SMP02 is set (fixed (|...)) to 1GHz and 1dB (starting (-->)) output power.
Then a Keithley 2400 is set to 32V source voltage and current is read out 3 times. Out of these the average value is taken.
This step is repeated 17 times, then source voltage is at 49V.
After that the output power (of the SMP02) is set to 2dB and the source/current measurement (with the Keitley 2400) is repeated.
All measurement data is saved to test/myMeasurement-000 till test/myMeasurement-009 (dB power changes 10 times (10 steps))
It's easy to add new instruments. For details see below.
Changelog
The changelog file.
Requirements
pyvLab works under Windows and Linux. It needs the following packages installed:
Python (version 2.3, 2.4 tested)
Qt (version 2.30-win, 3.3.4-x11 tested)
PyQt (version 3.13 tested)
pyQwt (version 4.0rc0, 4.1, 4.2 tested)
pyVisa (version 0.9.6 (or higher) needed)
Some of these also need some special packages, especially
python-numeric (see pyqwt homepage)
python-ctypes, visa-driver from www.ni.com/visa (see pyVisa homepage)
You can download them (except the pyVisa (+its requirements) package) at best from the pyQwt homepage:
http://pyqwt.sourceforge.net/
There you also find a good description about the installation process.
After that you also have to install pyVisa from:
http://pyvisa.sourceforge.net/
Now you are ready to run pyvLab.
If you use SuSE 10.0, just install:
python-numeric, kdebindings, with Yast
the adequate PyQwt-RPM (x86, x86_64)
and pyVisa manually.
Now you are ready.
Usage
run pyvlab: just click on the file pyvlab.py
if pyvLab does not start:
Windows: open a command-shell and start 'python pyvlab.py'
Linux: open a shell and start 'python ./pyvlab.py'
look at the output:
if there are some visa-errors, make sure you have installed pyVisa and its requirements
in any other case:
try to fix it yourself or email me: pyvlab [at] axique (dot) de
hint: in the file visacontrol.py and visatester.py you find at the beginning:
#from pseudovisa import *
from visa import *
you can comment the visa-line and uncomment the pseudo-visa line:
change
to
.
Now you need no pyVisa anymore and the progam simulates some devices (no good simulation, just random numbers),
but you are able to see (in the shell window) the commands you send to the instruments.
in this "mode" you can play a lot without talking to real instruments
Add an Instrument
pyvLab comes with some instruments already supported (e.g. Keithley 2000, Keithley 2400, ...)
It's easy to add an instrument:
1. open the devicesconfig.py with your favorite editor
2. copy the instrument class of a similar device
(note: if pyvLab just writes to an instrument choose one which has as typ="w"
if pyvLab only reads from it, choose one which has as typ="r"
if you want to read and write, choose one which has as typ="rw"
and there is a special case: "v". It stands for virtual instrument(e.g. the Standby Time))
3. rename the class name to something like your devicename (you must not use spaces)
4. edit the gpib/visa commands.
(note: init: insert as a python list the commands to init the instrument.
!!!->
if you have only one command you always (!) also have to insert a komma, e.g. self.init=(":init",)
step: you only need this if your instrument-typ is 'rw' or 'w'
this function is called to get the commands to change to the next configuration, 'value' holds the value to move to
finish: these commands are written to the instrument after finishing the measurement (except you press stop)
to change the read command from ":read?" to something else, you have to overwrite the "read-function")
5. Edit the constants like description, resultform, canAveraging
6. insert your new classname in the "self.devices" list (at the beginning of the file
7. finished, your new instruments is now availible in pyvLab
Please mail me your devicesconfig.py, so that I can add these instruments to the default package. Thanks.
License
pyvLab is 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. pyvLab 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.
See the GNU General Public License for more details (http://www.gnu.org/licenses/gpl.html)
pyvLab is based in part on the work of the Qwt project (http://qwt.sf.net).
Page modified 05/11/28 - Christoph Würstle - http://www.axique.de