stoner_measurement.plugins.command.read_multimeter.ReadMultimeterCommand¶
- class stoner_measurement.plugins.command.read_multimeter.ReadMultimeterCommand(parent=None)[source]¶
Bases:
CommandPluginTake one fresh reading from a Keithley 2000 or 2700 multimeter.
Add Keithleys → Read Multimeter beneath a scan or after a set command. General selects the model, GPIB resource and measurement function: DC or AC voltage/current, two- or four-wire resistance, frequency, period or temperature. The selected reading is a scalar output with its SI unit, also available as
instance.value. Temperature uses kelvin and the instrument’s existing temperature sensor configuration.General also provides range/autorange, integration in power-line cycles, averaging enable/count/type, AC bandwidth, frequency/period gate time, trigger delay and communication timeout. Controls follow the function: temperature has no manual range, frequency/period use gate time rather than NPLC or averaging, and AC NPLC applies only at 300 Hz bandwidth. Numeric expressions are evaluated at configuration time; inactive controls are ignored. Averaging can combine conversions into the one returned reading. Immediate triggering and a sample count of one are automatic.
Each execution also publishes the applicable numeric Range, Autorange, NPLC, Filter Enabled, Filter Count, Filter Type, AC Bandwidth, Gate Time, Trigger Delay and Timeout outputs. Settings are queried after the measurement, so Range follows autoranging. Filter Type is 0 for repeating and 1 for moving; booleans are 0 or 1. Timeout is the local transport timeout. Settings and readings can be used by scan data collection, Plot Points, Save and downstream expressions.
The plugin owns its session: startup connects/configures, every execution requests a fresh conversion, and cleanup aborts/closes the connection. Successful cleanup retains the last reading and settings; a failed read clears them. Reconfigure may defer setup. The 2700 is used only as a multimeter with its currently selected input terminals. No reset, relay, route, scan-list or channel-list commands are sent. Put it in ordinary DMM mode before use; scanner/switching support is deferred. About documents these controls and outputs.
- Variables:
driver (str) –
keithley_2000(default) orkeithley_2700.resource (str) – GPIB resource, initially
GPIB0::16::INSTR.function (str) – SCPI measurement function, initially
VOLT:DC.autorange (bool) – Automatic range selection, initially True.
input_range (float | str) – Fixed range in the function’s SI unit, or expression.
nplc (float | str) – Integration in PLC, 0.01..10; initially 1.0.
filter_enabled (bool) – Whether to average conversions, initially False.
filter_count (int) – Averaging count, 1..100; initially 10.
filter_type (str) –
REP(repeating, default) orMOV(moving).ac_bandwidth (float) – AC lower bandwidth in Hz: 3, 30 or 300 (default).
gate_time (float | str) – Frequency/period gate time in seconds, 0.01..1; initially 0.1.
trigger_delay (float | str) – Conversion delay in seconds, initially zero.
timeout (float | str) – Communication timeout in seconds, initially 30.
value (float) – Last reading, initially NaN; not persisted.
settings_readback (dict[str, float]) – Queried numeric settings from the last execution, not persisted.
instance_name (str) – Inherited Python identifier in scripts and QtConsole.
comment (str) – Inherited optional step note.
sequence_engine (SequenceEngine | None) – Inherited owning engine and live expression namespace.
has_lifecycle (bool) – True: sequence setup and cleanup manage this session.
- Keyword Parameters:
parent (QObject | None) – Optional Qt parent object.
Examples
With an existing sequence instance named
read_multimeter, edit settings before running and inspect the last completed reading:read_multimeter.driver = "keithley_2700" read_multimeter.function = "FRES" read_multimeter.nplc = "integration_cycles" read_multimeter.value read_multimeter.settings_readback
- configure() None[source]¶
Resolve runtime settings and configure one reading without scanner control.
- declared_outputs() PluginOutputs[source]¶
Declare configured outputs and their physical units together.
- property has_lifecycle: bool¶
Command plugins have no instrument lifecycle.
- Returns:
Always
False. The sequence engine therefore omitsconnect(),configure(), anddisconnect()calls for this plugin when generating sequence code.- Return type:
(bool)
Examples
>>> from qtpy.QtWidgets import QApplication >>> _ = QApplication.instance() or QApplication([]) >>> from stoner_measurement.plugins.command import CommandPlugin >>> class _Noop(CommandPlugin): ... @property ... def name(self): return "Noop" ... def execute(self): pass >>> _Noop().has_lifecycle False