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.
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.
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 HMP4040 | Rohde & Schwarz NGP804 | |
|---|---|---|
| Commands in TestFlow's library | 28 | 30 |
| Queries (read a value or state) | 9 | 9 |
| Settings and actions | 19 | 21 |
| Subsystems | 6 | 8 |
| Distinct command headers | 10 | 19 |
| Headers the other lacks | 1 | 10 |
| Command language | SCPI | SCPI |
| Operation complete | *OPC? | *OPC? |
| Error queue | SYSTem:ERRor? | SYSTem:ERRor? |
| Models on this command set | HMP4040 | NGP804, NGP824 |
9 command headers are in both libraries.
| Command | What 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). |
| *RST | Reset. Resets the instrument to its default state. |
| *CLS | Clear 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. |
| *WAI | Wait To Continue. Waits until all pending operations are complete before continuing. |
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.
| Command | What it does |
|---|---|
| INSTrument:NSELect 1 ; ... | Turn On CH1. Enables the output of channel 1. |
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.
| Command | What 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. |
| Command | What 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. |
| Command | What 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. |
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()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.
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).
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.
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.
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.
Describe the test. TestFlow builds the workflow, runs it on your instruments, and writes the report. See it on a bench like yours.