Skip to content

PSU (Power Supply Unit)¤

Interface¤

Bases: Instrument

Power-supply instrument. Methods return Measurement/Command for publishing.

Parameters:

  • name ¤

    (str) –

    Channel-name prefix for published data.

  • driver ¤

    (PSUDriverBase) –

    Concrete PSU driver; owns its own transport::

    psu = InstroPSU( name="main", driver=BK9115("USB0::0xFFFF::0x9115::SN::INSTR"), num_channels=1, )

  • num_channels ¤

    (int) –

    Number of output channels on this PSU.

  • 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()

Establish connection to the device.

close ¤

close()

Disconnect from the device.

set_voltage ¤

set_voltage(voltage: float, channel: int = 1, **kwargs) -> Command

Set the output voltage (volts) on channel.

get_voltage ¤

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

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

set_current_limit ¤

set_current_limit(
    current_limit: float, channel: int = 1, **kwargs
) -> Command

Set the current limit (amperes) on channel.

get_current ¤

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

Measure the current (amperes) flowing through channel. Returns None if unavailable.

output_enable ¤

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

Enable or disable the output on channel.

get_output_status ¤

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

Query whether the output on channel is enabled. Returns None if unavailable.

set_overvoltage_protection_level ¤

set_overvoltage_protection_level(
    voltage: float, channel: int = 1, **kwargs
) -> Command

Set the overvoltage protection threshold (volts) on channel.

get_overvoltage_protection_level ¤

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

Query the overvoltage protection threshold (volts) on channel. Returns None if unavailable.

set_overvoltage_protection_enabled ¤

set_overvoltage_protection_enabled(
    enabled: bool, channel: int = 1, **kwargs
) -> Command

Enable or disable overvoltage protection on channel.

get_overvoltage_protection_enabled ¤

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

Query whether overvoltage protection is enabled on channel. Returns None if unavailable.

set_overvoltage_protection_delay ¤

set_overvoltage_protection_delay(
    delay: float, channel: int = 1, **kwargs
) -> Command

Set the overvoltage protection trip delay (seconds) on channel.

get_overvoltage_protection_delay ¤

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

Query the overvoltage protection trip delay (seconds) on channel. Returns None if unavailable.

set_overcurrent_protection_level ¤

set_overcurrent_protection_level(
    current: float, channel: int = 1, **kwargs
) -> Command

Set the overcurrent protection threshold (amperes) on channel.

get_overcurrent_protection_level ¤

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

Query the overcurrent protection threshold (amperes) on channel. Returns None if unavailable.

set_overcurrent_protection_enabled ¤

set_overcurrent_protection_enabled(
    enabled: bool, channel: int = 1, **kwargs
) -> Command

Enable or disable overcurrent protection on channel.

get_overcurrent_protection_enabled ¤

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

Query whether overcurrent protection is enabled on channel. Returns None if unavailable.

set_remote_sense_enabled ¤

set_remote_sense_enabled(
    enabled: bool, channel: int = 1, **kwargs
) -> Command

Enable or disable remote sense on channel.

get_remote_sense_enabled ¤

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

Query whether remote sense is enabled on channel. Returns None if unavailable.

Driver Interface¤

Bases: ABC

Base class for PSU drivers.

open abstractmethod ¤

open() -> None

Open the driver's underlying transport.

close abstractmethod ¤

close() -> None

Close the driver's underlying transport.

set_voltage abstractmethod ¤

set_voltage(voltage: float, channel: int) -> None

Set the output voltage (volts) on channel.

get_voltage abstractmethod ¤

get_voltage(channel: int) -> float

Query the measured output voltage (volts) on channel.

set_current_limit abstractmethod ¤

set_current_limit(current_limit: float, channel: int) -> None

Set the current limit (amperes) on channel.

get_current abstractmethod ¤

get_current(channel: int) -> float

Query the measured output current (amperes) on channel.

output_enable abstractmethod ¤

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

Enable or disable the output on channel.

get_output_status abstractmethod ¤

get_output_status(channel: int) -> bool

Query whether the output on channel is enabled.

set_overvoltage_protection_level ¤

set_overvoltage_protection_level(
    voltage: float, channel: int = 1
) -> None

Set the overvoltage protection threshold (volts) on channel.

get_overvoltage_protection_level ¤

get_overvoltage_protection_level(channel: int = 1) -> float

Query the overvoltage protection threshold (volts) on channel.

set_overvoltage_protection_enabled ¤

