Omron C200H-ASC11 Manual page 187

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

Advertisement

Details of BASIC Commands
on com
Syntax:
ON COM
BYTE
<byte expression >)]
Statement. Defines an interrupt subroutine to handle interrupts from the communication ports and
Description:
interrupt formats. There are 5 possible formats: 1) Interrupt after reception of any kind of data, 2)
Reception of the specified character, 3) Reception of the specified number of bytes, 4) Reception
of the specified header character and terminating character, or 5) Reception of the specified
header character and number of bytes.
Remarks:
<port expression> is an expression returning an integer in the range: [1... 2].
If <port expression> is omitted
<line number> specifies the line at the start of the interrupt subroutine (ISR).
<label> is a BASIC program label. It references a line number at the start of the ISR.
The ISR should be terminated by a
execution will resume at the statement that was originally interrupted.
In the body of the ISR, the user should check the contents of the buffer before manipulating the
data. It is possible that the
been changed.
<code expression> defines an ASCII code for a single byte character. Valid range is [0...255].
<byte expression> defines a number of bytes that can be entered before the interrupt takes place. Valid range
is [1...255].
ON COM
1.
2.
3.
4.
5.
Case (1): Interrupt occurs when communication port buffer receives any character.
Case (2): Interrupt occurs for a specific character xx. If xx is omitted then the default character
string to initiate the interrupt is a CR.
Case (3): Interrupt occurs after a specified number of characters have been received, i.e. on the
yyth byte. The number specified must be in the range [1...255].
Case (4): Interrupt is enabled after the starting character xx1 is received and occurs after the
terminating character xx2 is received. All characters from xx1 to xx2 are retained in the
communication buffer. If the terminating character xx2 is omitted the default character string to
initiate the interrupt is a CR.
Case (5): Interrupt is enabled after the starting character xx is received and occurs after yy
characters have been received. All yy characters from xx are retained in the communication
buffer.
Once an interrupt has been serviced, all subsequent BASIC interrupts are
RETURN
On executing the corresponding
held pending during execution of the ISR. After the ISR has returned, pending interrupts are
executed and the BASIC interrupts are returned to their previous states. Only one interrupt of the
same type as the currently active interrupt can be held pending, subsequent interrupts of that type
are lost.
178
[<port expression>]
= <byte expression>) |
ON COM
interrupts can be used in 5 different ways:
[<port>]
ON COM
GOSUB
[<port>]
ON COM
GOSUB
[<port>]
ON COM
GOSUB
[<port>]
ON COM
GOSUB
[<port>[
ON COM
GOSUB
statement has been executed.
(<line number> | <label>) [ , (
GOSUB
= <code expression> , (
HEAD
operates on all ports.
ON COM
statement. When the
RETURN
has been held pending and in the meantime, the buffer data has
xxxx
xxxx,
= xx
CODE
xxxx,
= yy
BYTE
xxxx,
= xx1,
HEAD
TERM
xxxx,
= xx,
HEAD
BYTE
ISR, all subsequent BASIC interrupts are
ON COM
[= <code expression>] |
CODE
[ = <code expression >] |
TERM
statement is reached
RETURN
= xx2
= yy
STOP
7-6
Section
=
BYTE
ped until the
ped, i.e.
STOP

Advertisement

Table of Contents
loading

This manual is also suitable for:

C200h-asc21C200h-asc31

Table of Contents