Function Generator · SCPI command comparison

Aim-TTi TGF4042 vs Tektronix AFG31022: SCPI commands and remote control compared

In TestFlow's instrument library, the Aim-TTi TGF4042 takes 68 SCPI commands, 4 of them queries, and the Tektronix AFG31022 takes 95 SCPI commands, 12 of them queries. That is 27 more on the AFG31022. Counting distinct command headers (the command path without its arguments), 9 are accepted by both, 21 exist only on the TGF4042, and 72 only on the AFG31022. 30% of the TGF4042's command headers also exist on the AFG31022.

Both libraries have commands under OUTPUT. Only the TGF4042 has CHN, SWP, BEEPMODE, FREQ, PER, and AMPL and 14 more. Only the AFG31022 has SOURce, TRIGger, SYSTem, and DISPlay.

Both libraries synchronise with *OPC?. Only the AFG31022 library has an error-queue read (SYSTem:ERRor?); the TGF4042 library has none.

TestFlow's library gives the TGF4082, TGF4162, and TGF4242 the same command set as the TGF4042, so the TGF4042 column applies to them too. TestFlow's library gives the AFG3102C, AFG31052, AFG31102, AFG31152, AFG31252, and AFG3252C the same command set as the AFG31022, so the AFG31022 column applies to them too.

TGF4042 commands
68
AFG31022 commands
95
Shared headers
9
Unique headers
93

Run this on your bench

Describe the test; TestFlow's agent uses these command sets to drive your Aim-TTi TGF4042 or Tektronix AFG31022 and writes the report from the measured results.

Get started

TGF4042 vs AFG31022 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.

Aim-TTi TGF4042Tektronix AFG31022
Commands in TestFlow's library6895
Queries (read a value or state)412
Settings and actions6483
Subsystems299
Distinct command headers3081
Headers the other lacks2172
Command languageSCPISCPI
Operation complete*OPC?*OPC?
Error queueNot in librarySYSTem:ERRor?
Models on this command setTGF4042, TGF4082, TGF4162, TGF4242AFG31022, AFG3102C, AFG31052, AFG31102, AFG31152, AFG31252, AFG3252C

Commands both accept

9 command headers are in both libraries.

CommandWhat it does
*TRGTrigger Now. Issues a manual/bus trigger.
*IDN?Identify. Returns the instrument identification string (manufacturer, model, serial, firmware).
*RSTReset. Resets the instrument to its default state.
*CLSClear Status. Clears all status registers.
*TST?Self Test. Runs the self-test and returns 0 for pass.
*OPC?Operation Complete. Returns 1 when all pending operations are complete.
*WAIWait To Continue. Waits until all pending operations are complete.
*SAV <Slot>Save Setup. Stores the current setup to a memory slot (0 to 9).
*RCL <Slot>Recall Setup. Recalls a setup from a memory slot (0 to 9).

Only on the Aim-TTi TGF4042

21 command headers in the TGF4042 library have no match in the AFG31022 library. Below are 6 of them from the 6 largest subsystems; the full list is in the Aim-TTi TGF4042 command reference.

AMPL (1 only on the TGF4042)

CommandWhat it does
AMPL <Amp>Set Amplitude CH1. Sets the output amplitude (Vpp).

ARBLOAD (1 only on the TGF4042)

CommandWhat it does
ARBLOAD <Name>Set Arb Waveform CH1. Selects the arbitrary waveform by name.

BEEPMODE (1 only on the TGF4042)

CommandWhat it does
BEEPMODE ONBeep On. Enables the beeper.

BST (1 only on the TGF4042)

CommandWhat it does
BST OFFTurn Off Burst CH1. Disables burst mode.

BSTCOUNT (1 only on the TGF4042)

CommandWhat it does
BSTCOUNT <N>Set Burst Count CH1. Sets the number of cycles per burst.

BSTPHASE (1 only on the TGF4042)

CommandWhat it does
BSTPHASE <Deg>Set Burst Phase CH1. Sets the burst start phase.

Only on the Tektronix AFG31022

72 command headers in the AFG31022 library have no match in the TGF4042 library. Below are 16 of them from the 6 largest subsystems; the full list is in the Tektronix AFG31022 command reference.

SOURce (59 only on the AFG31022)

