User guide

8-1
IM DR231-11E
Sample Program
8
8.1 GP-IB Sample Programs
This section describes sample program for a system using PC 9801 series (NEC) with National
Instruments GP-IB.
Sample programs in this manual are writen in N88-BASIC(Standard language for PC9801 series).
We hope that these samples will aid you in creating your own program.
GP-IB Address
ALL the sample programs given in this chapter use address 1 for DR130/DR230/DR240.
Setting the personal Computer
Be carefull when receiving BINARY data that the received data does not overrun the capacity of the
receive buffer in the personal computer which may be small as 255 bytes in some case.
Output the Setting Data
Read out the setting data from DR130/DR230/DR240, display them on CRT of personal computer,
and save them to floppy disk.
10 'TS1 <GET> LF
20 OPEN "TS1.DAT" FOR OUTPUT AS #1
30 ISET IFC
40 CMD DELIM=0
50 PRINT @1;"TS1"
60 WBYTE &H3F,&H21,&H8,&H3F;
70 PRINT @1;"LF001,010"
80 LINE INPUT @1;D$:PRINT D$:PRINT #1,D$
90 LINE INPUT @;D$:PRINT D$:PRINT #1,D$
100 IF LEFT$(D$,2)<>"EN" GOTO 90
110 CLOSE:STOP
120 END
Write the Setting Data to DR130/DR230/DR240
Read out the setting data from floppy disk, display them on CRT of personal computer, and write
them to DR130/DR230/DR240.
10 'SETTEI
20 ISET IFC
30 ON SRQ GOSUB *SSS
40 POLL 1,B
50 SRQ ON
60 OPEN "TS1.DAT" FOR INPUT AS #1
70 ISET IFC
80 CMD DELIM=0
90 PRINT @1;"IM2"
100 LINE INPUT #1,D$
110 IF LEFT$(D$,2)="EN" GOTO 140
120 PRINT @1;D$:PRINT D$
130 GOTO 100
140 CLOSE:STOP
150 END
160 '
170 *SSS
180 POLL 1,B
190 IF (B AND &H42)=&H42 THEN PRINT "SYNTAX ERROR"
200 RETURN