Stanford Research Systems instrument command references

Remote-control command sets for 11 Stanford Research Systems instruments from TestFlow's instrument library, each with its arguments and a working PyVISA example.

The library covers 2 clock generators, 2 function generators, 7 power supplies from Stanford Research Systems: 299 commands in total, 125 of them queries that read a value or a setting back. These are the commands TestFlow's agent sends when it automates a test on Stanford Research Systems hardware, so every entry is one that drives a real instrument.

Stanford Research Systems clock generators

Stanford Research Systems function generators

Stanford Research Systems power supplies

Commands shared across Stanford Research Systems instruments

These commands appear on more than one Stanford Research Systems instrument in the library, so a script that uses them carries over between models.

CommandWhat it doesModels
*CLSClears the ESR, CESR, LCKR and INSR registers and the LERR error buffer.6 of 6
*IDN?Returns the instrument identification string (manufacturer, model, serial, firmware).6 of 6
*RCLRecalls the instrument settings from a memory location (0 to 9 user; 10 is the current settings).6 of 6
*RSTResets the instrument to its factory default settings (remote interface and GPIB address are unchanged).6 of 6
*SAVSaves the instrument settings to a memory location (0 to 9 user; 10 is reserved for the current settings).6 of 6
*ESESets the standard event status enable register (0 to 255).4 of 6
*ESE?Reads the standard event status enable register.4 of 6
*ESR?Reads and clears the standard event status register (0 to 255).4 of 6

Control a Stanford Research Systems instrument from Python

The pattern is the same for every Stanford Research Systems instrument here: open it through VISA, identify it, then write settings and query values. This example uses the Stanford Research Systems CG635; the full CG635 reference has every command.

import pyvisa

rm = pyvisa.ResourceManager()
print(rm.list_resources())  # find the Stanford Research Systems CG635's VISA address

# Paste the address of your Stanford Research Systems CG635 (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("RPHS")  # Set Relative Phase Zero
print(inst.query("FREQ?"))  # Read Frequency

inst.close()

Related guides

Frequently asked questions

Which Stanford Research Systems instruments have a command reference here?

11 Stanford Research Systems models (clock generator, function generator, power supply): CG635, CG792, DS345, DS360, PS310, PS325, PS350, PS355, PS365, PS370, PS375. Each page lists every remote-control command TestFlow's agent uses for that instrument, with its arguments.

Do Stanford Research Systems instruments use SCPI?

Yes. Every Stanford Research Systems model in TestFlow's library is programmed with SCPI commands over its remote interfaces, including the IEEE 488.2 common commands such as *IDN? and *RST.

How do I control a Stanford Research Systems instrument from Python?

Install PyVISA and a VISA backend, list the connected instruments with ResourceManager().list_resources(), open the Stanford Research Systems instrument by its VISA address (USB, LAN or GPIB), then send commands with write() and read values with query(). Each model page has a working example.

Can I automate Stanford Research Systems instruments without writing code?

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 your Stanford Research Systems instruments through the TestFlow desktop app, and writes the report from the measured results.

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.