7 - 2
7.2 Program to Read Parameter Settings from Disk, Display Them on
Screen, and Set up VR200
100 ‘************************************************************
110 ‘** RS422A Example Program for IBM PC **
120 ‘** **
130 ‘** To read setting information **
140 ‘** **
150 ‘************************************************************
160 ‘**
170 ‘** Baud rate: 1200 Stop bit: 1 bit
180 ‘** Parity: none Control: OFF/OFF
190 ‘**
Data length: 8 bits Others: LF is sent automatically.
200 ‘**
210 ‘
220 OPEN “COM1:1200,N,8,1,LF” AS #1
230 OPEN “TEST.DAT” FOR INPUT AS #2
240 ‘
250 PRINT #1,CHR$(27)+”O 01"
260 LINE INPUT #2,D$: PRINT D$
270 IF LEFT$(D$,2)=”EN” THEN GOTO 340 :’ Watch data end
280 PRINT #1,D$
290 PRINT #1,CHR$(27)+”S”; :’ For protect receive buffer overflow
300 LINE INPUT #1,D$
310 PRINT D$
320 GOTO 260
330 ‘
340 PRINT #1,CHR$(27)+”C 01"
350 CLOSE
360 END