Learn how to use the IEEE-488 interface to communicate with compatible devices.
IEEE-488 is a venerable interface standard for communication between computers and scientific instruments such as multimeters and picoammeters. In particular, a Keithley 485 Picoammeter is used in the APL for experiments on th ephotoelectric affect and Nuvistor Triode.
In the IEEE-488 system devices are daisy chained used a special cable and connected to a computer using an IEEE-488 interface card. Each device has a unique address (number), often set using DIP switches on the back, as shown in the right side of the figure above. In your Python code you must use the set address to communicate with the instrument in question.
IEEE-488 from Python
The steps for communicating with an IEEE-488 device from Python are:
import the IEEEInterface class:
from ieeeinterface import IEEEInterface
make an instance of the IEEEInterface class:
Open connection to the card:
Check if the card opened successfully.
cardhandlewill have a value of 0 if an error occurred. Note: opening the card and checking needs to be done only once per program.
Read from the device (example assumes device address is ‘5’):
IEEE readDevice()command returns a string (in the above example stored in a variable called
responseis empty then an arror occurred and you should attempt a re-read.
responseis not empty then it will contain the reading you are interested, along with some other information about the device settings and/or scale. Extract the part of the string that corresponds to the value you are interested in and convert it to a
floatfor calculation, plotting etc