R&S SMB Instrument Model and Command Processing
1407.0806.32 5.21 E-2
If a particular device action can be performed only after the execution of a previous overlapped
command, the controller must know when the overlapped command has finished. The necessary
interaction between the controller and the test instrument is called command synchronization.
Command Sequence
According to section "Database and Instrument Hardware", overlapped execution is possible in principle
for all commands of the signal generator. Equally, setting commands within one command line are not
necessarily serviced in the order in which they have been received.In order to make sure that
commands are actually carried out in a certain order, each command must be sent in a separate
command line (see also example in section "Database and Instrument Hardware").
Example : Commands and queries in one command line
The response from a query combined in a program message with commands that affect the queried
value is not predictable. Sending
SOURce:FREQuency 1E+9; LEVel -80
SOURce:FREQuency?
always returns 1E+9 (1GHz). When:SOURce:FREQuency 1E+9; FREQuency?; LEVel -80
is sent, however, the result is not specified by SCPI. The result could be the RF generator frequency
before the command was sent since the instrument might defer executing the individual commands until
a program message terminator is received. The result could also be 1GHz if the instrument executes
commands as they are received.
As a general rule, send commands and queries in different program messages.
Command Synchronization
In order to prevent an overlapped execution of commands, one of commands *OPC, *OPC? or *WAI
can be used. All three commands cause a certain action only to be carried out after the hardware has
been set and has settled. By suitable programming, the controller can be forced to wait for the
respective action to occur (see table).
Synchronization with *OPC, *OPC? and *WAI
Command Action Programming the controller
*OPC Sets the Operation Complete bit in the ESR
after all previous commands have been
executed.
- Setting bit 0 in the ESE
- Setting bit 5 in the SRE
- Waiting for service request (SRQ)
*OPC? Stops command processing until 1 is
returned. This is only the case after the
Operation Complete bit has been set in the
ESR. This bit indicates that the previous
setting has been completed.
Sending *OPC? directly after the command whose
processing should be terminated before other commands
can be executed.
Disabling bit 4 (MAV) of the SRE register.
Alternative: Service request or timeout method with enabled
MAV bit; see below.
*WAI Stops further command processing until all
commands sent before *WAI have been
executed.
Note: While waiting it is still possible to send
messages to the device.
Sending *WAI directly after the command whose processing
should be terminated before other commands are executed.