Opc - Operation Complete - Keithley 2002 User Manual

Hide thumbs Also See for 2002:
Table of Contents

Advertisement

3.10.5
Description
Program fragment
*OPC — operation 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
PRINT #1, "output 16; :init:cont off; :abort"
PRINT #1, "output 16; :init; *opc"
SLEEP 2
GOSUB ReadRegister
PRINT #1, "output 16; :abort"
GOSUB ReadRegister
END
ReadRegister:
PRINT #1, "output 16; *esr?"
PRINT #1, "enter 16"
LINE INPUT #2, a$
PRINT a$
RETURN
Set the Operation Complete bit in the Standard Event Status
Register after all pending commands are complete.
' Clear register by reading it
' Place 2002 in idle
' Start measurements and send *OPC
' Wait two seconds
' Read register to show that OPC is not set
' Place 2002 back in idle
' Read register to show that OPC is now set
' Query Standard Event Status Register
' Get response message from 2002
' Read decimal value of register
' Display decimal value of register
IEEE-488 Reference
3-33

Advertisement

Table of Contents
loading

Table of Contents