# Keithley¶

## Keithley195 Digital Multimeter¶

class instruments.keithley.Keithley195(filelike)

The Keithley 195 is a 5 1/2 digit auto-ranging digital multimeter. You can find the full specifications list in the Keithley 195 user’s guide.

Example usage:

>>> import instruments as ik
>>> import quantities as pq
>>> dmm = ik.keithley.Keithley195.open_gpibusb('/dev/ttyUSB0', 12)
>>> print dmm.measure(dmm.Mode.resistance)

class Mode

Enum containing valid measurement modes for the Keithley 195

current_ac = <Mode.current_ac: 4>
current_dc = <Mode.current_dc: 3>
resistance = <Mode.resistance: 2>
voltage_ac = <Mode.voltage_ac: 1>
voltage_dc = <Mode.voltage_dc: 0>
class Keithley195.TriggerMode

Enum containing valid trigger modes for the Keithley 195

ext_continuous = <TriggerMode.ext_continuous: 6>
ext_one_shot = <TriggerMode.ext_one_shot: 7>
get_continuous = <TriggerMode.get_continuous: 2>
get_one_shot = <TriggerMode.get_one_shot: 3>
talk_continuous = <TriggerMode.talk_continuous: 0>
talk_one_shot = <TriggerMode.talk_one_shot: 1>
x_continuous = <TriggerMode.x_continuous: 4>
x_one_shot = <TriggerMode.x_one_shot: 5>
class Keithley195.ValidRange

Enum containing valid range settings for the Keithley 195

current_ac = <ValidRange.current_ac: (2e-05, 0.0002, 0.002, 0.02, 0.2, 2, 2)>
current_dc = <ValidRange.current_dc: (2e-05, 0.0002, 0.002, 0.02, 0.2, 2)>
resistance = <ValidRange.resistance: (20, 200, 2000, 20000.0, 200000.0, 2000000.0, 20000000.0)>
voltage_ac = <ValidRange.voltage_ac: (0.02, 0.2, 2, 20, 200, 700)>
voltage_dc = <ValidRange.voltage_dc: (0.02, 0.2, 2, 20, 200, 1000)>
Keithley195.auto_range()

Turn on auto range for the Keithley 195.

This is the same as calling Keithley195.input_range = 'auto'

Keithley195.get_status_word()

Retreive the status word from the instrument. This contains information regarding the various settings of the instrument.

The function parse_status_word is designed to parse the return string from this function.

Returns: String containing setting information of the instrument str
Keithley195.measure(mode=None)

Instruct the Keithley 195 to perform a one time measurement. The instrument will use default parameters for the requested measurement. The measurement will immediately take place, and the results are directly sent to the instrument’s output buffer.

Method returns a Python quantity consisting of a numpy array with the instrument value and appropriate units.

With the 195, it is HIGHLY recommended that you seperately set the mode and let the instrument settle into the new mode. This can sometimes take longer than the 2 second delay added in this method. In our testing the 2 seconds seems to be sufficient but we offer no guarentee.

Example usage:

>>> import instruments as ik
>>> import quantities as pq
>>> dmm = ik.keithley.Keithley195.open_gpibusb('/dev/ttyUSB0', 12)
>>> print(dmm.measure(dmm.Mode.resistance))

Parameters: mode (Keithley195.Mode) – Desired measurement mode. This must always be specified in order to provide the correct return units. A measurement from the multimeter. Quantity
static Keithley195.parse_status_word(statusword)

Parse the status word returned by the function get_status_word.

Returns a dict with the following keys: {trigger,mode,range,eoi,buffer,rate,srqmode,relative,delay,multiplex, selftest,dataformat,datacontrol,filter,terminator}

Parameters: statusword – Byte string to be unpacked and parsed str A parsed version of the status word as a Python dictionary dict
Keithley195.trigger()

Tell the Keithley 195 to execute all commands that it has received.

Do note that this is different from the standard SCPI *TRG command (which is not supported by the 195 anyways).

Keithley195.input_range

Gets/sets the range of the Keithley 195 input terminals. The valid range settings depends on the current mode of the instrument. They are listed as follows:

1. voltage_dc = (20e-3, 200e-3, 2, 20, 200, 1000)
2. voltage_ac = (20e-3, 200e-3, 2, 20, 200, 700)
3. current_dc = (20e-6, 200e-6, 2e-3, 20e-3, 200e-3, 2)
4. current_ac = (20e-6, 200e-6, 2e-3, 20e-3, 200e-3, 2)
5. resistance = (20, 200, 2000, 20e3, 200e3, 2e6, 20e6)

All modes will also accept the string auto which will set the 195 into auto ranging mode.

Return type: Quantity or str
Keithley195.mode

