Agilent Technologies E1301B Computer Hardware User Manual


 
1
Synchronizing an
External Computer
and Instruments
The *OPC? and *OPC commands (operation complete commands) allow you
to maintain synchronization between an external computer and an instrument.
The *OPC? query places an ASCII character 1 into the instrument’s output
queue when all pending instrument operations are finished. By requiring the
computer to read this response before continuing program execution, you can
ensure synchronization between one or more instruments and an external
computer.
The *OPC command sets bit 0 (Operation Complete Message) in the Standard
Event Status Register when all pending instrument operations are finished. By
enabling this bit to be reflected in the Status Byte Register, you can ensure
synchronization using the GPIB serial poll function.
Example: Synchronizing an External Computer and Two Instruments
using the OPC? query.
This example uses a D to A Converter module (DAC) at secondary address 09
and a Scanning Voltmeter at secondary address 03. The application requires the
DAC to output a voltage to a device under test. After the voltage is applied, the
voltmeter measures the response from the device under test. The *OPC?
command ensures that the voltage measurement will be made only after the
voltage is applied by the DAC.
10 OUTPUT 70909;"SOUR:VOLT1 5;*OPC?"
!Configure DAC to output 5 volts on channel 1; place 1 in
output
!queue when done
20 ENTER 70909;A
!Wait for *OPC? response
30 OUTPUT 70903;"MEAS:VOLT:DC? (@104)"
!Measure DC voltage on device under test
40 ENTER 70903;A
!Enter voltage reading
50 PRINT A
!Print reading
60 END
6-12 Controlling Instruments Using GPIB