Remote Control Basics
R&S
®
SMB100A
267
Operating Manual 1407.0806.32 ─ 21
Example: Commands and queries in one message
The response to a query combined in a program message with commands that affect
the queried value is not predictable.
The following commands always return the specified result:
:FREQ:STAR 1GHZ;SPAN 100 :FREQ:STAR?
Result:
1000000000
(1 GHz)
Whereas the result for the following commands is not specified by SCPI:
:FREQ:STAR 1GHz;STAR?;SPAN 1000000
The result could be the value of
STARt
before the command was sent since the instru-
ment can defer executing the individual commands until a program message termina-
tor is received. The result could also be 1 GHz if the instrument executes commands
as they are received.
As a general rule, send commands and queries in different program messages.
Example: Overlapping command with *OPC
The instrument implements
INITiate[:IMMediate]
as an overlapped command.
Assuming that
INITiate[:IMMediate]
takes longer to execute than
*OPC
, sending
the following command sequence results in initiating a sweep and, after some time,
setting the
OPC
bit in the
ESR
:
INIT; *OPC.
Sending the following commands still initiates a sweep:
INIT; *OPC; *CLS
However, since the operation is still pending when the instrument executes
*CLS
, forc-
ing it into the "Operation Complete Command Idle" state (OCIS),
*OPC
is effectively
skipped. The
OPC
bit is not set until the instrument executes another
*OPC
command.
6.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. By suitable programming, the controller
can be forced to wait for the corresponding action to occur.
Command Sequence and Synchronization