68 Chapter2
Programming Fundamentals
SCPI Language Basics
Bad Command Good Command
IN:ATT 30dB INP:ATT 30dB
The short form of INPUT is INP, not IN.
FREQ 30MHz;ATT 20dBm FREQ 30MHz;POW:ATT 20dBm
The ATT command is in the same (SENSE) subsystem as FREQ, but
executing the FREQ command puts you back at the SENSE level. You must
specify POWER to get to the ATT command.
FREQ 30MHz;POW:ATT 20dB:LOW
3dBm
FREQ 30MHz;POW:ATT 20dB;LOW
3dBm
ATT and LOW are both in the same (SENSE) subsystem but they are two
separate commands and need a semicolon to separate them.
INP:ATT 6dB;:TRIG:POWER:ATT 6
dB
INP:ATT 6dB;:POWER:ATT 6 dB
POWER:ATT is in the SENSE subsystem, not the TRIGGER subsystem.
FREQ 10MHz;TRIG:HOLD 10ms FREQ 10MHz;:TRIG:HOLD 10ms
The FREQ command and the HOLDOFF command are not in the same
subsystem, so the command that follows must be preceded by a colon.
POW?:FREQ? POW?;FREQ?
POW and FREQ are within the same SENSE subsystem, but they are two
separate commands, so they should be separated with a semicolon, not a
colon.
INP:ATT -5dB;:FREQ 10MHz INP:ATT 5dB;:FREQ 10MHz
Attenuation should not be a negative value.