Programming Examples
Agilent
8169A
Polarization Controller, Second Edition
89
840
850
860
870
880
890
800
910
920
930
940
950
960
970
980
990
1000
1010
1020
1030
1040
1050
1060
1070
1080
1090
1100
1110
1120
1130
1140
1150
1160
1170
1180
1190
1200
1210
1220
1230
1240
1250
1260
1270
1280
1290
1300
1310
1320
1330
1340
1350
1360
1370
1380
!
! If the bit is set then display 1
!
IF Quot>0 THEN
PRINT TABXY(Xpos,Ypos);"1"
Value=Value-Bit
!
! If MAV is set, then get and display the output queue contents
!
IF Z=0 THEN
IF Bit=16 THEN
ENTER Pol;A$
PRINT TABXY(21,18);A$
END IF
END IF
!
! If the bit is not set, then display 0
!
ELSE
PRINT TABXY(Xpos,Ypos);"0"
END IF
!
! Set up for the next iteration
!
Bit=Bit DIV 2
Xpos=Xpos+4
UNTIL Bit=0
!
! Now that the status byte is displayed, get the Standard Events
! Status Register
!
OUTPUT Pol;"*ESR?"
ENTER Pol;Value
!
! Set up to display the ESR
!
Ypos=12
NEXT Z
!
! Read and display any messages in the error queue
!
REPEAT
OUTPUT Pol;"SYSTEM:ERROR?"
ENTER Pol;Value,A$
The SYSTEM:ERROR? query gets the number of the last error in the error queue.
IF Value<>0 THEN PRINT TABXY(21,17);Value,A$
UNTIL Value=0
!
! Clear the Status structure and reenable the interrupt before returning
!
OUTPUT Pol;"*CLS"
ENABLE INTR 7
!
RETURN
!
END