
Remote Control Basics
R&S
®
SGU100A
214
User Manual 1176.7726.02 ─ 09
A.4
Command Sequence and Synchronization
IEEE 488.2 defines a distinction between overlapped and sequential commands:
●
A sequential command is one which finishes executing before the next command
starts executing. Commands that are processed quickly are usually implemented
as sequential commands. Sequential commands are not implemented in the instru-
ment, however the execution time of most commands is so short that they act as
sequential commands when sent in different command lines.
●
An overlapping command is one which does not automatically finish executing
before the next command starts executing. Usually, overlapping commands take
longer to process and allow the program to do other tasks while being executed. If
overlapping commands do have to be executed in a defined order, e.g. in order to
avoid wrong measurement results, they must be serviced sequentially. This is
called synchronization between the controller and the instrument.
Setting commands within one command line, even though they may be implemented
as sequential commands, 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 cer-
tain order, each command must be sent in a separate command line.
As a general rule, send commands and queries in different program messages.
A.4.1
Preventing Overlapping Execution
To prevent an overlapping execution of commands, one of the 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. The controller can be forced to wait for the
corresponding action to occur.
Table A-4: Synchronization using *OPC, *OPC? and *WAI
Com-
mand
Action
Programming the controller
*OPC
Sets the Operation Complete bit in the ESR
after all previous commands have been exe-
cuted.
●
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 occurs when all pending opera-
tions are completed.
Send *OPC? directly after the command
whose processing must be terminated before
other commands can be executed.
*WAI
Stops further command processing until all
commands sent before *WAI have been exe-
cuted.
Send *WAI directly after the command whose
processing must be terminated before other
commands are executed.
Command synchronization using
*WAI
or
*OPC?
is a good choice if the overlapped
command takes only little time to process. The two synchronization commands simply
block overlapped execution of the command. Append the synchronization command to
the overlapping command, for example:
Command Sequence and Synchronization