SCPI Command Completion

SCPI commands sent to the power supply are processed either sequentially or in parallel. Sequential commands finish execution before a subsequent command begins. A parallel command can begin execution while a preexisting command is still executing (overlapping commands). Commands that affect trigger actions are among the parallel commands.

The *WAI, *OPC, and *OPC? common commands provide different ways of indicating when all transmitted commands, including any parallel ones, have completed their operations. The syntax and parameters for these commands are described in Chapter 7 - "Language Dictionary". Some practical considerations for using these commands are as follows:

*WAI

This prevents the power supply from processing subsequent commands until all pending operations

 

are completed. If something prevents completion of an existing operation, *WAI can place the power

 

supply and the controller in a "hang- up" condition.

*OPC?

This places a 1 in the Output Queue when all pending operations have completed. Because it

 

requires your program to read the returned value from the queue before executing the next program

 

statement, *OPC? could prevent subsequent commands from being executed.

*OPC

This sets the OPC status bit when all pending operations have completed. Since your program can

 

read this status bit on an interrupt basis, *OPC allows subsequent commands to be executed.

The trigger subsystem must be in the Idle state in order for the status OPC bit to be true. Therefore, as far as triggers are concerned, OPC is false whenever the trigger subsystem is in the Initiated state. However, OPC is also false if there are any commands still pending.

Note

For a detailed discussion of *WAI, *OPC and *OPC?, see "Device/Controller Synchronization Techniques"

 

in ANSI/IEEE Std 488.2.

Programming Examples

The examples given here are generic, without regard to the programming language or type of GPIB interface. Because SCPI commands are sent as ASCII output strings within the programming language statements, the SCPI syntax is independent of both programming language and interface.

Note

The examples are followed by sample program code written for three popular types of BASIC-controlled

 

GPIB interfaces.

 

 

Important

The power supply responds simultaneously to both digital and analog progamming inputs. If it is

 

receiving an input over the GPIB and a corresponding input from the front panel (and/or from the analog

 

programming port), the power supply output will be the algebraic sum of the inputs.

 

 

52 Remote Programming

Page 52
Image 52
Agilent Technologies E4356A manual Scpi Command Completion, Programming Examples, Wai, Opc?