set_overvoltage_protection_enabled(
    enabled: bool, channel: int = 1
) -> None

Enable or disable overvoltage protection on channel.

get_overvoltage_protection_enabled ¤

get_overvoltage_protection_enabled(channel: int = 1) -> bool

Query whether overvoltage protection is enabled on channel.

set_overvoltage_protection_delay ¤

set_overvoltage_protection_delay(
    delay: float, channel: int = 1
) -> None

Set the overvoltage protection trip delay (seconds) on channel.

get_overvoltage_protection_delay ¤

get_overvoltage_protection_delay(channel: int = 1) -> float

Query the overvoltage protection trip delay (seconds) on channel.

set_overcurrent_protection_level ¤

set_overcurrent_protection_level(
    current: float, channel: int = 1
) -> None

Set the overcurrent protection threshold (amperes) on channel.

get_overcurrent_protection_level ¤

get_overcurrent_protection_level(channel: int = 1) -> float

Query the overcurrent protection threshold (amperes) on channel.

set_overcurrent_protection_enabled ¤

set_overcurrent_protection_enabled(
    enabled: bool, channel: int = 1
) -> None

Enable or disable overcurrent protection on channel.

get_overcurrent_protection_enabled ¤

get_overcurrent_protection_enabled(channel: int = 1) -> bool

Query whether overcurrent protection is enabled on channel.

set_remote_sense_enabled ¤

set_remote_sense_enabled(enabled: bool, channel: int = 1) -> None

Enable or disable remote sense on channel.

get_remote_sense_enabled ¤

get_remote_sense_enabled(channel: int = 1) -> bool

Query whether remote sense is enabled on channel.

Vendor Drivers¤

BK Precision 9115 (Single Channel)¤

B&K Precision 9115-series PSU driver. SCPI surface is shared with other single-channel B&K models.

BK9115 ¤

BK9115(visa_resource: str | VisaConfig)

Bases: PSUDriverBase

B&K Precision 9115-series single-channel PSU.

open ¤
open() -> None
close ¤
close() -> None
set_voltage ¤
set_voltage(voltage: float, channel: int = 1) -> None
get_voltage ¤
get_voltage(channel: int = 1) -> float
set_current_limit ¤
set_current_limit(current_limit: float, channel: int = 1) -> None
get_current ¤
get_current(channel: int = 1) -> float
output_enable ¤
output_enable(enable: bool, channel: int = 1) -> None
get_output_status ¤
get_output_status(channel: int = 1) -> bool
set_overcurrent_protection_level ¤
set_overcurrent_protection_level(
    current: float, channel: int = 1
) -> None
get_overcurrent_protection_level ¤
get_overcurrent_protection_level(channel: int = 1) -> float
set_overcurrent_protection_enabled ¤
set_overcurrent_protection_enabled(
    enabled: bool, channel: int = 1
) -> None
get_overcurrent_protection_enabled ¤
get_overcurrent_protection_enabled(channel: int = 1) -> bool
set_remote_sense_enabled ¤
set_remote_sense_enabled(enabled: bool, channel: int = 1) -> None
get_remote_sense_enabled ¤
get_remote_sense_enabled(channel: int = 1) -> bool
set_overvoltage_protection_level ¤
set_overvoltage_protection_level(
    voltage: float, channel: int = 1
) -> None

Set the overvoltage protection threshold (volts) on channel.

get_overvoltage_protection_level ¤
get_overvoltage_protection_level(channel: int = 1) -> float

Query the overvoltage protection threshold (volts) on channel.

set_overvoltage_protection_enabled ¤
set_overvoltage_protection_enabled(
    enabled: bool, channel: int = 1
) -> None

Enable or disable overvoltage protection on channel.

get_overvoltage_protection_enabled ¤
get_overvoltage_protection_enabled(channel: int = 1) -> bool

Query whether overvoltage protection is enabled on channel.

set_overvoltage_protection_delay ¤
set_overvoltage_protection_delay(
    delay: float, channel: int = 1
) -> None

Set the overvoltage protection trip delay (seconds) on channel.

get_overvoltage_protection_delay ¤
get_overvoltage_protection_delay(channel: int = 1) -> float

Query the overvoltage protection trip delay (seconds) on channel.

BK Precision 9140 (Multi Channel)¤

B&K Precision 9140-series PSU driver. SCPI surface is shared with other multi-channel B&K models.

BK9140 ¤

BK9140(visa_resource: str | VisaConfig)

Bases: PSUDriverBase

B&K Precision 9140-series multi-channel PSU.