Gets/sets the measurement mode for the Keithley 195. The base model only has DC voltage and resistance measurements. In order to use AC voltage, DC current, and AC current measurements your unit must be equiped with option 1950.

Example use:

>>> import instruments as ik
>>> dmm = ik.keithley.Keithley195.open_gpibusb('/dev/ttyUSB0', 12)
>>> dmm.mode = dmm.Mode.resistance

Keithley195.relative

Gets/sets the zero command (relative measurement) mode of the Keithley 195.

As stated in the manual: The zero mode serves as a means for a baseline suppression. When the correct zero command is send over the bus, the instrument will enter the zero mode, as indicated by the front panel ZERO indicator light. All reading displayed or send over the bus while zero is enabled are the difference between the stored baseline adn the actual voltage level. For example, if a 100mV baseline is stored, 100mV will be subtracted from all subsequent readings as long as the zero mode is enabled. The value of the stored baseline can be as little as a few microvolts or as large as the selected range will permit.

Type: bool
Keithley195.trigger_mode

Gets/sets the trigger mode of the Keithley 195.

There are two different trigger settings for four different sources. This means there are eight different settings for the trigger mode.

The two types are continuous and one-shot. Continuous has the instrument continuously sample the resistance. One-shot performs a single resistance measurement.

The three trigger sources are on talk, on GET, and on “X”. On talk refers to addressing the instrument to talk over GPIB. On GET is when the instrument receives the GPIB command byte for “group execute trigger”. On “X” is when one sends the ASCII character “X” to the instrument. This character is used as a general execute to confirm commands send to the instrument. In InstrumentKit, “X” is sent after each command so it is not suggested that one uses on “X” triggering. Last, is external triggering. This is the port on the rear of the instrument. Refer to the manual for electrical characteristics of this port.

## Keithley580 Microohm Meter¶

class instruments.keithley.Keithley580(filelike)

The Keithley Model 580 is a 4 1/2 digit resolution autoranging micro-ohmmeter with a +- 20,000 count LCD. It is designed for low resistance measurement requirements from 10uΩ to 200kΩ.

The device needs some processing time (manual reports 300-500ms) after a command has been transmitted.

class Drive

Enum containing valid drive modes for the Keithley 580

dc = <Drive.dc: 1>
pulsed = <Drive.pulsed: 0>
class Keithley580.Polarity

Enum containing valid polarity modes for the Keithley 580

negative = <Polarity.negative: 1>
positive = <Polarity.positive: 0>
class Keithley580.TriggerMode

Enum containing valid trigger modes for the Keithley 580

get_continuous = <TriggerMode.get_continuous: 2>
get_one_shot = <TriggerMode.get_one_shot: 3>
talk_continuous = <TriggerMode.talk_continuous: 0>
talk_one_shot = <TriggerMode.talk_one_shot: 1>
trigger_continuous = <TriggerMode.trigger_continuous: 4>
trigger_one_shot = <TriggerMode.trigger_one_shot: 5>
Keithley580.auto_range()

Turn on auto range for the Keithley 580.

This is the same as calling the Keithley580.set_resistance_range method and setting the parameter to “AUTO”.

Keithley580.get_status_word()

The keithley will not always respond with the statusword when asked. We use a simple heuristic here: request it up to 5 times, using a 1s delay to allow the keithley some thinking time.

Return type: str
Keithley580.measure()

Perform a measurement with the Keithley 580.

The usual mode parameter is ignored for the Keithley 580 as the only valid mode is resistance.

Return type: Quantity
static Keithley580.parse_measurement(measurement)

Parse the measurement string returned by the instrument.

Returns a dict with the following keys: {status,polarity,drycircuit,drive,resistance}

Parameters: measurement – String to be unpacked and parsed str dict
Keithley580.parse_status_word(statusword)

Parse the status word returned by the function get_status_word.

Returns a dict with the following keys: {drive,polarity,drycircuit,operate,range,relative,eoi,trigger, sqrondata,sqronerror,linefreq,terminator}

Parameters: statusword – Byte string to be unpacked and parsed str dict
Keithley580.query(msg, size=-1)
Keithley580.sendcmd(msg)
Keithley580.set_calibration_value(value)

Sets the calibration value. This is not currently implemented.

Parameters: value – Calibration value to write
Keithley580.store_calibration_constants()

Instructs the instrument to store the calibration constants. This is not currently implemented.

Keithley580.trigger()

Tell the Keithley 580 to execute all commands that it has received.

Do note that this is different from the standard SCPI *TRG command (which is not supported by the 580 anyways).

Keithley580.drive

Gets/sets the instrument drive to either pulsed or DC.

Example use:

>>> import instruments as ik
>>> keithley = ik.keithley.Keithley580.open_gpibusb('/dev/ttyUSB0', 1)
>>> keithley.drive = keithley.Drive.pulsed

Keithley580.dry_circuit_test

