The Keysight N5745A power supply is controlled remotely with SCPI commands. TestFlow's instrument library holds 61 commands for it, 27 of them queries that read values or state, grouped below by subsystem with their arguments. It is the same library TestFlow's AI agent uses to drive the N5745A on a real bench.
Describe the test; TestFlow's agent uses this command set to drive your Keysight N5745A and writes the report from the measured results.
With PyVISA, any VISA backend, and the instrument on USB, LAN or GPIB, this opens a session, identifies the instrument, sends one setting, and reads one value. Every command in it comes from the reference below. For a full walkthrough, see the PyVISA tutorial and the SCPI command cheat sheet.
import pyvisa
rm = pyvisa.ResourceManager()
print(rm.list_resources()) # find the Keysight N5745A's VISA address
# Paste the address of your Keysight N5745A (USB, LAN or GPIB).
inst = rm.open_resource("PASTE_VISA_ADDRESS_HERE")
inst.timeout = 5000 # ms
print(inst.query("*IDN?")) # identify the instrument
inst.write("OUTPut:STATe ON") # Turn On
print(inst.query("MEASure:VOLTage:DC?")) # Measure Voltage
inst.close()Describe the test; TestFlow's agent uses this command set to drive your Keysight N5745A and writes the report from the measured results.
Describe the test in a sentence, for example “turn on on the N5745A, then measure voltage and log it against a limit”. TestFlow's agent builds the steps from this command library, runs them on your bench through the TestFlow desktop app, and writes the report from the measured values. See AI test automation for lab instruments for how that works and where it stops.
61 commands in 12 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values.
| Command | What it does | Arguments |
|---|---|---|
| SOURce:VOLTage <Volt> | Set Voltage. Sets the output voltage in volts (0 to 31.5 V; limited by OVP/1.05 and UVL/0.95). | Number: 0,31.5 |
| SOURce:VOLTage? | Read Voltage Setting. Reads the programmed output voltage in volts. | None |
| SOURce:VOLTage:TRIGgered <Volt> | Set Triggered Voltage. Sets the voltage that is transferred to the output when a trigger occurs. | Number: 0,31.5 |
| SOURce:VOLTage:TRIGgered? | Read Triggered Voltage. Reads the programmed triggered output voltage in volts. | None |
| SOURce:VOLTage:LIMit:LOW <Volt> | Set Low Voltage Limit. Sets the under-voltage limit (UVL) below which voltage programming is ignored (0 to 28.5 V). | Number: 0,28.5 |
| SOURce:VOLTage:LIMit:LOW? | Read Low Voltage Limit. Reads the low-voltage limit setting in volts. | None |
| SOURce:VOLTage:PROTection:LEVel <Volt> | Set OVP Level. Sets the over-voltage protection trip level in volts (2 to 36 V; at least 1.05 x the voltage setting). | Number: 2,36 |
| SOURce:VOLTage:PROTection:LEVel? | Read OVP Level. Reads the over-voltage protection trip level in volts. | None |
| SOURce:CURRent <Amp> | Set Current. Sets the output current limit in amps (0 to 25 A). | Number: 0,25 |
| SOURce:CURRent? | Read Current Setting. Reads the programmed output current limit in amps. | None |
| SOURce:CURRent:TRIGgered <Amp> | Set Triggered Current. Sets the current limit that is transferred to the output when a trigger occurs. | Number: 0,25 |
| SOURce:CURRent:TRIGgered? | Read Triggered Current. Reads the programmed triggered output current in amps. | None |
| SOURce:CURRent:PROTection:STATe ON | Enable OCP. Enables over-current protection so the output latches off when it enters constant-current mode. | None |
| SOURce:CURRent:PROTection:STATe OFF | Disable OCP. Disables over-current protection. | None |
| SOURce:CURRent:PROTection:STATe? | Read OCP State. Reads whether over-current protection is ON (1) or OFF (0). | None |
| Command | What it does | Arguments |
|---|---|---|
| OUTPut:STATe ON | Turn On. Enables the DC output of the power supply. | None |
| OUTPut:STATe OFF | Turn Off. Disables the DC output (zero output voltage and zero source current). | None |
| OUTPut:STATe? | Read Output State. Reads whether the output is ON (1) or OFF (0). | None |
| OUTPut:PON:STATe RST | Set Power On State Reset. Sets the unit to power on in the reset (*RST) state. | None |
| OUTPut:PON:STATe AUTO | Set Power On State Auto. Sets the unit to power on with the settings it had when it was turned off. | None |
| OUTPut:PON:STATe? | Read Power On State. Reads the power-on state setting (RST or AUTO). | None |
| OUTPut:PROTection:CLEar | Clear Protection. Clears latched protection faults (OV/OC/OT/AC fail/inhibit) and restores the output to its previous state. | None |
| Command | What it does | Arguments |
|---|---|---|
| STATus:OPERation:CONDition? | Read Operation Condition. Reads the operation condition register (CV=256 / CC=1024 / waiting-for-trigger=32). | None |
| STATus:OPERation:EVENt? | Read Operation Event. Reads and clears the operation event register. | None |
| STATus:OPERation:ENABle <Value> | Set Operation Enable. Sets the operation enable register mask that drives the OPER bit of the status byte. | Number: 0,32767 |
| STATus:QUEStionable:CONDition? | Read Questionable Condition. Reads the questionable condition register (OV=1 / OC=2 / PF=4 / OT=16 / INH=512 / UNR=1024). | None |
| STATus:QUEStionable:EVENt? | Read Questionable Event. Reads and clears the questionable event register. | None |
| STATus:QUEStionable:ENABle <Value> | Set Questionable Enable. Sets the questionable enable register mask that drives the QUES bit of the status byte. | Number: 0,32767 |
| STATus:PRESet | Status Preset. Presets the operation and questionable enable and transition registers to their power-on values. | None |
| Command | What it does | Arguments |
|---|---|---|
| SYSTem:COMMunicate:RLSTate <State> | Set Remote Local State. Sets the remote/local state (RWLock disables the front panel keys). | Text: LOCal,REMote,RWLock |
| SYSTem:COMMunicate:RLSTate? | Read Remote Local State. Reads the remote/local state of the instrument. | None |
| SYSTem:COMMunicate:TCPip:CONTrol? | Read TCP Control Port. Returns the control socket port number used for LAN socket connections. | None |
| SYSTem:ERRor? | Read Error. Reads and removes the next error number and message from the error queue. | None |
| SYSTem:VERSion? | Read SCPI Version. Returns the SCPI version number that the instrument complies with. | None |
| Command | What it does | Arguments |
|---|---|---|
| INITiate:IMMediate:TRANsient | Initiate Trigger. Initiates the trigger system so that the next trigger applies the triggered voltage and current. | None |
| INITiate:CONTinuous:TRANsient ON | Enable Continuous Trigger. Enables continuous initiation of the output trigger system. | None |
| INITiate:CONTinuous:TRANsient OFF | Disable Continuous Trigger. Disables continuous initiation so the trigger system must be initiated before each trigger. | None |
| INITiate:CONTinuous:TRANsient? | Read Continuous Trigger State. Reads whether continuous triggering is ON (1) or OFF (0). | None |
| Command | What it does | Arguments |
|---|---|---|
| TRIGger:SOURce BUS | Set Trigger Source Bus. Selects BUS as the trigger source for the output trigger system (the only available source). | None |
| TRIGger:SOURce? | Read Trigger Source. Reads the selected trigger source. | None |
| TRIGger:TRANsient:IMMediate | Trigger Immediate. Generates an immediate output trigger if the trigger system has been initiated. | None |
| Command | What it does | Arguments |
|---|---|---|
| MEASure:VOLTage:DC? | Measure Voltage. Takes a new measurement and returns the DC output voltage in volts. | None |
| MEASure:CURRent:DC? | Measure Current. Takes a new measurement and returns the DC output current in amps. | None |
| Command | What it does | Arguments |
|---|---|---|
| ABORt | Abort Trigger. Cancels any trigger action in progress and returns the trigger system to the idle state. | None |
| Command | What it does | Arguments |
|---|---|---|
| <Output Variable>=<Equation> | Math. Variable equals an equation like (${Var_name}= ${Var_name}/2) | Number; Text |
| Command | What it does | Arguments |
|---|---|---|
| wait(<ms>) | Wait. Waits for number of milliseconds | Number |
| Command | What it does | Arguments |
|---|---|---|
| save2var <Variable_name> | Save2Variable. Saves last measurement to a variable | Text |
| Command | What it does | Arguments |
|---|---|---|
| *STB? | Read Status Byte. Reads the status byte register without clearing it. | None |
| *ESE <Value> | Set Event Status Enable. Sets the standard event status enable register mask. | Number: 0,255 |
| *ESR? | Read Event Status Register. Reads and clears the standard event status register. | None |
| *SRE <Value> | Set Service Request Enable. Sets the service request enable register mask. | Number: 0,255 |
| *SAV <Slot> | Save State. Saves the present instrument state to memory location 0 to 15 (lost at power-off). | Number: 0,15 |
| *RCL <Slot> | Recall State. Recalls an instrument state previously saved in memory location 0 to 15. | Number: 0,15 |
| *IDN? | Identify. Returns the instrument identification string (manufacturer, model, serial, firmware). | None |
| *OPT? | Read Options. Returns the installed options (0 means no options installed). | None |
| *RST | Reset. Resets the instrument to its default state (output off, V=0, I=0, OVP=max) and aborts triggers. | None |
| *CLS | Clear Status. Clears all event registers and the error queue. | None |
| *TST? | Self Test. Runs the self-test and returns the result (always returns 0 on this model). | None |
| *OPC? | Operation Complete. Returns 1 when all pending operations are complete. | None |
| *WAI | Wait To Continue. Waits until all pending operations are complete before continuing. | None |
| *TRG | Trigger Bus. Generates a bus trigger when the trigger source is set to BUS. | None |
This reference is generated from TestFlow's instrument library, which is drafted from Keysight's programming documentation for the N5745A and checked when the agent runs it. Ranges, timing, and option-dependent commands are defined by Keysight's programming manual: check it before you rely on an edge case. Last updated October 13, 2026.
Yes. The Keysight N5745A accepts SCPI commands over its remote interfaces. TestFlow's instrument library holds 61 SCPI commands for it: 27 queries that read values or state, and 34 settings and actions.
Install PyVISA and a VISA backend, find the instrument's address with ResourceManager().list_resources(), open it, then send commands with write() and read values with query(). The example on this page sends *IDN?, OUTPut:STATe ON and MEASure:VOLTage:DC?.
MEASure:VOLTage:DC? (measure voltage). Takes a new measurement and returns the DC output voltage in volts. The full list of queries is in the command reference on this page, grouped by subsystem.
Yes. TestFlow is an AI agent for electronics testing: you describe the test, and it builds the automation from this command library, runs it on the Keysight N5745A through the TestFlow desktop app, and writes the report from the measured results.
Describe the test. TestFlow builds the workflow, runs it on your instruments, and writes the report. See it on a bench like yours.