IEEE-488 Reference
3-33
*OPC — operation complete
Set the Operation Complete bit in the Standard Event Status
Register after all pending commands are complete.
On power-up, or when *CLS or *RST is executed, the Model 2002 goes into the Operation
Complete Command Idle State (OCIS). In this state there are no pending overlapped com-
mands. There are three overlapped commands used by the Model 2002:
:INITiate
:INITiate:CONTinuous ON
*TRG
When the *OPC command is sent, the Model 2002 exits from OCIS and enters the Operation
Complete Command Active State (OCAS). In OCAS, the instrument continuously monitors the
No-Operation-Pending flag. After the last pending overlapped command is complete (No-
Operation-Pending flag set to true), the Operation Complete (OPC) bit in the Standard Event
Status Register sets, and the instrument goes back into OCIS.
Note that the instrument always goes into OCAS when *OPC is executed. If there are no pend-
ing command operations (e.g. trigger model in idle state), the Model 2002 immediately sets the
OPC bit and returns to OCIS.
When used with the :INITiate or :INITiate:CONTinuous ON command, the OPC bit of the Stan-
dard Event Status Register will not set until the Model 2002 goes back into the idle state. The
initiate operations are not considered finished until the instrument goes into the idle state.
When used with the *TRG command, the OPC bit will not set until the operations associated
with the *TRG command (and the initiate command) are finished. The *TRG command is con-
sidered 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.8).
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 ini-
tiate command. Since continuous initiation is on, operation continues on into the Trigger Model.
After sending the *TRG command, the OPC bit sets when the *TRG command is finished.
GOSUB ReadRegister
' Clear register by reading it
PRINT #1, "output 16; :init:cont off; :abort"
' Place 2002 in idle
PRINT #1, "output 16; :init; *opc"
' Start measurements and send *OPC
SLEEP 2
' Wait two seconds
GOSUB ReadRegister
' Read register to show that OPC is not set
PRINT #1, "output 16; :abort"
' Place 2002 back in idle
GOSUB ReadRegister
' Read register to show that OPC is now set
END
ReadRegister:
PRINT #1, "output 16; *esr?"
' Query Standard Event Status Register
PRINT #1, "enter 16"
' Get response message from 2002
LINE INPUT #2, a$
' Read decimal value of register
PRINT a$
' Display decimal value of register
RETURN
3.10.5
Description
Program fragment
Summary of Contents for 2002
Page 123: ...Front Panel Operation 2 106...
Page 145: ...IEEE 488 Reference 3 22...
Page 167: ...IEEE 488 Reference 3 44...
Page 284: ...A Specifications A 1...
Page 362: ......
Page 364: ...This page left blank intentionally...
Page 365: ......