Omron C200H-ASC11 Manual page 76

Ascii units
Hide thumbs Also See for C200H-ASC11:
Table of Contents

Advertisement

Interrupt Functions
Application Example
Example 1
100
110
120
500
510
Example 2
100
110
120
500
510
Example 3
100
110
120
500
510
Example 4
100
110
120
500
510
Example 5
100
110
120
500
510
520
66
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)
ON COM 2 GOSUB 500
COM 2 ON
GOTO 120
A$ = INPUT$(LOC(2),#2)
RETURN
ON COM 2 GOSUB 500, CODE = ETX%
COM 2 ON
GOTO 120
A$ = INPUT$(LOC(2), #2)
RETURN
ON COM 2 GOSUB 500, BYTE = 20
COM 2 ON
GOTO 120
A$ = INPUT$(20, #2)
RETURN
ON COM 2 GOSUB 500, HEAD = 02, TERM = 03
COM 2 ON
GOTO 120
A$ = INPUT$(LOC(2), #2)
RETURN
ON COM 2 GOSUB 500, HEAD=STX%, BYTE = 20
COM 2 ON
GOTO 120
A$ = INPUT$(LOC (2), #2)
A$ = RIGHT$(A$, 20)
RETURN
200
ON COM 1 GOSUB 1000
210
COM 1 ON
Communications interrupt enabled
Interrupt subroutine
1000
RETURN
If data is received, all the data in the receive
buffer is stored in A$.
If ETX% is received, all data in the receive
buffer is stored in A$.
If 20 characters are received, 20 charac-
ters from the receive buffer are stored in
A$.
If ETX% is received from STX%, all data in
the receive buffer is stored in A$.
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.
Section 5-5

Advertisement

Table of Contents
loading

This manual is also suitable for:

C200h-asc21C200h-asc31

Table of Contents