Keithley 3930A Operator's Manual page 99

Hide thumbs Also See for 3930A:
Table of Contents

Advertisement

SECTION 4
GPIB Interface
4.7
SAMPLE
PROGRfAMS
This paragraph presents two sample programs to control
the Model 3930A using an HIP 9816 (or equivalent)
per-
sonal computer as the controiler. The primary address of
the Model 3930A GPIB interface is assumed to be 2, and
the delimiter
is <CR><LF>.
Sample program 1 allows you to type in program codes
and send them to the Model 3930A. When the program
code begins with a "?", the Model 3930A is addressed to
talk after the program code is transferred. The response is
then read by the controller
and displayed
on the CRT.
When an error occurs, a serial poll is performed, the error
code is read, and an error message is displayed
on the
CRT.
Sample program 2 includes :subroutines for sending in-
terface messages IFC, DCL, :SDC, LLO, and GTL to the
Model 3930A and the subroutines
to set REN true or
false.
Sample Program 1
100
PRIVTER IS I
110
DIM
C%[BOl
120 ON TlHEOlT 7.20 COSljB 690
130 ABORT 7
140 CLEAR 7
150
REMOTE 702
160 OUTPUT 702:"HSK 3,"
170
ON INTR 7 COT0 280
180 !
190
ENABLE INTR 7:2
200
INPUT "INPUT PROGRAM CODE".C$
210
PRINT
220
PRINT -COHHAND - ",C$
230
OLlTPUT 702:C%
240
IF POS(C$.'?')
THEN CO:jUB 720
250
FOR I-O TO 500
260
lvEXT I
270 COT0 190
280 !
290
PRINT "tt: ERROR SERVICE ROUTINE W
300
S-SPOLL(702)
310
OUTPUT 702;"?ERR-
320
ENTEK 702:E%
330
OUTPUT 702:"?HDR"
340
ENTER 702:H$
350
IF HS-"HDR I" THEN
360
E-VhL(E$C4.61)
370
ELSE
380
E-VhL(E$)
390
E';D IF
400
SELECT E
410
CASE 0
420
PKINT ~
(ERROR 00) CPIB I:KKOR I-
430
CASE I
440
PRI\IT ~
(ERROR 01) LIT
ERROR !~
450
CASE 2
460
PRIUT "
(ERROR 02) FREQ ERROR !-
470
CASE 3
480
PRlhT ~
(CKRUK 03) WAS ,:KK"K !~
4YO
CASE 4
500
PRINT "
(ERROR 04) AHPT ERROR !~
510
CASE 5
520
PRINT ~
(ERROR 05) OFST ERROR !~
530
CASE 6
540
PRINT ~
(ERROR 06) ACDC ERROR !~
550
CASE 7
560
PRINT ~
(CKKOK 07) t'KDT ERRIlK !-
570
CASE 8
580
PRINT "
(ERROR 08) SirP ERROR !-
590
CASE 9
GO0
PRINT ~
(ERROR 09) RICE ERROR !-
610
CASE IQ
620
PKI\T ~
(EKKOK 10) CNVT EKKUK I-
630
CASE II
640
PRIST ~
(ERROR II)
MEMO ERROR !-
650
CASE 12
ti60
PRI\T ~
(I:RKOR 12) \;ODT IEHROR !-
670
EKD SELECT
680 GOT0 190
690 !
700
PRINT "tt
CPIB Hans UP tt-
710
RETURLI
720 !
730
ENTER 702:C$
740
PRINT ~ ANSYER - ".C$
750
RETURN
160
!
770
END
4-43

Advertisement

Table of Contents
loading

Table of Contents