Agilent Technologies E1300B Computer Hardware User Manual


 
Example: Synchronizing an External Computer and Two Instruments
using the *OPC command.
This example uses the *OPC command and serial poll to synchronize an
external computer and two instruments (DAC at secondary address 09;
Scanning Voltmeter at secondary address 03). The advantage to using this
method over *OPC? query method is that the computer can do other operations
while it is waiting for the instrument(s) to complete operations. When using this
method, the Operation Complete bit (bit 0) must be the only enabled bit in the
Standard Event Status Register (*ESE 1 command). If other bits (such as error
bits) are enabled, you must make sure that bit 0 causes the interrupt.
10 OUTPUT 70909;"*CLS"
!Clear all status structures on instrument at secondary address
09
20 OUTPUT 70909;"*ESE 1"
!Enable Operation Complete to be reflected in bit 5 of the
Status Byte Register
30 OUTPUT 70909;"SOUR:VOLT1 5;*OPC"
!Configure instrument # 1, set Operation Complete bit when
done
40 WHILE NOT BIT(SPOLL(70909),5)
!While waiting for bit 5 in instrument’s Status Byte Register to
be set,
!computer can do other operations
50 !(Computer does other operations here)
60 END WHILE
70 OUTPUT 70903;"MEAS:VOLT:DC? (@104)"
!Measure DC voltage using instrument # 2
80 END
Controlling Instruments Using GPIB 6-13