CommandWhat it does
SOURce<Channel>:FUNCtion:SHAPe <Shape>Set Function. Sets the output waveform shape for the selected channel.
SOURce<Channel>:FUNCtion:SHAPe?Read Function. Reads the output waveform shape for the selected channel.
SOURce<Channel>:FREQuency:FIXed <Freq>Set Frequency. Sets the output frequency in Hz for the selected channel.
SOURce<Channel>:FREQuency:FIXed?Read Frequency. Reads the output frequency for the selected channel.

OUTPut (5 only on the AFG31022)

CommandWhat it does
OUTPut<Channel>:STATe ONTurn On Output. Enables the selected channel output.
OUTPut<Channel>:STATe?Read Output State. Reads whether the selected channel output is on.
OUTPut<Channel>:IMPedance <Ohm>Set Output Impedance. Sets the the selected channel output load impedance in ohms (1 to 10k).
OUTPut<Channel>:IMPedance?Read Output Impedance. Reads the the selected channel output load impedance.

TRIGger (4 only on the AFG31022)

CommandWhat it does
TRIGger:SEQuence:SOURce <Src>Set Trigger Source. Sets the trigger source.
TRIGger:SEQuence:SLOPe <Slope>Set Trigger Slope. Sets the external trigger slope.
TRIGger:SEQuence:TIMer <Sec>Set Trigger Timer. Sets the internal trigger timer period.
TRIGger:SEQuence:IMMediateTrigger Now. Issues an immediate (manual) trigger.

SYSTem (2 only on the AFG31022)

CommandWhat it does
SYSTem:ERRor?Read Error. Reads and clears the next error-queue entry.
SYSTem:BEEPer:STATe ONEnable Beeper. Enables the beeper.

DISPlay (1 only on the AFG31022)

CommandWhat it does
DISPlay:BRIGhtness <Level>Enable Display. Sets the display brightness (0 to 1).

IEEE 488.2 common (*) (1 only on the AFG31022)

CommandWhat it does
*OPT?Read Options. Queries the installed options.

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 on the TGF4042 and SOURce:ROSCillator:SOURce INTernal on the AFG31022. For the reading, the two libraries have no common command with a worked example on both, so each instrument uses its own: EER? on the TGF4042 and SYSTem:ERRor? on the AFG31022. 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_TGF4042_ADDRESS")  # Aim-TTi TGF4042
b = rm.open_resource("PASTE_AFG31022_ADDRESS")  # Tektronix AFG31022
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
a.write("OUTPUT ON")  # Turn On Output CH1
b.write("SOURce:ROSCillator:SOURce INTernal")  # Set Clock Internal

# No shared reading with an example on both, so each uses its own command
print(a.query("EER?"))  # Read Error
print(b.query("SYSTem:ERRor?"))  # Read Error

a.close()
b.close()

Run this on your bench

Describe the test; TestFlow's agent uses these command sets to drive your Aim-TTi TGF4042 or Tektronix AFG31022 and writes the report from the measured results.

Get started

Frequently asked questions

What is the difference between the Aim-TTi TGF4042 and the Tektronix AFG31022 for remote control?

In TestFlow's library the TGF4042 has 68 SCPI commands and the AFG31022 has 95 SCPI commands. 9 command headers are common to both, 21 are only on the TGF4042 (mostly AMPL and ARBLOAD), and 72 are only on the AFG31022 (mostly SOURce and OUTPut).

Can I use the same SCPI code for the Aim-TTi TGF4042 and the Tektronix AFG31022?

Partly. 9 command headers are accepted by both. 93 are not, for example AMPL on the TGF4042 and SOURce<Channel>:FUNCtion:SHAPe on the AFG31022, so a script that uses those needs a separate branch for each instrument.

Which has more remote commands, the TGF4042 or the AFG31022?

The AFG31022: 68 commands for the TGF4042 against 95 for the AFG31022 in TestFlow's library. Of those, 4 on the TGF4042 and 12 on the AFG31022 are queries that read a value or state, and the library splits them into 29 and 9 subsystems.

How do the TGF4042 and AFG31022 signal operation complete and report errors?

Both libraries synchronise with *OPC?. Only the AFG31022 library has an error-queue read (SYSTem:ERRor?); the TGF4042 library has none. 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.