Skip to content

Electronic Load¤

Interface¤

Bases: Instrument

Electronic-load instrument. Methods return Measurement/Command for publishing.

Parameters:

  • name ¤

    (str) –

    Channel-name prefix for published data.

  • driver ¤

    (ELoadDriverBase) –

    Concrete E-Load driver; owns its own transport::

    eload = InstroELoad( "main", driver=BK85XXB("ASRL19::INSTR"), )

  • publishers ¤

    (list[Publisher] | None, default: None ) –

    Publishers that receive emitted Measurement/Command data.

  • **kwargs ¤

    Default tags applied to every emitted Measurement/Command. Pass dataset_rid="<rid>" to auto-create a NominalCorePublisher (uses the on-disk 'default' Nominal credential).

name instance-attribute ¤

name = name

legacy_naming instance-attribute ¤

legacy_naming = legacy_naming

publishers instance-attribute ¤

publishers = publishers or []

default_tags instance-attribute ¤

default_tags: dict[str, str] = {}

background_interval property writable ¤

background_interval

Seconds between background daemon iterations (0 = no wait).

background_enable property writable ¤

background_enable

Whether the background daemon is enabled (must still be start()-ed).

add_publisher ¤

add_publisher(publisher: Publisher)

Register a publisher to receive this instrument's Measurement/Command data.

publish ¤

publish(data: Measurement | Command, **kwargs)

Fan data out to every configured publisher; kwargs pass through.

add_background_daemon_function ¤

add_background_daemon_function(method: Callable, *args, **kwargs)

Append method to the daemon's call list. Use define_background_daemon to replace instead.

start ¤

start()

Start the background daemon thread. No-op if already running.

stop ¤

stop()

Signal the background daemon to stop and join it. No-op if not running.

get_channel ¤

get_channel(
    channel_name: str,
    length: int = 1,
    wait_for_latest: bool = False,
    timeout: float = 10.0,
) -> Measurement

Return the most recent length samples for channel_name from the in-memory buffer.

Parameters:

  • channel_name ¤

    (str) –

    Name of the channel to retrieve.

  • length ¤

    (int, default: 1 ) –

    Number of trailing samples to return.

  • wait_for_latest ¤

    (bool, default: False ) –

    Block until at least length new values arrive.

  • timeout ¤

    (float, default: 10.0 ) –

    Seconds to wait when wait_for_latest=True.

Raises:

  • RuntimeError

    No background buffer; start() was not called.

  • ChannelNotFoundTimeoutError

    wait_for_latest=True and channel did not appear within timeout.

  • ChannelValueTimeoutError

    wait_for_latest=True and values did not arrive within timeout.

define_background_daemon ¤

define_background_daemon(method: Callable, *args, **kwargs)

Replace all daemon functions with a single method (called with the given args).

open ¤

open()

Open the underlying driver.

close ¤

close()

Close the underlying driver and stop the daemon.

set_mode ¤

set_mode(mode: LoadMode, channel: int = 1, **kwargs) -> Command

Set the channel's operation mode: CC, CR, CP, or CV. Not all models support every mode.

set_level ¤

set_level(
    value: float,
    channel: int = 1,
    curr_limit: float | None = None,
    **kwargs,
) -> Command

Set the operating level in the active mode's units (CC: A, CV: V, CP: W, CR: Ω).

curr_limit applies only in CV mode. Raises ValueError if no mode has been set.

short_output ¤

short_output(enable: bool, channel: int = 1, **kwargs) -> Command

Enable or disable the channel short.

Warning

Takes effect IMMEDIATELY. enable=True shorts the channel output.

set_range ¤

set_range(value: float, channel: int = 1, **kwargs) -> Command

Set the range from the expected maximum operating value in the active mode's units (CC: A, CV: V, CP: W, CR: Ω).

Raises ValueError if no mode has been set.

set_slewrate ¤

set_slewrate(
    direction: SlewRateDirection,
    rate: float,
    channel: int = 1,
    **kwargs,
) -> Command

Set the per-edge current slew rate (A/μs) for direction (RISE/FALL/BOTH).

output_enable ¤

output_enable(enable: bool, channel: int = 1, **kwargs) -> Command

Enable or disable the output on channel.

get_current ¤

get_current(channel: int = 1, **kwargs) -> Measurement | None

Measure the current (amperes) sensed on channel. Returns None if unavailable.

get_voltage ¤

get_voltage(channel: int = 1, **kwargs) -> Measurement | None