open ¤
open() -> None
close ¤
close() -> None
set_voltage ¤
set_voltage(voltage: float, channel: int = 1) -> None
get_voltage ¤
get_voltage(channel: int = 1) -> float
set_current_limit ¤
set_current_limit(current_limit: float, channel: int = 1) -> None
get_current ¤
get_current(channel: int = 1) -> float
output_enable ¤
output_enable(enable: bool, channel: int = 1) -> None
get_output_status ¤
get_output_status(channel: int = 1) -> bool
set_overvoltage_protection_level ¤
set_overvoltage_protection_level(
    voltage: float, channel: int = 1
) -> None

Set the overvoltage protection threshold (volts) on channel.

get_overvoltage_protection_level ¤
get_overvoltage_protection_level(channel: int = 1) -> float

Query the overvoltage protection threshold (volts) on channel.

set_overvoltage_protection_enabled ¤
set_overvoltage_protection_enabled(
    enabled: bool, channel: int = 1
) -> None

Enable or disable overvoltage protection on channel.

get_overvoltage_protection_enabled ¤
get_overvoltage_protection_enabled(channel: int = 1) -> bool

Query whether overvoltage protection is enabled on channel.

set_overvoltage_protection_delay ¤
set_overvoltage_protection_delay(
    delay: float, channel: int = 1
) -> None

Set the overvoltage protection trip delay (seconds) on channel.

get_overvoltage_protection_delay ¤
get_overvoltage_protection_delay(channel: int = 1) -> float

Query the overvoltage protection trip delay (seconds) on channel.

set_overcurrent_protection_level ¤
set_overcurrent_protection_level(
    current: float, channel: int = 1
) -> None

Set the overcurrent protection threshold (amperes) on channel.

get_overcurrent_protection_level ¤
get_overcurrent_protection_level(channel: int = 1) -> float

Query the overcurrent protection threshold (amperes) on channel.

set_overcurrent_protection_enabled ¤
set_overcurrent_protection_enabled(
    enabled: bool, channel: int = 1
) -> None

Enable or disable overcurrent protection on channel.

get_overcurrent_protection_enabled ¤
get_overcurrent_protection_enabled(channel: int = 1) -> bool

Query whether overcurrent protection is enabled on channel.

set_remote_sense_enabled ¤
set_remote_sense_enabled(enabled: bool, channel: int = 1) -> None

Enable or disable remote sense on channel.

get_remote_sense_enabled ¤
get_remote_sense_enabled(channel: int = 1) -> bool

Query whether remote sense is enabled on channel.

Rigol DP800¤

Rigol DP800-series PSU driver. Covers DP811, DP821, DP831, DP832.

RigolDP800 ¤

RigolDP800(visa_resource: str | VisaConfig)

Bases: PSUDriverBase

Rigol DP800-series multi-channel PSU (DP811/DP821/DP831/DP832).

idn instance-attribute ¤
idn = ''
open ¤
open() -> None
close ¤
close() -> None
set_voltage ¤
set_voltage(voltage: float, channel: int = 1) -> None
get_voltage ¤
get_voltage(channel: int = 1) -> float
set_current_limit ¤
set_current_limit(current_limit: float, channel: int = 1) -> None
get_current ¤
get_current(channel: int = 1) -> float
output_enable ¤
output_enable(enable: bool, channel: int = 1) -> None
get_output_status ¤
get_output_status(channel: int = 1) -> bool
query_status ¤
query_status() -> dict

Query the status of the PSU (output enable, regulation mode, OVP/OCP flags).

set_overvoltage_protection_level ¤
set_overvoltage_protection_level(
    voltage: float, channel: int = 1
) -> None

Set the overvoltage protection threshold (volts) on channel.

get_overvoltage_protection_level ¤
get_overvoltage_protection_level(channel: int = 1) -> float

Query the overvoltage protection threshold (volts) on channel.

set_overvoltage_protection_enabled ¤
set_overvoltage_protection_enabled(
    enabled: bool, channel: int = 1
) -> None

Enable or disable overvoltage protection on channel.

get_overvoltage_protection_enabled ¤
get_overvoltage_protection_enabled(channel: int = 1) -> bool

Query whether overvoltage protection is enabled on channel.

set_overvoltage_protection_delay ¤
set_overvoltage_protection_delay(
    delay: float, channel: int = 1
) -> None

Set the overvoltage protection trip delay (seconds) on channel.

