Remote Control Basics > Command Sequence and Synchronization
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 implemented as sequential commands. Sequential commands are not implemented in the instrument, 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. Keeping the order is called synchronization between the controller and the instrument.

Setting commands within one command line, even though they can be implemented as sequential commands, are not necessarily serviced in the order in which they have been received. To make sure that commands are actually executed in a certain order, each command must be sent in a separate command line.

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 instrument can defer executing the individual commands until a program message terminator 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, forcing 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.

 


Imprint | Statement of Privacy | Terms & Conditions© 2017 ROHDE & SCHWARZ