51
4.10.2 SCPI Command Structure
SCPI commands are based on a hierarchical structure. This allows the same instrument-control header to be used
several times for different purposes, providing that the mnemonic occurs in a unique position in the hierarchy.
Each level in the hierarchy is defined as a node. Mnemonics in the different levels are separated from each other
by a colon (':'). The first Program Message Unit, or command, in a Program Message is always referenced to the
root node. Subsequent commands are referenced to the same level as the previous command. A Program Message
Unit having a colon as its first character causes the reference to return to the root. This process is defined by IEEE
488.1, section A.1.1. Consider the following examples:
a) The following command may be used to set the amplitude and the offset of the signal.
SOURCE:VOLTAGE:AMPLITUDE 5V;OFFSET 2V
Note that the offset command is referenced to the command preceding it: the OFFSET mnemonic resides at the
same node as the AMPLITUDE command.
b) This command set the frequency and the amplitude.
SOURCE:FREQUENCY 2KHZ;VOLTAGE:AMPLITUDE 4V
The FREQUENCY and VOLTAGE mnemonics are at the same level.
c) When Program Message Units describe different subsystems, a colon prefix must be used to reset the
command reference to the root. Here the frequency and the output state are set.
SOURCE:FREQUENCY 3KHZ;:OUTPUT:STATE ON
Common Commands may be inserted in the Program Message without affecting the instrument-control
command reference. For example,
SOURCE:VOLTAGE:AMPLITUDE 4V;*ESE 255;OFFSET 2V
FOR MODEL 4079 ONLY:
Exclusively for the model 4079 with multiple channels, the selection of which channel to use is achieved through
the use of a numeric suffix indicating the channel, attached to the root level mnemonic. Four root level mnemonics
are channel-dependent, and these are SOURce, TRIGger, OUTPut and ARBitrary. When the channel is not
specified, channel 1 is assumed by default. Program message units that are referred back to a specific root level
mnemonic operate on the channel specified in that mnemonic.
Examples:
a)
SOUR:FREQ 5KHZ;VOLT:AMPL 3V
Sets the frequency and amplitude of the first channel (default).
b)
SOUR2:FREQ 5KHZ;VOLT:AMPL 3V
Sets the frequency and amplitude of channel 2.
c) ARB2:START 100;LENGTH 50
Sets the start address and length of the waveform being output on channel 2.
4.11 Status Reporting
The instrument is capable of reporting status events and errors to the controller, using the IEEE 488.1 Service