get_overvoltage_protection_delay ¤
get_overvoltage_protection_delay(channel: int = 1) -> float

Query the overvoltage protection trip delay (seconds) on channel.

set_overcurrent_protection_level ¤
set_overcurrent_protection_level(
    current: float, channel: int = 1
) -> None

Set the overcurrent protection threshold (amperes) on channel.

get_overcurrent_protection_level ¤
get_overcurrent_protection_level(channel: int = 1) -> float

Query the overcurrent protection threshold (amperes) on channel.

set_overcurrent_protection_enabled ¤
set_overcurrent_protection_enabled(
    enabled: bool, channel: int = 1
) -> None

Enable or disable overcurrent protection on channel.

get_overcurrent_protection_enabled ¤
get_overcurrent_protection_enabled(channel: int = 1) -> bool

Query whether overcurrent protection is enabled on channel.

set_remote_sense_enabled ¤
set_remote_sense_enabled(enabled: bool, channel: int = 1) -> None

Enable or disable remote sense on channel.

get_remote_sense_enabled ¤
get_remote_sense_enabled(channel: int = 1) -> bool

Query whether remote sense is enabled on channel.

Siglent SPD3303¤

Siglent SPD3303-series PSU driver.

SiglentSPD3303 ¤

SiglentSPD3303(visa_resource: str | VisaConfig)

Bases: PSUDriverBase

Siglent SPD3303-series PSU.

open ¤
open() -> None
close ¤
close() -> None
set_voltage ¤
set_voltage(voltage: float, channel: int = 1) -> None
get_voltage ¤
get_voltage(channel: int = 1) -> float
set_current_limit ¤
set_current_limit(current_limit: float, channel: int = 1) -> None
get_current ¤
get_current(channel: int = 1) -> float
output_enable ¤
output_enable(enable: bool, channel: int = 1) -> None
get_output_status ¤
get_output_status(channel: int = 1) -> bool
set_overvoltage_protection_level ¤
set_overvoltage_protection_level(
    voltage: float, channel: int = 1
) -> None
get_overvoltage_protection_level ¤
get_overvoltage_protection_level(channel: int = 1) -> float
set_overcurrent_protection_level ¤
set_overcurrent_protection_level(
    current: float, channel: int = 1
) -> None
get_overcurrent_protection_level ¤
get_overcurrent_protection_level(channel: int = 1) -> float
set_overcurrent_protection_enabled ¤
set_overcurrent_protection_enabled(
    enabled: bool, channel: int = 1
) -> None
get_overcurrent_protection_enabled ¤
get_overcurrent_protection_enabled(channel: int = 1) -> bool
set_remote_sense_enabled ¤
set_remote_sense_enabled(enabled: bool, channel: int = 1) -> None
get_remote_sense_enabled ¤
get_remote_sense_enabled(channel: int = 1) -> bool
query_status ¤
query_status() -> dict

Query the status of the PSU (per-channel mode/enable + tracking mode).

set_overvoltage_protection_enabled ¤
set_overvoltage_protection_enabled(
    enabled: bool, channel: int = 1
) -> None

Enable or disable overvoltage protection on channel.

get_overvoltage_protection_enabled ¤
get_overvoltage_protection_enabled(channel: int = 1) -> bool

Query whether overvoltage protection is enabled on channel.

set_overvoltage_protection_delay ¤
set_overvoltage_protection_delay(
    delay: float, channel: int = 1
) -> None

Set the overvoltage protection trip delay (seconds) on channel.

get_overvoltage_protection_delay ¤
get_overvoltage_protection_delay(channel: int = 1) -> float

Query the overvoltage protection trip delay (seconds) on channel.

TDK Lambda Genesys¤

TDK Lambda Genesys-family PSU driver (single-channel).

TDKLambdaGenesys ¤

TDKLambdaGenesys(visa_resource: str | VisaConfig)

Bases: PSUDriverBase

TDK Lambda Genesys-family single-channel PSU.

open ¤
open() -> None
close ¤
close() -> None
set_voltage ¤
set_voltage(voltage: float, channel: int = 1) -> None
get_voltage ¤
get_voltage(channel: int = 1) -> float
set_current_limit ¤
set_current_limit(current_limit: float, channel: int = 1) -> None
get_current ¤
get_current(channel: int = 1) -> float
output_enable ¤
output_enable(enable: bool, channel: int = 1) -> None
get_output_status ¤
get_output_status(channel: int = 1) -> bool
set_overvoltage_protection_level ¤
set_overvoltage_protection_level(
    voltage: float, channel: int = 1
) -> None