Gets/sets the ‘dry circuit test’ mode of the Keithley 580.

This mode is used to minimize any physical and electrical changes in the contact junction by limiting the maximum source voltage to 20mV. By limiting the voltage, the measuring circuit will leave the resistive surface films built up on the contacts undisturbed. This allows for measurement of the resistance of these films.

Type: bool
Keithley580.input_range

Gets/sets the range of the Keithley 580 input terminals. The valid ranges are one of {AUTO|2e-1|2|20|200|2000|2e4|2e5}

Type: Quantity or str
Keithley580.operate

Gets/sets the operating mode of the Keithley 580. If set to true, the instrument will be in operate mode, while false sets the instruments into standby mode.

Type: bool
Keithley580.polarity

Gets/sets instrument polarity.

Example use:

>>> import instruments as ik
>>> keithley = ik.keithley.Keithley580.open_gpibusb('/dev/ttyUSB0', 1)
>>> keithley.polarity = keithley.Polarity.positive

Keithley580.relative

Gets/sets the relative measurement mode of the Keithley 580.

As stated in the manual: The relative function is used to establish a baseline reading. This reading is subtracted from all subsequent readings. The purpose of making relative measurements is to cancel test lead and offset resistances or to store an input as a reference level.

Once a relative level is established, it remains in effect until another relative level is set. The relative value is only good for the range the value was taken on and higher ranges. If a lower range is selected than that on which the relative was taken, inaccurate results may occur. Relative cannot be activated when “OL” is displayed.

Type: bool
Keithley580.trigger_mode

Gets/sets the trigger mode of the Keithley 580.

There are two different trigger settings for three different sources. This means there are six different settings for the trigger mode.

The two types are continuous and one-shot. Continuous has the instrument continuously sample the resistance. One-shot performs a single resistance measurement.

The three trigger sources are on talk, on GET, and on “X”. On talk refers to addressing the instrument to talk over GPIB. On GET is when the instrument receives the GPIB command byte for “group execute trigger”. Last, on “X” is when one sends the ASCII character “X” to the instrument. This character is used as a general execute to confirm commands send to the instrument. In InstrumentKit, “X” is sent after each command so it is not suggested that one uses on “X” triggering.

## Keithley2182 Nano-voltmeter¶

class instruments.keithley.Keithley2182(filelike)

The Keithley 2182 is a nano-voltmeter. You can find the full specifications list in the user’s guide.

Example usage:

>>> import instruments as ik
>>> meter = ik.keithley.Keithley2182.open_gpibusb("/dev/ttyUSB0", 10)
>>> print meter.measure(meter.Mode.voltage_dc)

class Channel(parent, idx)

Class representing a channel on the Keithley 2182 nano-voltmeter.

Warning

This class should NOT be manually created by the user. It is designed to be initialized by the Keithley2182 class.

measure(mode=None)

Performs a measurement of the specified channel. If no mode parameter is specified then the current mode is used.

Parameters: mode (Keithley2182.Mode) – Mode that the measurement will be performed in The value of the measurement Quantity
input_range
mode
relative
trigger_mode
class Keithley2182.Mode

Enum containing valid measurement modes for the Keithley 2182

temperature = <Mode.temperature: 'TEMP'>
voltage_dc = <Mode.voltage_dc: 'VOLT'>
class Keithley2182.TriggerMode

Enum containing valid trigger modes for the Keithley 2182

bus = <TriggerMode.bus: 'BUS'>
external = <TriggerMode.external: 'EXT'>
immediate = <TriggerMode.immediate: 'IMM'>
manual = <TriggerMode.manual: 'MAN'>
timer = <TriggerMode.timer: 'TIM'>
Keithley2182.fetch()

Transfer readings from instrument memory to the output buffer, and thus to the computer. If currently taking a reading, the instrument will wait until it is complete before executing this command. Readings are NOT erased from memory when using fetch. Use the R? command to read and erase data. Note that the data is transfered as ASCII, and thus it is not recommended to transfer a large number of data points using GPIB.

Returns: Measurement readings from the instrument output buffer. list of Quantity elements
Keithley2182.measure(mode=None)

Perform and transfer a measurement of the desired type.

Parameters: mode – Desired measurement mode. If left at default the measurement will occur with the current mode. Keithley2182.Mode Returns a single shot measurement of the specified mode. Quantity Volts, Celsius, Kelvin, or Fahrenheit
Keithley2182.channel

Gets a specific Keithley 2182 channel object. The desired channel is specified like one would access a list.

Although not default, the 2182 has up to two channels.

For example, the following would print the measurement from channel 1:

>>> meter = ik.keithley.Keithley2182.open_gpibusb("/dev/ttyUSB0", 10)
>>> print meter.channel[0].measure()

