7.4Program to Output Measured Data (in ASCII Code) from VR200 and Write to Disk
| 100 | ‘************************************************************ | ||
| 110 | ‘** | RS422A Example Program for IBM PC | ** | 
| 120 | ‘** | 
 | ** | 
| 130 | ‘** | To input and save measured data | ** | 
| 140 | ‘** | (ASCII code) | ** | 
| 150 | ‘** | 
 | ** | 
160‘************************************************************
170‘**
| 180 | ‘** | Baud rate: 1200 | Stop bit: 1 bit | 
| 190 | ‘** | Parity: none | Control: OFF/OFF | 
| 200 | ‘** | Data length: 8 bits | Others: LF is sent automatically. | 
210‘**
220‘
230OPEN “COM1:1200,N,8,1,LF” AS #1
240OPEN “TEST.DAT” FOR OUTPUT AS #2
250‘
| 260 LF$=CHR$(&HA) | :’ Line feed = 0AH | 
270PRINT #1,CHR$(27)+”O 01"
280PRINT #1,”TS0"
290PRINT #1,CHR$(27)+”T”;
300PRINT #1,”FM0,01,04"
310LINE INPUT #1,D$
320IF LEFT$(D$,1)=LF$ THEN D$=MID$(D$,2) :’ Remove “LF” of head string
330PRINT D$
340PRINT #2,D$
350IF MID$(D$,2,1)<>”E” THEN GOTO 310
360‘
370PRINT #1,CHR$(27)+”C 01"
380CLOSE
390END
7 - 4
