7.7 Program Example (Q Basic)
10 CLS
20 PRINT
30 PRINT
"
Program for remote control of UZ 2400 by PC
"
40 PRINT
"
-------------------------------------------
"
50 PRINT
"
[Ctrl_Break
→
end of program]
"
60 PRINT
70 OPEN
"
com1:1200,n,8,1
"
FOR RANDOM AS #1
80 REM rate 1200 bd,without parity, 8 data bits, 1 stop bit
90 COM(1) ON
100 ON COM(1) GOSUB 510
110 K$=INKEY$
120 IF K$=CHR$ (13) THEN GOSUB 210
130 GOTO 100
200 REM data transmission rate
210 INPUT
"
Input message ? .....
"
, A$
220 PRINT
230 PRINT #1, A$;CHR$ (10);
240 RETURN
500 REM receiving data
510 A$=INPUT$ (1,#1)
520 B$=B$+A$
530 IF A$ <> CHR$ (10) THEN GOTO 510
540 COLOR (12)
550 PRINT
"
received message:
"
, B$;
560 COLOR (7)
570 B$=
""
580 PRINT
590 RETURN
21
Operating Instructions UZ 2400
1/2000