IEEE-488 Reference
3-32
PRINT #1, "output 27; *esr?"
' Query Standard Event Status Reg-
ister
PRINT #1, "enter 27"
' Get response message from 6517A
LINE INPUT #2, a$
' Read decimal value of register
PRINT a$
' Display decimal value of register
RETURN
3.11.6 *OPC? — operation complete query
Place a 1 in the Output Queue after all pending operations are completed.
Description
On power-up, or when *CLS or *RST is executed, the Model 6517A goes into the Operation
Complete Command Query Idle State (OQIS). In this state there are no pending overlapped
commands. There are three overlapped commands used by the Model 6517A:
:INITiate:CONTinuous ON :INITiate
*TRG
When the *OPC? command is sent, the Model 6517A exits from OQIS and enters the Operation
Complete Command Active State (OQAS). In OQAS, the instrument continuously monitors the
No-Operation-Pending flag. After the last pending overlapped command is completed (No-Op-
eration- Pending flag set to true), an ASCII character 1 is placed into the Output Queue, the Mes-
sage Available (MAV) bit in the Status Byte sets, and the instrument goes back into OQIS.
Addressing the Model 6517A to talk sends the ASCII 1 to the computer.
Note that the instrument always goes into OQAS when *OPC? is executed. If there are no pend-
ing command operations (e.g. trigger model in idle state), the Model 6517A immediately places
an ASCII “1” in the Output Queue, sets the MAV bit and returns to OQIS.
When used with the :INITiate or :INITiate:CONTinuous ON command, an ASCII “1” will not
be sent to the Output Queue and the MAV bit will not set until the Model 6517A goes back into
the idle state. The initiate operations are not considered finished until the instrument goes into
the idle state.
NOTE
The :INITiate:POFLag command (see paragraph 3.24.1) is used to include or
exclude the No-Operation-Pending flag in the internal process of determining
whether all pending operations of an initiate command are completed.
When used with the *TRG command, an ASCII 1 will not be placed into the Output Queue and
the MAV bit will not set until the operations associated with the *TRG command (and the ini-
tiate command) are finished. The *TRG command is considered to be finished when the Device
Action completes or when operation stops at a control source to wait for an event (see Trigger
Model in paragraph 3.9).
In order to use *OPC? exclusively with the *TRG command you will have to first force the com-
pletion of the initiate command so that only the *TRG command is pending. To do this, send the
:ABORt command to place the instrument in idle, which (by definition) completes the initiate
command. Since continuous initiation is on, operation continues on into the Trigger Model. Af-
ter sending the *TRG command, an ASCII 1 is placed in the Output Queue and the MAV bit sets
when the *TRG command is finished.
After *OPC? is executed, additional commands cannot be sent to the Model 6517A until the
pending overlapped commands have finished. For example, :INITiate:CONTinuous ON fol-
lowed by *OPC? locks up the instrument and requires a device clear (DCL or SDC) before it
will accept any more commands.