Agilent Technologies 8156A Operating And Programming Manual page 135

Attentuator
Table of Contents

Advertisement

Programming Examples
Example 2 - Status Registers and Queues
890
900
910
ue contents
920
930
940
950
960
970
980
990
1000
1010
1020
1030
1040
1050
1060
1070
1080
1090
1100
1110
1120
d Events
1130
1140
1150
1160
1170
1180
1190
1200
1210
1220
1230
1240
1250
1260
1270
The SYSTEM:ERROR? query gets the number of the last error in the error queue.
1280
1290
1300
1310
fore returning
1320
1330
1340
1350
1360
1370
1380
134
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Value=Value-Bit
!
! If MAV is set, then get and display the output que
!
IF Z=0 THEN
IF Bit=16 THEN
ENTER Att;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 Standar
! Status Register
!
OUTPUT Att;"*ESR?"
ENTER Att;Value
!
! Set up to display the ESR
!
Ypos=12
NEXT Z
!
! Read and display any messages in the error queue
!
REPEAT
OUTPUT Att;"SYSTEM:ERROR?"
ENTER Att;Value,A$
IF Value<>0 THEN PRINT TABXY(21,17);Value,A$
UNTIL Value=0
!
! Clear the Status structure and reenable the interrupt be
!
OUTPUT Att;"*CLS"
ENABLE INTR 7
!
RETURN
!
END

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents