devices.keithley:Keithley6221

Keithley 6221 AC and DC Current Source interface.

Usage

Source

devices.keithley:Keithley6221(
    interface,
    **kwargs,
)

Provides methods to control the Keithley 6221 current source for generating waveforms, arbitrary waveforms, constant currents, and performing delta and pulse delta measurements.

Methods

Name Description
__init__() Initialize the Keithley 6221 device.
abort() Abort the emission of the wavelet.
constGo() Turn on output for constant current.
deltaGo() Arm delta mode and run measurement, waiting for the result.
deltaStop() Abort delta mode.
fetchData() Get data trace and return as array.
generateArbWave() Generate an arbitrary waveform and launch it.
generateConstant() Set a constant current output.
generateDelta() Initialize K6221 into delta mode.
generatePulseDelta() Initialize K6221 into pulse delta mode.
generateWave() Generate a waveform signal and launch it.
getConstCurrent() Read current setting (no measurement readback).
pulseGo() Arm pulse mode and run measurement, waiting for the result.
pulseStop() Abort pulse mode.
queryCompliance() Check if compliance limit has been reached.
queryDone() Check if measurement has finished.
setConstCurrent() Set constant current output level.
waveGo() Initialize wave mode and turn on output.

__init__()

Initialize the Keithley 6221 device.

Usage

Source

__init__(
    interface,
    **kwargs,
)

Parameters

interface: str

VISA resource name for the instrument

**kwargs: dict
Additional parameters to pass to the VISA driver. Defaults for write_termination, read_termination, and timeout are provided if not specified.

abort()

Abort the emission of the wavelet.

Usage

Source

abort()

Returns

None

constGo()

Turn on output for constant current.

Usage

Source

constGo()

Returns

None

deltaGo()

Arm delta mode and run measurement, waiting for the result.

Usage

Source

deltaGo()

Returns

None

deltaStop()

Abort delta mode.

Usage

Source

deltaStop()

Returns

None

fetchData()

Get data trace and return as array.

Usage

Source

fetchData(wait=True)

Parameters

wait: bool = True
Whether to wait for measurement completion. Default is True.

Returns

numpy.ndarray
2D array containing the data trace.

generateArbWave()

Generate an arbitrary waveform and launch it.

Usage

Source

generateArbWave(
    points=None,
    amplitude=None,
    frequency=None,
    offset=None,
    dutyCycle=None,
    rangingMode=None,
    durationTime=None,
    durationCycles=None,
    compliance=None,
    reset=True,
)

Note: This function has not been fully tested.

Parameters

points: array_like = None

Points that the current source should set, between -1 and 1, maximum length 65535.

amplitude: float = None

Amplitude of the wavelet in amps, range 2e-12 to 0.105.

frequency: float = None

Frequency of the wavelet in Hz, range 0 to 1e5.

offset: float = None

Offset of the wavelet in amps, range -0.105 to 0.105.

dutyCycle: float = None

Duty cycle for the waveform (if applicable).

rangingMode: str = None

‘best’ automatically selects the best range for the wavelet, ‘fixed’ uses the current range.

durationTime: float = None

Duration of wavelet emission in seconds, range 100e-9 to 999999.999, or -1 for infinity.

durationCycles: float = None

Number of cycles to emit the wavelet, range 0.001 to 99999999900, or -1 for infinity.

compliance: float = None

Compliance level in volts, range 0.1 to 105.

reset: bool = True
Reset the device before configuring the wave. Default is True.

Raises

ValueError
If the points list has fewer than 2 elements or more than 65535 elements.

generateConstant()

Set a constant current output.

Usage

Source

generateConstant(
    amplitude=None,
    autoRanging=None,
    sourceRange=None,
    compliance=None,
    reset=True,
)

Parameters

amplitude: float = None

Current amplitude in amps. Range: -0.105 to 0.105.

autoRanging: bool = None

Whether to enable auto ranging. If True, the measurement range may change while performing measurements.

sourceRange: float = None

The measurement range to use in amps. Range: -0.105 to 0.105. This determines the output current range that will be sourced.

compliance: float = None

The compliance level in volts. Range: 0.1 to 105.

reset: bool = True
Whether to reset the device before setting the current. Default is True.

