stoner_measurement.instruments.current_source.CurrentSource

class stoner_measurement.instruments.current_source.CurrentSource(transport: BaseTransport, protocol: BaseProtocol)[source]

Bases: BaseInstrument

Abstract base class for precision current-source instruments.

Provides a shared API for DC current level, compliance voltage, and output enable control, with optional AC waveform and balanced-channel extensions advertised via get_capabilities().

configure_arm(source: str = 'IMM', bypass: bool = False, time: float = 0, direction: str = 'ACC', tlink_in: int | None = None, tlink_out: int | None = None, output: str = 'None') → None[source]

Configure the instrument arm layer.

Raises:

NotImplementedError – If arming configuration is not supported by the driver.

configure_custom_sweep(values: tuple[float, ...], *, delay: float = 0.0, count: int = 1) → None[source]

Configure a custom point-by-point current sweep.

Parameters:

values (tuple[float, ...]) – Explicit current values in amps.

Keyword Parameters:
  • delay (float) – Source settling delay between points in seconds.

  • count (int) – Number of sweep repetitions.

Raises:

NotImplementedError – If sweep is not supported. Check get_capabilities().has_sweep before calling.

configure_linear_sweep(start: float, stop: float, points: int, *, delay: float = 0.0, count: int = 1) → None[source]

Configure a linearly spaced current sweep.

Parameters:
  • start (float) – Sweep start current in amps.

  • stop (float) – Sweep stop current in amps.

  • points (int) – Number of sweep points.

Keyword Parameters:
  • delay (float) – Source settling delay between sweep points in seconds.

  • count (int) – Number of sweep repetitions.

Raises:

NotImplementedError – If sweep is not supported. Check get_capabilities().has_sweep before calling.

configure_list_compliance(values: list[float]) → None[source]

Configure per-point compliance values for list sweeps.

Raises:

NotImplementedError – If per-point compliance lists are not supported by the driver.

configure_log_sweep(start: float, stop: float, points: int, *, delay: float = 0.0, count: int = 1) → None[source]

Configure a logarithmically spaced current sweep.

Parameters:
  • start (float) – Sweep start current in amps.

  • stop (float) – Sweep stop current in amps.

  • points (int) – Number of sweep points.

Keyword Parameters:
  • delay (float) – Source settling delay between sweep points in seconds.

  • count (int) – Number of sweep repetitions.

Raises:

NotImplementedError – If sweep is not supported. Check get_capabilities().has_sweep before calling.

configure_pulsed_sweep(sweep: CurrentSweepConfiguration, pulse: PulsedSweepConfiguration) → None[source]

Configure a pulsed current sweep.

Each point in sweep becomes a pulse of duration pulse.width seconds followed by pulse.off_time seconds at pulse.low_level before the next sweep point.

Parameters:
Raises:

NotImplementedError – If pulsed sweep is not supported by the driver. Check get_capabilities().has_pulsed_sweep before calling.

configure_sweep(config: CurrentSweepConfiguration) → None[source]

Configure a built-in current sweep.

Parameters:

config (CurrentSweepConfiguration) – Sweep configuration (spacing, start, stop, points, values, delay, count).

Raises:

NotImplementedError – If sweep is not supported by the driver. Check get_capabilities().has_sweep before calling.

configure_trigger(source: str = 'IMM', bypass: bool = False, direction: str = 'ACC', tlink_in: int | None = None, tlink_out: int | None = None, output: str = 'None') → None[source]

Configure the instrument trigger layer.

Raises:

NotImplementedError – If trigger-layer configuration is not supported by the driver.

Configure hardware trigger-link line routing.

Raises:

NotImplementedError – If trigger-link routing is not supported by the driver.

abstractmethod enable_output(state: bool) → None[source]

Enable or disable source output.

abstractmethod get_capabilities() → CurrentSourceCapabilities[source]

Return the static capability descriptor for this driver.

get_channel_level(channel: int) → float[source]

Return programmed current for a specific output channel.

Raises:

NotImplementedError – If per-channel current control is not supported by the driver.

abstractmethod get_compliance_voltage() → float[source]

Return compliance voltage in volts.

get_frequency() → float[source]

Return AC waveform frequency in Hz.

Raises:

NotImplementedError – If AC frequency control is not supported by the driver.

get_offset_current() → float[source]

Return AC waveform DC offset current in amps.

Raises:

NotImplementedError – If offset-current control is not supported by the driver.

get_operating_status() → int[source]

Read an instrument operating-status register value.

Raises:

NotImplementedError – If operating-status queries are not supported by the driver.

abstractmethod get_source_level() → float[source]

Return programmed source current in amps.

get_waveform() → CurrentWaveform[source]

Return the configured output waveform.

Raises:

NotImplementedError – If waveform selection is not supported by the driver.

abstractmethod output_enabled() → bool[source]

Return True if source output is enabled.

set_channel_level(channel: int, value: float) → None[source]

Set current for a specific output channel.

Raises:

NotImplementedError – If per-channel current control is not supported by the driver.

abstractmethod set_compliance_voltage(value: float) → None[source]

Set compliance voltage in volts.

set_fixed_range(value: float) → None[source]

Set a fixed current range for source output.

Raises:

NotImplementedError – If fixed source range configuration is not supported by the driver.

set_frequency(value: float) → None[source]

Set AC waveform frequency in Hz.

Raises:

NotImplementedError – If AC frequency control is not supported by the driver.

set_offset_current(value: float) → None[source]

Set AC waveform DC offset current in amps.

Raises:

NotImplementedError – If offset-current control is not supported by the driver.

abstractmethod set_source_level(value: float) → None[source]

Set source current in amps.

set_sweep_count(count: int) → None[source]

Set sweep repeat count.

Raises:

NotImplementedError – If sweep repeat count is not supported by the driver.

set_sweep_range_mode(mode: str) → None[source]

Set current-range behaviour during sweeps.

Raises:

NotImplementedError – If sweep range mode is not supported by the driver.

set_waveform(waveform: CurrentWaveform) → None[source]

Set output waveform mode.

Raises:

NotImplementedError – If waveform selection is not supported by the driver.

sweep_abort() → None[source]

Abort a running or armed sweep.

Raises:

NotImplementedError – If sweep is not supported by the driver. Check get_capabilities().has_sweep before calling.

sweep_start() → None[source]

Arm the configured sweep, making it ready for triggering.

Raises:

NotImplementedError – If sweep is not supported by the driver. Check get_capabilities().has_sweep before calling.