stoner_measurement.plugins.trace.k6221_2182a.Keithley6221_2182APlugin¶
- class stoner_measurement.plugins.trace.k6221_2182a.Keithley6221_2182APlugin(parent=None)[source]¶
Bases:
TracePluginMeasure an I-V sweep using a Keithley 6221 and 2182A.
Use this plugin for current-driven transport measurements where a Keithley 6221 sources a list of current values and a Keithley 2182A measures the corresponding voltage. It is intended for automated I-V acquisition with hardware-triggered synchronisation between the two instruments.
In the configuration tabs you choose the instrument connection mode, GPIB resources, compliance behaviour, source delay, source range policy, 2182A integration and filtering settings, and trigger-link line assignments. The scan generator defines the current list that will be swept.
The source/instrument tab therefore configures how the 6221 and 2182A are connected and triggered, while the scan tab defines the current points. The compliance controls select either a direct voltage limit or a resistance- based derived limit. Additional controls configure the 2182A integration time, voltage range, digital and analogue filtering, relative mode, and digit count. The Help/About tab uses this docstring to explain how those settings map to the automated I-V measurement.
The result is a single trace channel named IV. Besides the measured voltage, the plugin also derives resistance and power columns for convenience. An optional, independently connected nanovoltmeter can buffer the same sweep and add a second prefixed V/R/P column set. Both meters use external trigger input. They may be wired in parallel, with the primary returning the meter-complete handshake, or daisy-chained so the primary triggers the secondary and the secondary advances the 6221.
For more technical use, the 6221 is programmed with the full current list derived from the active scan generator and trigger-link handshaking keeps the source and voltmeter synchronised. After acquisition, a single trace channel named
"IV"is returned, backed by aDataFramewith:x (data column) — programmed source current in amps.
V (
COLUMN_ROLE_Y) — measured voltage in volts.R (
COLUMN_ROLE_Z) — resistance V/I in ohms (float("nan")when I is effectively zero).P (
COLUMN_ROLE_Z) — power I×V in watts.
These columns describe ordinary I-V mode. The Primary 6221 / 2182A settings page also offers Differential mode, Delta current and a resistance/conductance choice. Differential acquisition alternates positive and negative delta-current offsets about nominal scan currents. It requires at least three points and a positive delta current. The x column retains nominal current; V is reduced from neighbouring readings, R becomes differential resistance (or G for conductance), and P is delta current times the reduced voltage change. Secondary results use the same reduction when enabled.
Plot and transform channel selectors expose the full configured IV schema before acquisition, including enabled secondary channels and the R/G choice.
configured_trace_data()returns these empty schemas by trace identifier.Secondary nanovoltmeter selects its driver, GPIB resource, result prefix, parallel/daisy-chain triggering and driver-supported integration, range, filtering and relative-mode settings.
- Variables:
_differential_mode (bool) – Enable alternating delta-current acquisition; defaults to False.
_delta_current (float | str) – Positive modulation current in amperes or runtime expression.
_differential_conductance (bool) – Report differential conductance instead of resistance.
_secondary_enabled (bool) – Enable the independently connected secondary nanovoltmeter.
_secondary_driver (str) – Secondary driver identifier: keithley_182 or keithley_2182a.
_secondary_resource (str) – Secondary meter VISA/GPIB resource.
_secondary_prefix (str) – Prefix applied to secondary result columns.
_secondary_trigger_mode (SecondaryTriggerMode) – PARALLEL or DAISY_CHAIN trigger wiring and timing policy.
_6221_resource (str) – VISA resource string for the Keithley 6221 (e.g.
"GPIB0::22::INSTR")._2182a_resource (str) – VISA resource string for the Keithley 2182A, used only in
DIRECT_GPIBmode (e.g."GPIB0::7::INSTR")._connection_mode (ConnectionMode) – Whether the 2182A is reached via 6221 serial relay or its own GPIB connection.
_compliance_mode (ComplianceMode) – Whether the compliance limit is expressed as a fixed voltage or as a resistance (per-point voltage =
|I| × compliance_resistance)._compliance (float) – Compliance voltage in volts when
_compliance_modeisVOLTAGE._compliance_resistance (float) – Compliance resistance in ohms when
_compliance_modeisRESISTANCE._source_delay (float) – Source settling delay between output change and trigger to 2182A, in seconds.
_source_range_mode (SourceRangeMode) – How the 6221 output range is selected during the sweep.
_source_range (float) – Fixed current range in amps, used when
_source_range_modeisFIXED._nplc (float) – 2182A integration time in power-line cycles. Valid values are
0.1,1.0, and10.0._voltage_range (float) – Fixed voltage range in volts for the 2182A. Set to
0.0for autorange._filter_type (DigitalFilterType) – Disabled, repeating, or moving-window digital filtering.
_filter_count (int) – Number of readings averaged by the 2182A digital filter.
_trigger_delay (float) – Delay between the external trigger and the 2182A conversion.
_line_sync (bool) – Synchronise 2182A A/D conversions to the power line.
_autozero (bool) – Enable automatic zero-reference measurements on the 2182A.
_analog_filter (bool) – Enable the 2182A low-pass analogue filter.
_relative_enabled (bool) – Enable the 2182A relative (REL) subtraction mode.
_relative_value (float) – Voltage reference subtracted while relative mode is enabled.
_digits (int) – Number of display and data digits for the 2182A (4–8).
_output_tlink (int) – Trigger-link line number (1–6) on which the 6221 outputs the “source ready” trigger pulse to the 2182A.
_input_tlink (int) – Trigger-link line number (1–6) on which the 6221 accepts the “meter complete” trigger pulse from the 2182A.
instance_name (str) – Inherited Python identifier for this instance in the Script tab and QtConsole.
comment (str) – Inherited optional note displayed beside this step.
sequence_engine (SequenceEngine | None) – Inherited owning engine and its live namespace; None while detached.
scan_generator (BaseScanGenerator) – Inherited generator defining acquisition source values.
data (dict[str, TraceData]) – Inherited latest trace tables, keyed by trace name; inspect each table through its df attribute.
status (TraceStatus) – Inherited acquisition status, including data availability and errors.
- Keyword Parameters:
parent (QObject | None) – Optional Qt parent object.
Examples
With an instance named
k6221_dc_ivin the sequence, use the QtConsole to inspect or edit it before running. Substitute your instance name if different; result data reflects completed steps:k6221_dc_iv._compliance = 5.0 k6221_dc_iv._source_delay = 0.01 k6221_dc_iv.data
- configure() None[source]¶
Program the complete sweep into the 6221 and configure the 2182A.
Reads the full list of source current values from the active scan generator and loads them as a
LISTsweep into the 6221. The 2182A trace buffer is sized to match the point count and trigger-link handshaking is configured so that:The 6221 outputs a trigger pulse on
_output_tlinkafter each source step and settling delay.The 6221 advances to the next point when it receives a trigger on
_input_tlink.The 2182A triggers on the external input (trigger-link line
_output_tlink) and asserts meter-complete on_input_tlink.
Compliance is programmed as per-point values: in
VOLTAGEmode every point uses_compliance; inRESISTANCEmode each per-point voltage equals|I| × _compliance_resistance.Measurement settings (NPLC, voltage range, trigger delay, line sync, autozero, digital filter, analogue filter, relative mode, and digits) are also applied to the 2182A. Once configuration completes successfully, the 6221 output is enabled and left on so successive
measure()calls can start fresh sweeps without reconfiguration. The output is disabled indisconnect().- Raises:
RuntimeError – If not connected (call
connect()first).ValueError – If the scan generator produces no points.
Examples
>>> from qtpy.QtWidgets import QApplication >>> _ = QApplication.instance() or QApplication([]) >>> plugin = Keithley6221_2182APlugin() >>> # plugin.connect(); plugin.configure() # requires real hardware
- connect() None[source]¶
Open connections to the 6221 and, in direct mode, the 2182A.
Opens a GPIB connection to the 6221 using
_6221_resource. When_connection_modeisDIRECT_GPIBa second GPIB connection is opened to the 2182A using_2182a_resource.- Raises:
ConnectionError – If either instrument cannot be reached.
RuntimeError – If the 6221 identity string does not contain
"6221".
Examples
>>> from qtpy.QtWidgets import QApplication >>> _ = QApplication.instance() or QApplication([]) >>> plugin = Keithley6221_2182APlugin() >>> # plugin.connect() # requires real hardware
- declared_outputs() PluginOutputs[source]¶
Declare IV channels, schemas and optional column statistics together.
- disconnect() None[source]¶
Disable the 6221 output and close all instrument connections.
Always attempts to disable the 6221 output before closing connections, even if a previous operation failed.
Examples
>>> from qtpy.QtWidgets import QApplication >>> _ = QApplication.instance() or QApplication([]) >>> plugin = Keithley6221_2182APlugin() >>> plugin.disconnect() >>> plugin.status is TraceStatus.IDLE True
- property name: str¶
Unique identifier for the Keithley 6221 / 2182A plugin.
- Returns:
"k6221_dc_iv".- Return type:
(str)
Examples
>>> from qtpy.QtWidgets import QApplication >>> _ = QApplication.instance() or QApplication([]) >>> Keithley6221_2182APlugin().name 'k6221_dc_iv'
- to_json() dict[str, Any][source]¶
Serialise the plugin configuration to a JSON-compatible dict.
Extends the base
to_json()dict with all instrument and measurement settings.Examples
>>> from qtpy.QtWidgets import QApplication >>> _ = QApplication.instance() or QApplication([]) >>> plugin = Keithley6221_2182APlugin() >>> d = plugin.to_json() >>> d["compliance"] 10.0 >>> d["connection_mode"] 'via_6221_serial'
- property x_label: str¶
Axis label for the source current.
- Returns:
"I".- Return type:
(str)
Examples
>>> from qtpy.QtWidgets import QApplication >>> _ = QApplication.instance() or QApplication([]) >>> Keithley6221_2182APlugin().x_label 'I'
- property x_units: str¶
Physical units for the source current axis.
- Returns:
"A".- Return type:
(str)
Examples
>>> from qtpy.QtWidgets import QApplication >>> _ = QApplication.instance() or QApplication([]) >>> Keithley6221_2182APlugin().x_units 'A'