Returns

None

generateDelta()

Initialize K6221 into delta mode.

Usage

Source

generateDelta(
    i,
    nplc,
    sdel,
    count,
    rang,
    compliance=10,
    comp_abort=True,
    reset=False,
)

Parameters

i: float

Peak pulse current in amps. Range: -0.105 to 0.105.

nplc: int

Resolution on 2182 (integer power line cycles).

sdel: float

Source delay in seconds.

count: int

Count of delta measurements.

rang: str

Range of nanovoltmeter in volts.

compliance: float = 10

Voltage compliance level in volts. Default is 10.

comp_abort: bool = True

Whether to abort on compliance trigger. Default is True.

reset: bool = False
Whether to reset the device before configuring. Default is False.

Returns

None

generatePulseDelta()

Initialize K6221 into pulse delta mode.

Usage

Source

generatePulseDelta(
    ihigh,
    ilow,
    width,
    sdel,
    count,
    rang,
    interval,
    compliance=10,
    sweep="OFF",
    lme=1,
    reset=False,
)

Parameters

ihigh: float

Peak pulse current in amps. Range: -0.105 to 0.105.

ilow: float

Low current (i.e., outside of pulse) in amps. Range: -0.105 to 0.105.

width: float

Pulse width in seconds. Range: 50us to 12ms.

sdel: float

Source delay in seconds.

count: int

Count of pulses.

rang: str

Range setting. Options are “BEST” or “FIX”.

interval: int

Cycle time in PLCs. Range: 5 to 999999.

sweep: str = "OFF"

Sweep mode. Options are “ON” or “OFF”. Default is “OFF”.

compliance: float = 10

Voltage compliance level in volts. Default is 10.

lme: int = 1

Number of low measurements (0 to 2). Default is 1.

reset: bool = False
Whether to reset the device before configuring. Default is False.

Returns

None

generateWave()

Generate a waveform signal and launch it.

Usage

Source

generateWave(
    function="sinusoid",
    dutyCycle=None,
    amplitude=None,
    offset=None,
    frequency=None,
    rangingMode=None,
    durationTime=None,
    durationCycles=None,
    compliance=None,
    reset=True,
)

Parameters

function: str = "sinusoid"

Type of wavelet to generate: ‘sinusoid’, ‘square’, ‘ramp’. Default is ‘sinusoid’.

dutyCycle: float = None

Percentage (0-100) of the amplitude that will be high. The remaining percentage will be low.

amplitude: float = None

Amplitude of the wavelet in amps. Range: 2e-12 to 0.105.

offset: float = None

Offset of the wavelet in amps. Range: -0.105 to 0.105.

frequency: float = None

Frequency of the wavelet in Hz. Range: 0 to 1e5.

rangingMode: str = None

Measurement range selection mode: ‘best’: automatically select the best range for the wavelet ‘fixed’: use the current range for the wavelet

durationTime: float = None

Duration of wavelet emission in seconds. Range: 100e-9 to 999999.999, or -1 for infinity.

durationCycles: float = None

Number of cycles to emit the wavelet. Range: 0.001 to 99999999900, or -1 for infinity.

compliance: float = None

Compliance level in volts. Range: 0.1 to 105.

reset: bool = True
Whether to reset the device before configuring the wave. Default is True.

Returns

None

getConstCurrent()

Read current setting (no measurement readback).

Usage

Source

getConstCurrent()

Returns

float
Current setting in amps.

pulseGo()

Arm pulse mode and run measurement, waiting for the result.

Usage

Source

pulseGo()

Returns

None

pulseStop()

Abort pulse mode.

Usage

Source

pulseStop()

Returns

None

queryCompliance()

Check if compliance limit has been reached.

Usage

Source

queryCompliance()

Returns

bool
True if compliance has been reached, False otherwise.

queryDone()

Check if measurement has finished.

Usage

Source

queryDone()

Returns

bool
True if measurement is complete, False otherwise.

setConstCurrent()

Set constant current output level.

Usage

Source

setConstCurrent(current)

Parameters

current: float
Current level in amps.

Returns

None

waveGo()

Initialize wave mode and turn on output.

Usage

Source

waveGo()

Returns

None