
66
Interrupt Functions
Section 5-5
Application Example
The ON COM command is often used in conjunction with the INPUT$ function
as shown below. (STX% = &H02, ETX% = &H03, Receive data =
0<LOC(2)<255)
Example 1
Example 2
Example 3
Example 4
Example 5
200
ON COM 1 GOSUB 1000
210
COM 1 ON
Communications interrupt enabled
1000
Interrupt subroutine
RETURN
100
ON COM 2 GOSUB 500
110
COM 2 ON
120
GOTO 120
500
A$ = INPUT$(LOC(2),#2)
510
RETURN
If data is received, all the data in the receive
buffer is stored in A$.
100
ON COM 2 GOSUB 500, CODE = ETX%
110
COM 2 ON
120
GOTO 120
500
A$ = INPUT$(LOC(2), #2)
510
RETURN
If ETX% is received, all data in the receive
buffer is stored in A$.
100
ON COM 2 GOSUB 500, BYTE = 20
110
COM 2 ON
120
GOTO 120
500
A$ = INPUT$(20, #2)
510
RETURN
If 20 characters are received, 20 charac-
ters from the receive buffer are stored in
A$.
100
ON COM 2 GOSUB 500, HEAD = 02, TERM = 03
110
COM 2 ON
120
GOTO 120
500
A$ = INPUT$(LOC(2), #2)
510
RETURN
If ETX% is received from STX%, all data in
the receive buffer is stored in A$.
100
ON COM 2 GOSUB 500, HEAD=STX%, BYTE = 20
110
COM 2 ON
120
GOTO 120
500
A$ = INPUT$(LOC (2), #2)
510
A$ = RIGHT$(A$, 20)
520
RETURN
If 20 characters are received from STX%,
20 characters from the receive buffer are
stored in A$.
Caution is required, because the the next
data may already have been placed in the
receive buffer.
Summary of Contents for C200H-ASC11
Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Page 2: ...iv...
Page 4: ...vi...