Measure the voltage (volts) sensed on channel. Returns None if unavailable.

Types & Configuration¤

E-Load shared types: LoadMode and SlewRateDirection.

LoadMode ¤

Bases: Enum

CC class-attribute instance-attribute ¤

CC = 'CC'

CR class-attribute instance-attribute ¤

CR = 'CR'

CP class-attribute instance-attribute ¤

CP = 'CP'

CV class-attribute instance-attribute ¤

CV = 'CV'

SlewRateDirection ¤

Bases: Enum

RISE class-attribute instance-attribute ¤

RISE = 'RISE'

FALL class-attribute instance-attribute ¤

FALL = 'FALL'

BOTH class-attribute instance-attribute ¤

BOTH = 'BOTH'

Driver Interface¤

Bases: ABC

Vendor E-Load driver contract. Concrete drivers own their transport and lifecycle.

open abstractmethod ¤

open() -> None

Open the underlying transport and put the load in remote mode.

close abstractmethod ¤

close() -> None

Close the underlying transport. Idempotent.

short_output abstractmethod ¤

short_output(enable: bool, channel: int) -> None

Apply or release the load's short on channel. Takes effect immediately.

set_mode abstractmethod ¤

set_mode(mode: LoadMode, channel: int) -> None

Set the operating mode on channel: CC, CV, CP, or CR.

Not every model supports every mode; drivers should raise NotImplementedError for unsupported combinations.

set_level abstractmethod ¤

set_level(
    mode: LoadMode, value: float, channel: int, curr_limit: float | None
) -> None

Set the operating level on channel in the units appropriate for mode.

Parameters:

  • mode ¤

    (LoadMode) –

    Active load mode — caller passes it explicitly so the driver doesn't need to track state. Units: CC → amperes, CV → volts, CP → watts, CR → ohms.

  • value ¤

    (float) –

    Operating level in mode's units.

  • channel ¤

    (int) –

    Target channel (1-indexed).

  • curr_limit ¤

    (float | None) –

    Optional current limit; only meaningful in CV mode. Drivers may ignore it in other modes.

set_range abstractmethod ¤

set_range(mode: LoadMode, value: float, channel: int) -> None

Set the operating range on channel from the expected maximum.

value is the maximum operating value in mode's units (see :meth:set_level). Drivers typically snap to the closest hardware range that covers value.

set_slewrate abstractmethod ¤

set_slewrate(
    direction: SlewRateDirection, rate: float, channel: int
) -> None

Set the per-edge current slew rate on channel.

Parameters:

  • direction ¤

    (SlewRateDirection) –

    RISE, FALL, or BOTH — which edge(s) the rate applies to.

  • rate ¤

    (float) –

    Slew rate in amperes per microsecond (A/μs).

  • channel ¤

    (int) –

    Target channel (1-indexed).

output_enable abstractmethod ¤

output_enable(enable: bool, channel: int) -> None

Enable or disable load draw on channel.

get_current abstractmethod ¤

get_current(channel: int) -> float

Measure the current the load is sinking on channel (amperes).

get_voltage abstractmethod ¤

get_voltage(channel: int) -> float

Measure the voltage at channel's terminals (volts).

Vendor Drivers¤

BK 85XXB¤

B&K Precision 8500B-series E-Load driver. Covers 8500B/8502B/8510B/8514B/8542B (shared SCPI surface).

Hardware-validated against the 8514B; other family members are expected to work but have not been bench-tested.

BK85XXB ¤

BK85XXB(visa_resource: str | VisaConfig)

Bases: ELoadDriverBase

B&K Precision 8500B-series E-Load (8500B/8502B/8510B/8514B/8542B).

Hardware-validated against the 8514B; others share the SCPI surface but have not been bench-tested.

open ¤
open() -> None
close ¤
close() -> None
short_output ¤
short_output(enable: bool, channel: int) -> None
set_mode ¤
set_mode(mode: LoadMode, channel: int) -> None
set_level ¤
set_level(
    mode: LoadMode, value: float, channel: int, curr_limit: float | None
) -> None
set_range ¤
set_range(mode: LoadMode, value: float, channel: int) -> None
set_slewrate ¤
set_slewrate(
    direction: SlewRateDirection, rate: float, channel: int
) -> None
output_enable ¤
output_enable(enable: bool, channel: int) -> None
get_current ¤
get_current(channel: int) -> float
get_voltage ¤
get_voltage(channel: int) -> float

loadmode_to_unit ¤

loadmode_to_unit(mode: LoadMode) -> str