Omron SYSMAC C200H-ASC02 Operation Manual page 50

Ascii unit
Hide thumbs Also See for SYSMAC C200H-ASC02:
Table of Contents

Advertisement

BASIC Language
ON COM GOSUB Statement
40
<m> is an integer expression from 0 to 255.
<string 2> is a string expression.
Example:
MID$(A$,2,4) = "ABCDEFGH"
Remarks:
The characters in <string 1>, beginning at position <n> are replaced by the
characters in <string 2>.
The optional <m> refers to the number of characters from <string 2> that will
be used in the replacement. If <m> is omitted, all of <string 2> is used. How-
ever, regardless of whether <m> is included, the replacement of characters
never goes beyond the original length of <string 1>.
Refer to the discussion of the MID$ function
Purpose:
Defines an interrupt service routine to handle data coming into a
com port buffer
Format:
ON COM(<n>) GOSUB <line>
<n> is the port number (1 or 2).
<line> is the line number of the first statement of the interrupt
service routine.
Example:
ON COM1 GOSUB 1000
Remarks:
This statement is not valid unless it is executed after the specified port has
been opened.
An interrupt service routine cannot be interrupted by another interrupt. If a
new interrupt occurs during processing of a previous interrupt, branching to
handle the new interrupt will not take place until after the RETURN statement
of the first interrupt service routine is executed. This means that, depending
on the branch timing, nothing may be in the buffer when execution branches
to the interrupt routine. It is therefore necessary to check whether data is in
the buffer by executing the LOC or EOF Command at the beginning of the
interrupt routine.
All subroutines must end with a RETURN statement.
If a statement specified by the branch line number is non-executable, execu-
tion will begin with the first executable statement following the branch line
number.
If zero is specified as the branch line number, it is assumed that the COM
OFF statement has been executed.
If the port number is omitted, port 1 is selected.
The ON COM GOTO statement is enabled with the COM ON statement and
disabled with the COM OFF statement.
Program Example:
10
OPEN #1, "COMU:(40)"
20
ON COM GOSUB 100
30
COM ON
40
PC READ "@D,0,2,2I4";A,B
50
PRINT A, B
60
GOTO 30
Section 4-2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents