The Stanford Research Systems CG635 clock generator is controlled remotely with SCPI commands. TestFlow's instrument library holds 67 commands for it, 31 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 CG635 on a real bench.
Commands
67
Queries
31
Subsystems
25
Models covered
1
Run this on your bench
Describe the test; TestFlow's agent uses this command set to drive your Stanford Research Systems CG635 and writes the report from the measured results.
Control the Stanford Research Systems CG635 from Python
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 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()
Run this on your bench
Describe the test; TestFlow's agent uses this command set to drive your Stanford Research Systems CG635 and writes the report from the measured results.
Describe the test in a sentence, for example “set relative phase zero on the CG635, then read frequency 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.
67 commands in 25 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values.
QOUT subsystem (4)
Command
What it does
Arguments
QOUT 1,<Volt>
Set Q High Voltage. Sets the Q / Q-bar output high level in volts (-2.00 V to +5.00 V, amplitude 0.20 V to 1.00 V).
Number
QOUT?1
Read Q High Voltage. Reads the Q / Q-bar output high level in volts.
None
QOUT 0,<Volt>
Set Q Low Voltage. Sets the Q / Q-bar output low level in volts (-3.00 V to +4.80 V, amplitude 0.20 V to 1.00 V).
Number
QOUT?0
Read Q Low Voltage. Reads the Q / Q-bar output low level in volts.
None
CMOS subsystem (4)
Command
What it does
Arguments
CMOS 1,<Volt>
Set CMOS High Voltage. Sets the CMOS output high level in volts (-0.50 V to +6.00 V, amplitude 0.50 V to 6.00 V).
Number
CMOS?1
Read CMOS High Voltage. Reads the CMOS output high level in volts.
None
CMOS 0,<Volt>
Set CMOS Low Voltage. Sets the CMOS output low level in volts (-1.00 V to +1.00 V, amplitude 0.50 V to 6.00 V).
Number
CMOS?0
Read CMOS Low Voltage. Reads the CMOS output low level in volts.
None
SLVL subsystem (4)
Command
What it does
Arguments
SLVL 0
Set Stop Level Low. Sets the output level in the stopped state to low.
None
SLVL 1
Set Stop Level High. Sets the output level in the stopped state to high.
None
SLVL 2
Toggle Stop Level. Toggles the output level in the stopped state.
None
SLVL?
Read Stop Level. Reads the stopped-state output level (0=low or 1=high).
None
RUNS subsystem (3)
Command
What it does
Arguments
RUNS 1
Run Output. Puts the outputs in the running (not stopped) state.
None
RUNS 0
Stop Output. Stops the outputs and sets the stop level low.
None
RUNS?
Read Running State. Reads the output running state (0=stopped or 1=running).
None
PRBS subsystem (3)
Command
What it does
Arguments
PRBS 1
Turn On PRBS. Enables the PRBS output (requires the PRBS option to be installed).
None
PRBS 0
Turn Off PRBS. Disables the PRBS output.
None
PRBS?
Read PRBS State. Reads whether PRBS is enabled (0=disabled or 1=enabled).
None
SHDP subsystem (3)
Command
What it does
Arguments
SHDP 1
Turn On Display. Turns the front-panel display on.
None
SHDP 0
Turn Off Display. Turns the front-panel display off.
None
SHDP?
Read Display State. Reads whether the front-panel display is on (1) or off (0).
None
Frequency (FREQuency) (2)
Command
What it does
Arguments
FREQ <Freq>
Set Frequency. Sets the output clock frequency in Hz (1 uHz to 2.05 GHz with up to 16 significant digits).
Number
FREQ?
Read Frequency. Reads the current output clock frequency in Hz.
None
PHAS subsystem (2)
Command
What it does
Arguments
PHAS <Phase>
Set Phase. Sets the output phase in degrees (max 360 degree change per step); executes as an overlapped operation so use *OPC or *WAI to confirm completion.
Number
PHAS?
Read Phase. Reads the current output phase in degrees.
None
STDQ subsystem (2)
Command
What it does
Arguments
STDQ <Level>
Set Standard Q Level. Sets the Q / Q-bar outputs to a standard logic level (0=ECL,1=+7 dBm,2=LVDS,3=PECL 3.3 V,4=PECL 5.0 V).
Number: 0,1,2,3,4
STDQ?
Read Standard Q Level. Reads the standard Q / Q-bar level index (returns -1 if the levels are not a standard setting).
None
STDC subsystem (2)
Command
What it does
Arguments
STDC <Level>
Set Standard CMOS Level. Sets the CMOS output to a standard logic level (0=1.2 V,1=1.8 V,2=2.5 V,3=3.3 V,4=5.0 V).
Number: 0,1,2,3,4
STDC?
Read Standard CMOS Level. Reads the standard CMOS level index (returns -1 if the levels are not a standard setting).
None
STPS subsystem (2)
Command
What it does
Arguments
STPS <Component>,<Step>
Set Step Size. Sets the step size of a component (0=Frequency Hz,1=Phase deg,2=Q high V,3=Q low V,4=CMOS high V,5=CMOS low V).
Number: 0,1,2,3,4,5; Number
STPS?<Component>
Read Step Size. Reads the step size of a component (0=Frequency,1=Phase,2=Q high,3=Q low,4=CMOS high,5=CMOS low).
Number: 0,1,2,3,4,5
Display (DISPlay) (2)
Command
What it does
Arguments
DISP <Display>
Set Display. Selects the front-panel display (0=Freq,1=Phase,2=Q high,3=Q low,4=CMOS high,5=CMOS low,6-11=matching step sizes).
Number: 0,1,2,3,4,5,6,7,8,9,10,11
DISP?
Read Display. Reads the current display selection (returns -1 if a non-standard display such as a status display is active).
None
UNIT subsystem (2)
Command
What it does
Arguments
UNIT <Item>,<Unit>
Set Display Units. Sets the display units for an item (Item 0=Frequency,1=Frequency step; Unit 0=Hz,1=kHz,2=MHz,3=GHz).
Number: 0,1; Number: 0,1,2,3
UNIT?<Item>
Read Display Units. Reads the display units of an item (0=Frequency,1=Frequency step) as 0=Hz,1=kHz,2=MHz or 3=GHz.
Number: 0,1
CESE subsystem (2)
Command
What it does
Arguments
CESE <Mask>
Set Comm Error Enable. Sets the communication error status enable register (0 to 255).
Number
CESE?
Read Comm Error Enable. Reads the communication error status enable register.
None
INSE subsystem (2)
Command
What it does
Arguments
INSE <Mask>
Set Instrument Status Enable. Sets the instrument status enable register (0 to 255).
Number
INSE?
Read Instrument Status Enable. Reads the instrument status enable register.
None
LCKE subsystem (2)
Command
What it does
Arguments
LCKE <Mask>
Set PLL Lock Enable. Sets the PLL lock status enable register (0 to 255).
Number
LCKE?
Read PLL Lock Enable. Reads the PLL lock status enable register.
None
RPHS subsystem (1)
Command
What it does
Arguments
RPHS
Set Relative Phase Zero. Defines the current phase as zero degrees without affecting the output.
None
STPU subsystem (1)
Command
What it does
Arguments
STPU <Component>
Step Up. Steps a component up by its step size (0=Frequency,1=Phase,2=Q high,3=Q low,4=CMOS high,5=CMOS low).
Number: 0,1,2,3,4,5
STPD subsystem (1)
Command
What it does
Arguments
STPD <Component>
Step Down. Steps a component down by its step size (0=Frequency,1=Phase,2=Q high,3=Q low,4=CMOS high,5=CMOS low).
Number: 0,1,2,3,4,5
TIMB subsystem (1)
Command
What it does
Arguments
TIMB?
Read Timebase. Reads the installed timebase (0=Internal,1=OCXO,2=Rubidium,3=External).
None
CESR subsystem (1)
Command
What it does
Arguments
CESR?
Read Comm Error Register. Reads and clears the communication error status register (0 to 255).
None
INSR subsystem (1)
Command
What it does
Arguments
INSR?
Read Instrument Status Register. Reads and clears the instrument status register (0 to 255).
None
LCKR subsystem (1)
Command
What it does
Arguments
LCKR?
Read PLL Lock Register. Reads and clears the PLL lock status register (bit 0=RF unlock,1=19 MHz unlock,2=10 MHz unlock,3=Rb unlock,4=output disabled,5=phase shift).
None
LERR subsystem (1)
Command
What it does
Arguments
LERR?
Read Last Error. Reads and removes the last error code from the error buffer (0 means no error).
None
IEEE 488.2 common commands (18)
Command
What it does
Arguments
*SAV <Location>
Save Settings. Saves the instrument settings to a memory location (0 to 9 user; 10 is reserved for the current settings).
Number: 0,1,2,3,4,5,6,7,8,9,10
*RCL <Location>
Recall Settings. Recalls the instrument settings from a memory location (0 to 9 user; 10 is the current settings).
Number: 0,1,2,3,4,5,6,7,8,9,10
*ESE <Mask>
Set Standard Event Enable. Sets the standard event status enable register (0 to 255).
Number
*ESE?
Read Standard Event Enable. Reads the standard event status enable register.
None
*ESR?
Read Standard Event Register. Reads and clears the standard event status register (0 to 255).
None
*SRE <Mask>
Set Service Request Enable. Sets the service request enable register (0 to 255).
Number
*SRE?
Read Service Request Enable. Reads the service request enable register.
None
*STB?
Read Status Byte. Reads the serial poll status byte (0 to 255) without clearing it.
None
*PSC 1
Turn On Power On Status Clear. Sets the power-on status clear flag so the *SRE and *ESE registers are cleared at power-up.
None
*PSC 0
Turn Off Power On Status Clear. Clears the power-on status clear flag so the *SRE and *ESE registers are kept through power cycles.
None
*PSC?
Read Power On Status Clear. Reads the power-on status clear flag (0 or 1).
None
*IDN?
Identify. Returns the instrument identification string (manufacturer, model, serial, firmware).
None
*RST
Reset. Resets the instrument to its factory default settings (remote interface and GPIB address are unchanged).
None
*CLS
Clear Status. Clears the ESR, CESR, LCKR and INSR registers and the LERR error buffer.
None
*TST?
Self Test. Runs the self-test and returns 0 for pass or 72 for failure.
None
*OPC
Set Operation Complete. Sets the OPC bit in the standard event status register when all prior commands have completed.
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
Where these commands come from
This reference is generated from TestFlow's instrument library, which is drafted from Stanford Research Systems's programming documentation for the CG635 and checked when the agent runs it. Ranges, timing, and option-dependent commands are defined by Stanford Research Systems's programming manual: check it before you rely on an edge case. Last updated October 14, 2026.
Frequently asked questions
Does the Stanford Research Systems CG635 support SCPI remote control?
Yes. The Stanford Research Systems CG635 accepts SCPI commands over its remote interfaces. TestFlow's instrument library holds 67 SCPI commands for it: 31 queries that read values or state, and 36 settings and actions.
How do I control the Stanford Research Systems CG635 from Python?
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?, RPHS and FREQ?.
Which command reads a value from the Stanford Research Systems CG635?
FREQ? (read frequency). Reads the current output clock frequency in Hz. The full list of queries is in the command reference on this page, grouped by subsystem.
Can I automate the Stanford Research Systems CG635 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 the Stanford Research Systems CG635 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.