PSU simulator
The PSU simulator is a local SCPI server for development, tests, and demos. It listens on a TCP socket, exposes a programmable power-supply command set, and includes a terminal UI for editing channel loads, probe resistance, and channel limits while your code is running.Quickstart
Start the simulator in one terminal:127.0.0.1:5025 by default. If you are working from a source checkout, run the same command through uv:
SimulatedPSU driver. This small Python client opens an InstroPSU, configures channel 1, and reads voltage and current measurements:
Usage
The simulator runs a terminal UI while the TCP server listens in the background. The UI is organized by panel header.q to quit.
PSU
The ⟢ NOMINAL PSU panel shows the simulator identity and VISA resource string. Use the resource string when driver code connects to the simulator.Channel
Each CHANNEL panel shows the live state for one output. The panel is split into status, voltage, and current sections.
Changing V LIMIT or I LIMIT runs
*RST. The output turns off, programmed voltage and current return to zero, protection state turns off, and OVP/OCP levels return to the configured V/I limits.
Probe
The PROBE panel shows sense lead resistance. Select PROBE R to edit the probe resistance in ohms.Load
The LOAD panel shows the external load model. Select R to edit load resistance in ohms. Select EMF to edit the series electromotive force in volts.+ channel
The + CHANNEL panel adds a new output channel with the next available channel ID.SCPI log
The SCPI LOG panel records incoming commands, responses, and queued errors. It is read-only.Programming guide
Brackets mark optional SCPI path components. For example,[SOURce:]VOLTage[:LEVel] accepts VOLT, VOLT:LEV, SOUR:VOLT, and SOUR:VOLT:LEV.
Angle brackets mark command arguments. They are notation only; do not include the angle brackets in the command.
<NRf+>is a positive flexible numeric value, such as0,1.25, or1e-3.<literal|literal>is one literal value from the listed options.
|) means OR. For example, <LOC|REM> accepts LOC or REM, and <NRf+|MIN|MAX> accepts one numeric value, MIN, or MAX. Do not send the pipe character in the command.
MIN maps to 0. MAX maps to V LIMIT for voltage and OVP commands, and I LIMIT for current and OCP commands. Do not send MIN or MAX to queries.
Defaults and reset
On startup and after*RST, each channel uses the reset operating state:
*RST preserves simulator configuration, including channel count, channel IDs, load resistance, series EMF, probe resistance, sense mode, and configured channel limits.
Error queue
Errors are queued and returned one at a time bySYSTem:ERRor?. The simulator can emit these error codes:
Common commands
*IDN? | |
| Query simulator identity | Response: String |
*RST | |
| Reset channel operating state and clear errors | Response: None |
*CLS | |
| Clear the error queue | Response: None |
MEASure subsystem
MEASure:CURRent? | |
| Measure output current | Response: Number |
MEASure:VOLTage? | |
| Measure output voltage | Response: Number |
OUTPut subsystem
OUTPut[:STATe] <0|1|OFF|ON> | |
| Enable or disable output | Response: None |
OUTPut[:STATe]? | |
| Query output state | Response: 0 or 1 |
OUTPut:PROTection:CLEar | |
| Clear latched OVP and OCP faults | Response: None |
OUTPut:PROTection:TRIPped? | |
| Query latched OVP or OCP fault state | Response: 0 or 1 |
SOURce subsystem
[SOURce:]CURRent[:LEVel][:IMMediate][:AMPLitude] <NRf+|MIN|MAX> | |
| Set current limit | Response: None |
[SOURce:]CURRent[:LEVel][:IMMediate][:AMPLitude]? | |
| Query current limit | Response: Number |
[SOURce:]CURRent:PROTection[:LEVel] <NRf+|MIN|MAX> | |
| Set OCP level | Response: None |
[SOURce:]CURRent:PROTection[:LEVel]? | |
| Query OCP level | Response: Number |
[SOURce:]CURRent:PROTection:STATe <0|1|OFF|ON> | |
| Enable or disable OCP | Response: None |
[SOURce:]CURRent:PROTection:STATe? | |
| Query OCP state | Response: 0 or 1 |
[SOURce:]VOLTage[:LEVel][:IMMediate][:AMPLitude] <NRf+|MIN|MAX> | |
| Set programmed voltage | Response: None |
[SOURce:]VOLTage[:LEVel][:IMMediate][:AMPLitude]? | |
| Query programmed voltage | Response: Number |
[SOURce:]VOLTage:PROTection[:LEVel] <NRf+|MIN|MAX> | |
| Set OVP level | Response: None |
[SOURce:]VOLTage:PROTection[:LEVel]? | |
| Query OVP level | Response: Number |
[SOURce:]VOLTage:PROTection:STATe <0|1|OFF|ON> | |
| Enable or disable OVP | Response: None |
[SOURce:]VOLTage:PROTection:STATe? | |
| Query OVP state | Response: 0 or 1 |
SYSTem subsystem
SYSTem:ERRor? | |
| Pop one error from the error queue | Response: code,“message” |
SYSTem:SENSe[:STATe] <LOC|REM> | |
| Select local or remote sense | Response: None |
SYSTem:SENSe[:STATe]? | |
| Query sense mode | Response: LOC or REM |