Example Programs
D-4
D.7
SRQ and status byte program
Program 3 below demonstrates SRQ on error and how to ob-
tain and display the status byte. The instrument is first pro-
grammed for SRQ on error, and an illegal command option
(K5) is sent to generate the error. The U1 error word is re-
quested and displayed (note that the IDDCO bit is set), and
the status byte is then obtained by using serial polling. The
bits of the status byte are unpacked and displayed in MSB to
LSB order. Note that the RQS (B6) and error (B5) bits are
set; the ready bit (B4) may also be set.
Program 3. SRQ and status byte program
' Program to demonstrate Model 6512 SRQ and status byte.
OPEN "IEEE" FOR OUTPUT AS #1
' Open IEEE-488 output path.
OPEN "IEEE" FOR INPUT AS #2
' Open IEEE-488 input path.
PRINT #1, "REMOTE 27"
' Put 6512 in remote.
PRINT #1, "CLEAR"
' Send DCL.
CLS
PRINT #1, "OUTPUT 27;M32X"
' SRQ on error.
PRINT #1, "OUTPUT 27;K5X"
' Program illegal option.
DO: PRINT #1, "SRQ?"
' Loop until SRQ occurs.
INPUT #2, S
LOOP UNTIL S
PRINT #1, "OUTPUT 27;U1X"
' Request error word.
PRINT #1, "ENTER 27"
' Address 6512 to talk.
INPUT #2, S$
' Input status word.
PRINT "U1 Error word: "; S$
PRINT #1, "SPOLL 27"
' Serial poll to get status byte.
INPUT #2, S
M = 128
' Define mask.
PRINT : PRINT "Status byte:": PRINT
PRINT "B7 B6 B5 B4 B3 B2 B1 B0"
FOR I = 1 TO 8
' Loop to display bits.
IF (M AND S) THEN PRINT "1 "; ELSE PRINT "0 ";
M = M / 2
' Shift mask bit right.
NEXT I
END
Содержание 6512
Страница 2: ...Model 6512 Programmable Electrometer Instruction Manual Contains Operating and Servicing Information...
Страница 119: ...Maintenance 7 10 Figure 7 5 Exploded view...
Страница 131: ......