stoner_measurement.plugins.command.read_electrometer.ReadElectrometerCommand¶
- class stoner_measurement.plugins.command.read_electrometer.ReadElectrometerCommand(parent=None)[source]¶
Bases:
CommandPluginTake one fresh Keithley electrometer or picoammeter reading.
Use Read Electrometer inside a scan or after a set command to acquire one scalar measurement. Choose a Keithley 6485, 6514 or 6517 and its GPIB resource on General. The 6485 measures current; the 6514 and 6517 can instead measure voltage, resistance or charge. Each execution measures only the selected function and publishes Current, Voltage, Resistance or Charge, in A, V, Ω or C respectively. These outputs can be selected for scan data collection, Plot Points, Save or later expressions. The latest result is also available as
instance.value.The General page provides autorange or a fixed input range in the selected function’s SI unit, integration time in power-line cycles (NPLC), digital averaging and its count, zero check, trigger delay and communication timeout in seconds. Fixed range, NPLC, delay and timeout accept expressions evaluated at configuration time in the engine namespace. A filter may average several conversions into the single returned reading. Zero check is off by default; enabling it measures the zero-checked input.
The plugin owns its connection. Sequence startup connects and configures it; repeated executions trigger fresh readings without reconnecting. Immediate triggering, one trigger and one arm are configured automatically, and buffer storage is disabled. No external trigger wiring is required. Sequence cleanup aborts and closes the session, leaving the latest result available for inspection. A failed execution clears that result to NaN. Reconfigure can defer setup until the command is reached. About describes these settings and outputs.
- Variables:
driver (str) – Driver identifier:
keithley_6485(default),keithley_6514orkeithley_6517.resource (str) – VISA/GPIB resource, initially
GPIB0::14::INSTR.function (str) – Measurement function:
CURR(default),VOLT,RESorCHAR. Available choices depend on the selected meter.autorange (bool) – Whether to select the input range automatically; initially True.
input_range (float | str) – Fixed range or runtime expression in the selected SI unit; ignored when autorange is enabled.
nplc (float | str) – Integration time or expression in power-line cycles, 0.01 to 10; initially 1.0.
filter_enabled (bool) – Whether to enable digital averaging; initially False.
filter_count (int) – Number of averaging conversions, 1 to 100; initially 10.
zero_check (bool) – Whether to enable input zero check; initially False.
trigger_delay (float | str) – Delay or expression before conversion in seconds; initially zero.
timeout (float | str) – Communication timeout or expression in seconds; initially 30.
value (float) – Latest reading in the selected SI unit, initially NaN. Not saved as configuration.
instance_name (str) – Inherited Python identifier in the Script tab and QtConsole.
comment (str) – Inherited optional sequence-step note.
sequence_engine (SequenceEngine | None) – Inherited engine and its live expression namespace.
has_lifecycle (bool) – True: this command participates in sequence connection and cleanup.
- Keyword Parameters:
parent (QObject | None) – Optional Qt parent object.
Examples
With an existing instance named
read_electrometer, edit settings before running the sequence. Results reflect the latest execution:read_electrometer.driver = "keithley_6514" read_electrometer.function = "VOLT" read_electrometer.nplc = "integration_cycles" read_electrometer.value read_electrometer.reported_value_units()
- config_widget(parent=None) QWidget[source]¶
Build the top-packed single-reading connection and input settings.
- 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