Return type: Keithley2182.Channel
Keithley2182.input_range
Keithley2182.relative

Gets/sets the relative measurement function of the Keithley 2182.

This is used to enable or disable the relative function for the currently set mode. When enabling, the current reading is used as a baseline which is subtracted from future measurements.

If relative is already on, the stored value is refreshed with the currently read value.

Type: bool
Keithley2182.units

Gets the current measurement units of the instrument.

Return type: UnitQuantity

## Keithley6220 Constant Current Supply¶

class instruments.keithley.Keithley6220(filelike)

The Keithley 6220 is a single channel constant current supply.

Because this is a constant current supply, most features that a regular power supply have are not present on the 6220.

Example usage:

>>> import quantities as pq
>>> import instruments as ik
>>> ccs = ik.keithley.Keithley6220.open_gpibusb("/dev/ttyUSB0", 10)
>>> ccs.current = 10 * pq.milliamp # Sets current to 10mA
>>> ccs.disable() # Turns off the output and sets the current to 0A

disable()

Set the output current to zero and disable the output.

channel

For most power supplies, this would return a channel specific object. However, the 6220 only has a single channel, so this function simply returns a tuple containing itself. This is for compatibility reasons if a multichannel supply is replaced with the single-channel 6220.

For example, the following commands are the same and both set the current to 10mA:

>>> ccs.channel[0].current = 0.01
>>> ccs.current = 0.01

current

Gets/sets the output current of the source. Value must be between -105mA and +105mA.

Units: As specified, or assumed to be $$\text{A}$$ otherwise. float or Quantity
current_max
current_min
voltage

This property is not supported by the Keithley 6220.

## Keithley6514 Electrometer¶

class instruments.keithley.Keithley6514(filelike)

The Keithley 6514 is an electrometer capable of doing sensitive current, charge, voltage and resistance measurements.

Example usage:

>>> import instruments as ik
>>> import quantities as pq
>>> dmm = ik.keithley.Keithley6514.open_gpibusb('/dev/ttyUSB0', 12)

class ArmSource

Enum containing valid trigger arming sources for the Keithley 6514

bus = <ArmSource.bus: 'BUS'>
immediate = <ArmSource.immediate: 'IMM'>
manual = <ArmSource.manual: 'MAN'>
nstest = <ArmSource.nstest: 'NST'>
pstest = <ArmSource.pstest: 'PST'>
stest = <ArmSource.stest: 'STES'>
timer = <ArmSource.timer: 'TIM'>
class Keithley6514.Mode

Enum containing valid measurement modes for the Keithley 6514

charge = <Mode.charge: 'CHAR'>
current = <Mode.current: 'CURR:DC'>
resistance = <Mode.resistance: 'RES'>
voltage = <Mode.voltage: 'VOLT:DC'>
class Keithley6514.TriggerMode

Enum containing valid trigger modes for the Keithley 6514

immediate = <TriggerMode.immediate: 'IMM'>
class Keithley6514.ValidRange

Enum containing valid measurement ranges for the Keithley 6514

charge = <ValidRange.charge: (2e-08, 2e-07, 2e-06, 2e-05)>
current = <ValidRange.current: (2e-11, 2e-10, 2e-09, 2e-08, 2e-07, 2e-06, 2e-05, 0.0002, 0.002, 0.02)>
resistance = <ValidRange.resistance: (2000.0, 20000.0, 200000.0, 2000000.0, 20000000.0, 200000000.0, 2000000000.0, 20000000000.0, 200000000000.0)>
voltage = <ValidRange.voltage: (2, 20, 200)>
Keithley6514.auto_config(mode)
This command causes the device to do the following:
• Switch to the specified mode
• Reset all related controls to default values
• Set trigger and arm to the ‘immediate’ setting
• Set arm and trigger counts to 1
• Set trigger delays to 0
• Place unit in idle state
• Disable all math calculations
• Disable buffer operation
• Enable autozero
Keithley6514.fetch()

Request the latest post-processed readings using the current mode. (So does not issue a trigger) Returns a tuple of the form (reading, timestamp)

Keithley6514.read_measurements()

Trigger and acquire readings using the current mode. Returns a tuple of the form (reading, timestamp)

Keithley6514.arm_source

Gets/sets the arm source of the Keithley 6514.

Keithley6514.auto_range

Gets/sets the auto range setting

Type: bool
Keithley6514.input_range

Gets/sets the upper limit of the current range.

Type: Quantity
Keithley6514.mode

Gets/sets the measurement mode of the Keithley 6514.

Keithley6514.trigger_mode

Gets/sets the trigger mode of the Keithley 6514.

Keithley6514.unit
Keithley6514.zero_check

Gets/sets the zero checking status of the Keithley 6514.

Keithley6514.zero_correct

Gets/sets the zero correcting status of the Keithley 6514.