InstroPSU#

class InstroPSU(
name: str | None = None,
driver: PSUDriverBase | None = None,
num_channels: int | None = None,
publishers: list[Publisher] | None = None,
config: PSUConfig | dict | Path | str | None = None,
autostart: bool = False,
**kwargs,
)[source]#

Bases: Instrument

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

Initialize an InstroPSU.

Provide either config or driver/num_channels together, not both.

Parameters:
  • name – Channel-name prefix for published data. Falls back to config.device.name when config is given.

  • driver –

    Concrete PSU driver; owns its own transport:

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

  • num_channels – Number of output channels on this PSU.

  • publishers – Publishers that receive emitted Measurement/Command data. Combined with any publishers declared in config.

  • config – A PSUConfig, a dict, or a path to a JSON config file.

  • autostart – When True, open the connection and start background polling.

  • **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).

Attributes

background_interval

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

channel_names

Return an insertion-ordered snapshot of all published channel names.

Methods

add_background_daemon_function

Append method to the daemon's call list.

add_publisher

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

apply

Set the current limit, then the voltage, then the output state on channel.

clear_protection

Clear every latched protection trip on channel.

close

Disconnect from the device.

define_background_daemon

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

get_channel

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

get_current

Measure the current (amperes) flowing through channel.

get_current_setpoint

Query the configured current-limit setpoint (amperes) on channel.

get_operating_mode

Query whether channel is regulating in constant voltage, constant current, unregulated, or off (published as a string).

get_output_status

Query whether the output on channel is enabled.

get_overcurrent_protection_enabled

Query whether overcurrent protection is enabled on channel.

get_overcurrent_protection_level

Query the overcurrent protection threshold (amperes) on channel.

get_overcurrent_protection_tripped

Query whether overcurrent protection has tripped on channel and not been cleared.

get_overvoltage_protection_delay

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

get_overvoltage_protection_enabled

Query whether overvoltage protection is enabled on channel.

get_overvoltage_protection_level

Query the overvoltage protection threshold (volts) on channel.

get_overvoltage_protection_tripped

Query whether overvoltage protection has tripped on channel and not been cleared.

get_remote_sense_enabled

Query whether remote sense is enabled on channel.

get_single_channel_value

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

get_voltage

Measure the voltage (volts) sensed at channel terminals.

get_voltage_setpoint

Query the configured voltage setpoint (volts) on channel.

open

Establish connection to the device.

output_enable

Enable or disable the output on channel.

publish

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

set_current_limit

Set the current limit (amperes) on channel.

set_overcurrent_protection_enabled

Enable or disable overcurrent protection on channel.

set_overcurrent_protection_level

Set the overcurrent protection threshold (amperes) on channel.

set_overvoltage_protection_delay

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

set_overvoltage_protection_enabled

Enable or disable overvoltage protection on channel.

set_overvoltage_protection_level

Set the overvoltage protection threshold (volts) on channel.

set_remote_sense_enabled

Enable or disable remote sense on channel.

set_voltage

Set the output voltage (volts) on channel.

start

Start the background daemon thread.

stop

Signal the background daemon to stop and join it.