7.2Program 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‘
220OPEN “COM1:1200,N,8,1,LF” AS #1
230OPEN “TEST.DAT” FOR INPUT AS #2
240‘
250PRINT #1,CHR$(27)+”O 01"
260LINE INPUT #2,D$: PRINT D$
270 | IF LEFT$(D$,2)=”EN” THEN GOTO 340 :’ Watch data end |
280 | PRINT #1,D$ |
290PRINT #1,CHR$(27)+”S”; :’ For protect receive buffer overflow
300LINE INPUT #1,D$
310PRINT D$
320GOTO 260
330‘
340PRINT #1,CHR$(27)+”C 01"
350CLOSE
360END
7 - 2