![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/0/0a/00a19d78-057b-4202-a355-9d23cfb48d1a/00a19d78-057b-4202-a355-9d23cfb48d1a-bg8c.png)
6 - 26
No. 99MBC071A
6.1.2.11 An example Program of GP-IB Communication Control
The following is an example BASIC program to run on the PC-9801 (NEC) computer.
80 CLS 3
90 PRINT "----------------------------------------------------"
100 PRINT " set the next "
110 PRINT " My address (2) "
120 PRINT " Delimiter (CR+LF) "
130 PRINT "----------------------------------------------------"
140 INPUT "<CR>---OK start",A$
150 '
160 ISET IFC :'interface clear
170 ISET REN :'remote on
180 CMD DELIM=0 :'delimiter set
190 '
200 A$="CL" :'-------------
210 PRINT "GP OUT=";A$
220 PRINT @2;A$
230 '
240 LINE INPUT @2;B$
250 PRINT "GP INP=";B$
260 IF B$="OK" THEN ELSE 200
270 '
280 A$="SET,SG2,M3,LL0,LH0,REF0,PR3,PRT0,SMP1"
290 PRINT "GP OUT=";A$
300 PRINT @2;A$
310 '
320 FOR T=1 TO 500 : '0.5 sec timer
330 NEXT T
340 '
350 LINE INPUT @2;B$
360 PRINT "GP INP=";B$
370 IF B$="OK" THEN ELSE 200
380 '
390 ON SRQ GOSUB 580
400 N=0
410 SRQ ON
420 '
430 '---------------------------------------------- C-RUN
440 IF N=0 THEN A$="SRQ" :GOTO 490
450 IF N=1 THEN A$="CR" :GOTO 490
460 IF N=10 THEN A$="CL" :GOTO 490
470 GOTO 520
480 '
490 PRINT "GP OUT=";A$ :'-------------
500 PRINT @2;A$
510 '
520 SRQ ON
530 FOR T=1 TO 2000 :'2 sec timer
540 NEXT T
550 '
560 END
570 '
580 '-----------------------------------------SRQ ROUTINE
590 SRQ STOP
600 N=N+1
610 PRINT "SRQ IN=";
620 POLL 2,P
630 PRINT P
640 IF (P AND &H10)=&H10 OR (P AND &H3F)=1 THEN ELSE RETURN 440
650 INPUT @2;B$,C$
660 C=VAL(C$)
670 PRINT "GP INP=";B$;",";" C=";C
680 RETURN 430
Wait for the response
Condition setting for SRQ interrupt
Confirming the "OK" response
Setting the measuring conditions
Transmitting the CL command
Repeat until "OK" is sent back
Initializing the GP-IB
Each command is transmitted
depending on the condition
• Entering the service request state for
the SRQ
• Transmit CR command for starting
continuous-run measurement
• Transmit STOP command for
terminating the measurement
Corresponding operation to the SRQ