Skip to main content
Control programmable power supplies to set voltage, current, and protection thresholds for your DUT.

Import

Methods

Method Reference

Net.get(name, type=NetType.PowerSupply)

Get a power supply net by name.
Parameters: Returns: Power supply Net instance

set_voltage(value)

Set the output voltage.

set_current(value)

Set the output current limit.

voltage()

Read the measured output voltage.
Returns: float - Measured voltage in volts

current()

Read the measured output current.
Returns: float - Measured current in amps

power()

Read the measured output power.
Returns: float - Measured power in watts

enable()

Enable the power output.

disable()

Disable the power output.

set_ovp(limit)

Set over-voltage protection threshold. When the measured voltage exceeds this threshold, the output is automatically disabled. On a Keithley 2281S, an OVP below the voltage setpoint raises an error. The other drivers accept it.

set_ocp(limit)

Set over-current protection threshold. When the measured current exceeds this threshold, the output is automatically disabled.

get_ovp_limit()

Get the configured OVP limit.
Returns: float - OVP threshold in volts

get_ocp_limit()

Get the configured OCP limit.
Returns: float - OCP threshold in amps

is_ovp()

Check if an over-voltage fault is active.
Returns: bool - True if OVP fault is active

is_ocp()

Check if an over-current fault is active.
Returns: bool - True if OCP fault is active

clear_ovp()

Clear over-voltage protection fault.

clear_ocp()

Clear over-current protection fault.

state()

Print comprehensive power supply state including channel, enabled status, mode (CV/CC), measured voltage/current/power, and protection status. The call runs in the box’s hardware service. The text goes to /tmp/lager-hardware-service.log on the box, not to your script, and the call returns None. To read the state in a script, use get_monitor_state(). See #845.
Example output:

get_full_state()

Print extended state including all measurements, configured setpoints, protection limits, and hardware maximum ratings. Like state(), it prints to the hardware-service log and returns None.
Example output:
Additional fields beyond state():
  • Voltage_Set / Current_Set - Configured setpoints
  • Voltage_Max / Current_Max - Hardware channel ratings

get_monitor_state(channel)

Read the full state of one channel in a single call, and return it as a dict. This is the way to read the state in a script.
Pass the net’s channel. With no channel, a multi-channel supply such as a DP832 reads the output that is selected on its front panel (#846). get_monitor_states([1, 2]) reads several channels and returns {'1': {...}, '2': {...}}.

disable_ocp(channel) / disable_ovp(channel)

Turn over-current or over-voltage protection off. Setting a limit with set_ocp() or set_ovp() turns it back on.
Pass the net’s channel. With no channel, a multi-channel supply acts on the output that is selected on its front panel (#846). A net with a max_voltage safety limit refuses to turn OVP off, and a net with max_current refuses to turn OCP off.

Examples

Basic Power Control

With Protection Thresholds

Monitor Power Consumption

Full State Inspection

Supported Hardware

An EA supply does not work through Net.get() today. set_voltage(), set_current(), set_ovp(), set_ocp(), enable() and disable() fail with “Function not found”. Use lager supply for an EA supply. See #843.

Notes

  • Net must be configured as NetType.PowerSupply
  • Call enable() to turn on the output after setting voltage/current
  • Always call disable() when finished
  • Protection faults automatically disable output; use clear_ovp() or clear_ocp() after addressing the fault
  • On a Keithley 2281S, an OVP below the voltage setpoint raises an error
  • Voltage and current limits depend on hardware capabilities
  • Multi-channel supplies: each channel is configured as a separate net
  • state() and get_full_state() print to the box’s hardware-service log and return None; use voltage(), current(), power() or get_monitor_state() to get values in code