Programming Examples
Agilent
8169A
Polarization Controller, Second Edition
87
Example 2 - Status Registers and Queues
Function
This program sends a commands and queries typed in by the user. The
contents of the status byte and the standard event status register are
displayed. These registers are updated for each new command, and each
time a Service ReQuest (SRQ) occurs. The number of the most recent error,
and the most recent contents of the output queue is also displayed.
Listing
Table 15
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
!--------------------------------------------------------
!
! Agilent 8169A Programming Example 2
!
! Status Structure and a useful self lesrning tool
!
!--------------------------------------------------------
!
! Declarations and initialization
!
INTEGER Value,Bit,Quot,Xpos,Ypos
DIM Inp$ [100]
DIM A$ [300]
Pol=724
ON INTR 7 GOSUB Pmm_srq
!
! Mask the registrers
!
OUTPUT Pol; “=SRE 248
The *SRE 248 command enables bits 7 (Operation Status Summary), 5 (ESB), 4 (MAV),
and 3 (Questionable Status Summary) in the status byte (bit 6 (SRQ) cannot be disabled in
this register).
The *ESE 255 command enables all of the bits in the Event Status Register.
200
210
220
230
240
250
260
270
280
290
300
310
320
!
! Set up the screen
!
CLEAR SCREEN
PRINT TABXY (40, 3); “Status Byte”
PRINT TABXY (4, 1); “ OPS SRQ ESB MAV QUE “
PRINT TABXY (4, 2); “ +
---
+
---
+
---
+
---
+
---
+
---
+
---
+
---
+ “
PRINT TABXY (4, 3); “ : “
PRINT TABXY (4, 4); “ +
---
+
---
+
---
+
---
+
---
+
---
+
---
+
---
+ “
PRINT TABXY (4, 5); “ ^ “
PRINZT TABXY (4, 6) ; “ : “
PRINZT TABXY (4, 7) ; “ +--------------------------------------+
PRINZT TABXY (4, 8) ; “ : OR : “