Power Supply · SCPI command comparison

Rohde & Schwarz HMP4040 vs NGP804: SCPI commands and remote control compared

In TestFlow's instrument library, the Rohde & Schwarz HMP4040 takes 28 SCPI commands, 9 of them queries, and the Rohde & Schwarz NGP804 takes 30 SCPI commands, 9 of them queries. That is 2 more on the NGP804. Counting distinct command headers (the command path without its arguments), 9 are accepted by both, 1 exist only on the HMP4040, and 10 only on the NGP804. 90% of the HMP4040's command headers also exist on the NGP804.

Both libraries have commands under SYSTem. Only the HMP4040 has INSTrument. Only the NGP804 has OUTPut, SOURce, and MEASure.

Both libraries synchronise with *OPC?. Both libraries read errors with SYSTem:ERRor?.

TestFlow's library gives the NGP824 the same command set as the NGP804, so the NGP804 column applies to it too.

HMP4040 commands
28
NGP804 commands
30
Shared headers
9
Unique headers
11

Run this on your bench

Describe the test; TestFlow's agent uses these command sets to drive your Rohde & Schwarz HMP4040 or Rohde & Schwarz NGP804 and writes the report from the measured results.

Get started

HMP4040 vs NGP804 at a glance

Counts come from TestFlow's instrument library, the command sets its AI agent uses to drive each instrument. A distinct command header is the command path without its arguments, so :OUTPut ON and :OUTPut OFF count once.

Rohde & Schwarz HMP4040Rohde & Schwarz NGP804
Commands in TestFlow's library2830
Queries (read a value or state)99
Settings and actions1921
Subsystems68
Distinct command headers1019
Headers the other lacks110
Command languageSCPISCPI
Operation complete*OPC?*OPC?
Error queueSYSTem:ERRor?SYSTem:ERRor?
Models on this command setHMP4040NGP804, NGP824

Commands both accept

9 command headers are in both libraries.

CommandWhat it does
SYSTem:ERRor?Read Error. Reads the first message from the error queue.
*SAV <Slot>Save State. Saves the current instrument state to the specified storage slot.
*RCL <Slot>Recall State. Recalls an instrument state from the specified storage slot.
*IDN?Identify. Returns the instrument identification string (manufacturer, model, serial, firmware).
*RSTReset. Resets the instrument to its default state.
*CLSClear Status. Clears all event registers and the error queue.
*TST?Self Test. Runs the self-test and returns 0 for pass or 1 for failure.
*OPC?Operation Complete. Returns 1 when all pending operations are complete.
*WAIWait To Continue. Waits until all pending operations are complete before continuing.

Only on the Rohde & Schwarz HMP4040

1 command header in the HMP4040 library has no match in the NGP804 library. Below are 1 of them from the 1 largest subsystem; the full list is in the Rohde & Schwarz HMP4040 command reference.

INSTrument (1 only on the HMP4040)

CommandWhat it does
INSTrument:NSELect 1 ; ...Turn On CH1. Enables the output of channel 1.

Only on the Rohde & Schwarz NGP804

10 command headers in the NGP804 library have no match in the HMP4040 library. Below are 8 of them from the 3 largest subsystems; the full list is in the Rohde & Schwarz NGP804 command reference.

SOURce (6 only on the NGP804)

CommandWhat it does
SOURce:VOLTage <Volt>,(@<Channel>)Set Voltage. Sets the output voltage of the selected channel in volts.
SOURce:VOLTage? (@<Channel>)Read Voltage Setting. Reads the set output voltage of the selected channel.
SOURce:CURRent <Amp>,(@<Channel>)Set Current. Sets the output current limit of the selected channel in amps.
SOURce:CURRent? (@<Channel>)Read Current Setting. Reads the set output current limit of the selected channel.

MEASure (2 only on the NGP804)

CommandWhat it does
MEASure:VOLTage? (@<Channel>)Measure Voltage. Measures the output voltage of the selected channel in volts.
MEASure:CURRent? (@<Channel>)Measure Current. Measures the output current of the selected channel in amps.

OUTPut (2 only on the NGP804)

CommandWhat it does
OUTPut ON,(@1)Turn On CH1. Enables the output of channel 1.
OUTPut? (@<Channel>)Read Output State. Reads whether the selected channel output is ON or OFF.

Control both from Python

With PyVISA and any VISA backend, this opens both instruments, identifies them, sends one setting, and reads one value from each. For the setting, the two libraries have no common command with a worked example on both, so each instrument uses its own: OUTPut ON,(@1) on the NGP804. For the reading, both libraries hold SYSTem:ERRor? (read error), and the same line runs on each. For the basics, see the PyVISA tutorial.

import pyvisa

rm = pyvisa.ResourceManager()
print(rm.list_resources())  # find both VISA addresses

a = rm.open_resource("PASTE_HMP4040_ADDRESS")  # Rohde & Schwarz HMP4040
b = rm.open_resource("PASTE_NGP804_ADDRESS")  # Rohde & Schwarz NGP804
for inst in (a, b):
    inst.timeout = 5000  # ms
    print(inst.query("*IDN?"))

# No shared setting with an example on both, so each uses its own command
b.write("OUTPut ON,(@1)")  # Turn On CH1

# The same reading on both: Read Error
print(a.query("SYSTem:ERRor?"))
print(b.query("SYSTem:ERRor?"))

a.close()
b.close()

Run this on your bench

Describe the test; TestFlow's agent uses these command sets to drive your Rohde & Schwarz HMP4040 or Rohde & Schwarz NGP804 and writes the report from the measured results.

Get started

Frequently asked questions

What is the difference between the Rohde & Schwarz HMP4040 and the Rohde & Schwarz NGP804 for remote control?

In TestFlow's library the HMP4040 has 28 SCPI commands and the NGP804 has 30 SCPI commands. 9 command headers are common to both, 1 are only on the HMP4040 (mostly INSTrument), and 10 are only on the NGP804 (mostly SOURce and MEASure).

Can I use the same SCPI code for the Rohde & Schwarz HMP4040 and the Rohde & Schwarz NGP804?

Partly. 9 command headers are accepted by both, including SYSTem:ERRor?. 11 are not, for example INSTrument:NSELect on the HMP4040 and SOURce:VOLTage on the NGP804, so a script that uses those needs a separate branch for each instrument.

Which has more remote commands, the HMP4040 or the NGP804?

The NGP804: 28 commands for the HMP4040 against 30 for the NGP804 in TestFlow's library. Of those, 9 on the HMP4040 and 9 on the NGP804 are queries that read a value or state, and the library splits them into 6 and 8 subsystems.

How do the HMP4040 and NGP804 signal operation complete and report errors?

Both libraries synchronise with *OPC?. Both libraries read errors with SYSTem:ERRor?. Each command named here is listed in the tables on this page and on each instrument's command reference.

Your next test, automated today

Describe the test. TestFlow builds the workflow, runs it on your instruments, and writes the report. See it on a bench like yours.