Program fragment
GOSUB Read Register 'Clear register by reading it
PRINT #1, "output 16; :init 'Place 2016 in idle
:cont off; :abort"
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 2016 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 2016
LINE INPUT #2, a$ 'Read decimal value of register
PRINT a$
RETURN
Remote Operation 4-39