Keithley 6512 Instruction Manual page 148

Programmable electrometer
Table of Contents

Advertisement

Example Programs
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-
Program 3. SRQ and status byte program
' Program to demonstrate Model 6512 SRQ and status byte.
OPEN "IEEE" FOR OUTPUT AS #1
OPEN "IEEE" FOR INPUT AS #2
PRINT #1, "REMOTE 27"
PRINT #1, "CLEAR"
CLS
PRINT #1, "OUTPUT 27;M32X"
PRINT #1, "OUTPUT 27;K5X"
DO: PRINT #1, "SRQ?"
INPUT #2, S
LOOP UNTIL S
PRINT #1, "OUTPUT 27;U1X"
PRINT #1, "ENTER 27"
INPUT #2, S$
PRINT "U1 Error word: "; S$
PRINT #1, "SPOLL 27"
INPUT #2, S
M = 128
PRINT : PRINT "Status byte:": PRINT
PRINT "B7 B6 B5 B4 B3 B2 B1 B0"
FOR I = 1 TO 8
IF (M AND S) THEN PRINT "1 "; ELSE PRINT "0 ";
M = M / 2
NEXT I
PRINT
END
D-4
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.
' Open IEEE-488 output path.
' Open IEEE-488 input path.
' Put 6512 in remote.
' Send DCL.
' SRQ on error.
' Program illegal option.
' Loop until SRQ occurs.
' Request error word.
' Address 6512 to talk.
' Input status word.
' Serial poll to get status byte.
' Define mask.
' Loop to display bits.
' Shift mask bit right.

Advertisement

Table of Contents
loading

Table of Contents