Import
Methods
| Method | Description |
|---|---|
set_voltage() | Set output voltage |
set_current() | Set output current limit |
voltage() | Read measured voltage |
current() | Read measured current |
power() | Read measured power |
enable() | Enable power output |
disable() | Disable power output |
set_ovp() | Set over-voltage protection threshold |
set_ocp() | Set over-current protection threshold |
get_ovp_limit() | Get over-voltage protection limit |
get_ocp_limit() | Get over-current protection limit |
is_ovp() | Check if OVP fault is active |
is_ocp() | Check if OCP fault is active |
clear_ovp() | Clear over-voltage protection fault |
clear_ocp() | Clear over-current protection fault |
state() | Print comprehensive power state |
get_full_state() | Print extended state with setpoints and limits |
Method Reference
Net.get(name, type=NetType.PowerSupply)
Get a power supply net by name.
| Parameter | Type | Description |
|---|---|---|
name | str | Name of the power supply net |
type | NetType | Must be NetType.PowerSupply |
set_voltage(value)
Set the output voltage.
| Parameter | Type | Description |
|---|---|---|
value | float | Target voltage in volts |
set_current(value)
Set the output current limit.
| Parameter | Type | Description |
|---|---|---|
value | float | Current limit in amps |
voltage()
Read the measured output voltage.
float - Measured voltage in volts
current()
Read the measured output current.
float - Measured current in amps
power()
Read the measured output power.
float - Measured power in watts
enable()
Enable the power output.
disable()
Disable the power output.
set_ovp(limit)
Set over-voltage protection threshold. OVP must be greater than or equal to the configured voltage. When the measured voltage exceeds this threshold, the output is automatically disabled.
| Parameter | Type | Description |
|---|---|---|
limit | float | OVP threshold in volts |
set_ocp(limit)
Set over-current protection threshold. When the measured current exceeds this threshold, the output is automatically disabled.
| Parameter | Type | Description |
|---|---|---|
limit | float | OCP threshold in amps |
get_ovp_limit()
Get the configured OVP limit.
float - OVP threshold in volts
get_ocp_limit()
Get the configured OCP limit.
float - OCP threshold in amps
is_ovp()
Check if an over-voltage fault is active.
bool - True if OVP fault is active
is_ocp()
Check if an over-current fault is active.
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.
get_full_state()
Print extended state including all measurements, configured setpoints, protection limits, and hardware maximum ratings.
state():
- Voltage_Set / Current_Set - Configured setpoints
- Voltage_Max / Current_Max - Hardware channel ratings
Examples
Basic Power Control
With Protection Thresholds
Monitor Power Consumption
Full State Inspection
Supported Hardware
| Manufacturer | Model Series | Channels | Features |
|---|---|---|---|
| Rigol | DP832 / DP832A | 3 | Ch1-2: 30V/3A, Ch3: 5V/3A |
| Rigol | DP821 | 2 | Ch1: 60V/1A, Ch2: 8V/10A |
| Rigol | DP811 / DP811A | 1 | 20V/10A or 40V/5A |
| Keithley | 2281S | 1 | 20V/6A/120W, battery simulator mode |
| Keysight | E36200 series | 2 | E36233A: 30V/20A per channel |
| Keysight | E36300 series | 3 | E36311A/12A/13A |
| EA | PSI/EL series | 1 | Two-quadrant operation |
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()orclear_ocp()after addressing the fault - OVP must be >= the voltage setpoint; setting a lower OVP will raise an error
- Voltage and current limits depend on hardware capabilities
- Multi-channel supplies: each channel is configured as a separate net
state()andget_full_state()print to stdout; usevoltage(),current(),power()to get values in code

