Omron C200HX Operation Manual page 310

Hide thumbs Also See for C200HX:
Table of Contents

Advertisement

Subroutines and Interrupt Control
5-23-7 Processing the Same Memory Locations with the Main Program
and Interrupt Subroutines
Processing Interrupted between 1st and 3rd Operands
292
The scheduled interrupt is disabled at the start of operation (the scheduled inter-
rupt interval is 0), so the time to the first interrupt and scheduled interrupt interval
must be set using INT(89) with N=004 and C=001/000. In the following diagram,
the subroutine would be executed every 20 ms if the scheduled interrupt time
unit is set to 10 ms in DM 6622 of the PC Setup.
First Cycle Flag
Sets the time to first
interrupt to 20 ms.
Sets the scheduled in-
terrupt interval to 20 ms.
Note Depending on the setting of DM 6621 in the PC Setup, Host Link servicing, Re-
mote I/O servicing, Special I/O Unit servicing, and individual instruction execu-
tion will be completed before the subroutine is executed. Refer to page 282 for
details.
If a memory location is manipulated both by the main program and an interrupt
subroutine, an interrupt mask must be set to disable interrupts.
When an interrupt occurs, execution of the main program will be interrupted im-
mediately, even during execution of an instruction. The intermediate processing
results is saved for use after completing the interrupt subroutine, i.e., when the
interrupt subroutine has been executed, execution of the main program is
started from the same position with data restored to the previous condition. If any
of the memory locations being used by the main program are changed in the in-
terrupt subroutine, the changes will be lost when data is restored to the previous
state when restarting execution of the main program. It is thus necessary to dis-
able interrupts before and enable interrupts after any instructions that should be
executed to completion even if an interrupt occurs.
Main program
LD
25315
INT(89)
001
004
#0002
INT(89)
000
004
#0002
Main program
SBN(92)
99
Subroutine
RET(93)
END(01)
Section 5-23
Scheduled interrupt
every 10 ms.
Return to program ad-
dress before interrupt.

Advertisement

Table of Contents
loading

This manual is also suitable for:

C200hgC200he

Table of Contents