Omron C200H-ASC11 Manual page 191

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

Advertisement

Details of BASIC Commands
on pc
Syntax:
ON PC
Statement. Executes the specified interrupt number's interrupt subroutine in response to allocated
Description:
I/O interrupts or IOWR (#CC00) instruction interrupts from the PC (CPU Unit).
Remarks:
The <interrupt number> is an integer expression returning a value in the range : [1...99].
If the <interrupt number> is omitted then the interrupt subroutine will be executed for any PC
interrupt.
The default value of the interrupt number in IR n+2 is 00. This means that no PC interrupt has
been requested.
The <line number> specifies the line at the start of the interrupt subroutine (ISR).
A <label> can be used instead of a line number after a
PC interrupts are enabled by the
STOP
not executed until the next
The ISR should be terminated by a
execution will resume at the statement where the program was interrupted.
The PC can initiate a BASIC interrupt by either of the following methods:
1. Allocated I/O (PC Interrupt Flag) Interrupts
2. IOWR (#CC00) Instruction Interrupts
PC interrupts cannot be executed if the ASCII Busy Flag is set. To execute an interrupt the ASCII
Busy Flag should be checked.
While the PC interrupt subroutine is being executed, other incoming interrupts will be recorded
but not executed. These stopped interrupts will be executed in order of their priority after the PC
interrupt subroutine has been completed.
For more information on PC interrupts, refer to 6-3 Details of the Data Exchange Methods.
For more information on writing interrupts in BASIC, refer to the
5-5 Interrupt Functions.
> 10 ON PC 1 GOSUB 70
Examples:
> 20 ON PC 2 GOSUB 90
> 30 ON PC 3 GOSUB 110
> 50 PC ON
> 60 GOTO 60
> 70 PRINT "PC INTERRUPT #1"
> 80 RETURN
> 90 PRINT " PC INTERRUPT #2"
> 100 RETURN
> 110 PRINT " PC INTERRUPT #3"
> 120 RETURN
> 130 END
See also:
(
PC
182
[<interrupt number>]
statement masks and enables the PC interrupts so the interrupts are recorded but the ISRs are
PC ON
The PC interrupt number can be set in the PC's CPU Unit by turning ON the corresponding
bit in IR n+2 bits 00 to 07. By turning bit 04 of IR n (the PC Interrupt Flag) from OFF to ON
at the same time, the specified PC interrupt will be executed if PC interrupts have been
enabled.
When the interrupt number is indicated to the ASCII Unit by the IOWR (#CC00) instruction
from the PC's CPU Unit, the specified PC interrupt will be executed if PC interrupts have
been enabled.
|
|
)
ON
OFF
STOP
(<line number> | <label>)
GOSUB
statement and disabled by the
PC ON
statement unmasks the interrupts.
statement. When the
RETURN
statement.
GOSUB
statement. The
PC OFF
statement is reached,
RETURN
and
ON COM
7-6
Section
PC
examples in
ON PC

Advertisement

Table of Contents
loading

This manual is also suitable for:

C200h-asc21C200h-asc31

Table of Contents