Set the overvoltage protection threshold (volts) on channel.

get_overvoltage_protection_level ¤
get_overvoltage_protection_level(channel: int = 1) -> float

Query the overvoltage protection threshold (volts) on channel.

set_overvoltage_protection_enabled ¤
set_overvoltage_protection_enabled(
    enabled: bool, channel: int = 1
) -> None

Enable or disable overvoltage protection on channel.

get_overvoltage_protection_enabled ¤
get_overvoltage_protection_enabled(channel: int = 1) -> bool

Query whether overvoltage protection is enabled on channel.

set_overvoltage_protection_delay ¤
set_overvoltage_protection_delay(
    delay: float, channel: int = 1
) -> None

Set the overvoltage protection trip delay (seconds) on channel.

get_overvoltage_protection_delay ¤
get_overvoltage_protection_delay(channel: int = 1) -> float

Query the overvoltage protection trip delay (seconds) on channel.

set_overcurrent_protection_level ¤
set_overcurrent_protection_level(
    current: float, channel: int = 1
) -> None

Set the overcurrent protection threshold (amperes) on channel.

get_overcurrent_protection_level ¤
get_overcurrent_protection_level(channel: int = 1) -> float

Query the overcurrent protection threshold (amperes) on channel.

set_overcurrent_protection_enabled ¤
set_overcurrent_protection_enabled(
    enabled: bool, channel: int = 1
) -> None

Enable or disable overcurrent protection on channel.

get_overcurrent_protection_enabled ¤
get_overcurrent_protection_enabled(channel: int = 1) -> bool

Query whether overcurrent protection is enabled on channel.

set_remote_sense_enabled ¤
set_remote_sense_enabled(enabled: bool, channel: int = 1) -> None

Enable or disable remote sense on channel.

get_remote_sense_enabled ¤
get_remote_sense_enabled(channel: int = 1) -> bool

Query whether remote sense is enabled on channel.

Simulated¤

Simulated PSU driver. Client-side counterpart to :mod:instro.psu.scpi_sim_server.

Connect via a TCP socket VISA resource such as TCPIP0::127.0.0.1::5025::SOCKET.

SimulatedPSU ¤

SimulatedPSU(visa_resource: str | VisaConfig)

Bases: PSUDriverBase

Client for the in-process simulated PSU SCPI server.

open ¤
open() -> None
close ¤
close() -> None
set_voltage ¤
set_voltage(voltage: float, channel: int = 1) -> None
get_voltage ¤
get_voltage(channel: int = 1) -> float
set_current_limit ¤
set_current_limit(current_limit: float, channel: int = 1) -> None
get_current ¤
get_current(channel: int = 1) -> float
output_enable ¤
output_enable(enable: bool, channel: int = 1) -> None
get_output_status ¤
get_output_status(channel: int = 1) -> bool
set_overvoltage_protection_level ¤
set_overvoltage_protection_level(
    voltage: float, channel: int = 1
) -> None
get_overvoltage_protection_level ¤
get_overvoltage_protection_level(channel: int = 1) -> float
set_overcurrent_protection_level ¤
set_overcurrent_protection_level(
    current: float, channel: int = 1
) -> None
get_overcurrent_protection_level ¤
get_overcurrent_protection_level(channel: int = 1) -> float
set_overcurrent_protection_enabled ¤
set_overcurrent_protection_enabled(
    enabled: bool, channel: int = 1
) -> None
get_overcurrent_protection_enabled ¤
get_overcurrent_protection_enabled(channel: int = 1) -> bool
set_remote_sense_enabled ¤
set_remote_sense_enabled(enabled: bool, channel: int = 1) -> None
get_remote_sense_enabled ¤
get_remote_sense_enabled(channel: int = 1) -> bool
set_overvoltage_protection_enabled ¤
set_overvoltage_protection_enabled(
    enabled: bool, channel: int = 1
) -> None

Enable or disable overvoltage protection on channel.

get_overvoltage_protection_enabled ¤
get_overvoltage_protection_enabled(channel: int = 1) -> bool

Query whether overvoltage protection is enabled on channel.

set_overvoltage_protection_delay ¤
set_overvoltage_protection_delay(
    delay: float, channel: int = 1
) -> None

Set the overvoltage protection trip delay (seconds) on channel.

get_overvoltage_protection_delay ¤
get_overvoltage_protection_delay(channel: int = 1) -> float

Query the overvoltage protection trip delay (seconds) on channel.