Srq And Serial Poll; Measurements; Gpib Interface - Keithley 3321 Operator's Manual

Lcz meter
Table of Contents

Advertisement

+
SECTION 4
GPIB
Interface
4.9.4
SRQ and Serial Poll
The following
sample program
will acquire measured
data using SRQ. Measurements
are performed
at a fre-
quency of 1kHz and are displayed on the computer CRT.
Make sure the GPIB was previously initialized (see para-
graph 4.9.1) before using this program.
Sample program to SRQ and serial poll:
100 DIM A$[641
110 OUTPUT 702;"FR lE3;DA 2;DB l;CK 2"
120 ON INTR 7 GOSUB 200
130 OUTPUT 702; "RQ 1"
140 OUTPUT 702; "TG"
150 ENABLE INTR 7;2
160 GOT0
160
170 !
180 !
200 S=SPOLL (702)
210 IF BINAND(S,64)=0
THEN 260
220 OUTPUT 702; "?DT"
230 ENTER 702;A$
!ENTER 702;C,D
240 PRINTA$
!l'RINT
"C=";C;"F,
D=";D
250 TRIGGER 702
260 ENABLE INTR 7
270 RETURN
Program Analysis:
Line No.
100
110
120
130
140
150
200
210
Comment
Assigns the length of the character string.
Sets measurement
conditions. Frequency
= lkHz,~DISPLAY
= C,mDISI'LAY
= D, parallel equivalent
circuit.
When SRQ is received, branch to the sub-
routines starting from line 200.
Enable SRQ of the instrument.
Applies the remote trigger to make meas-
urement.
Admits the SRQ interruption.
Performs the serial poll.
Confirms that the RQS bit of a status byte
is set, waits for the completion
of zero
correction.
220 to 240
250
260
Receives and displays measured values.
Applies a trigger by the GET command
and allows the instrument
to start the
next measurement.
Admits the next SRQ interruption.
4.9.5
Measurements
The following sample program measures an electrolytic
capacitor:
Sample program to measure electrolytic
capacitor:
100
DIM A$[641
110 ABORT 7
120 CLEAR 702
130 OUTPUT 702; "LV l;DA 2;DB 2"
140 OUTPUT 702;"B0
1"
150 Wtm=15
!wait time (s)
160 T=TIMEDATE+Wtm
170 WHILE TIMEDATE<T
180 END WHILE
200
RESTORE Flist
210
PRINT "FREQ(Hz)
C(F)
ESR(ohm)"
220
READ F$
230
WHILE F$<>"*"
240
OUTPUT 702; "FR" &F$
250
Wtm=2
260
T=TIMEDATE+Wtm
270
WHILE TIMEDATEcT
280
END WHILE
290
OUTPUT 702e"TG"
300
PRINT ,, ,,&&/
I,;
310
ENTER 702;A$
320
PRINT A$
330
READ F$
340
END WHILE
350
OUTPUT 702; "BO 0"
360
PRINT
370 PRINT "End of job"
380 STOP
390
!
400
Flist: !
410
! Frequency list
420 DATA "120", "lE3", "lOE3", "lOOE3", I'*"
430 END
+
4-21

Advertisement

Table of Contents
loading

Table of Contents