Omron CJ2 CPU UNIT SOFTWARE User Manual page 131

Cj2 cpu unit software
Hide thumbs Also See for CJ2 CPU UNIT SOFTWARE:
Table of Contents

Advertisement

Ensuring Data Concurrency between Cyclic and Interrupt Tasks
Data may not be concurrent if a cyclic task and an interrupt task are reading and writing the same
I/O memory addresses. Use the following procedure to disable interrupts during memory access by
cyclic task instructions.
• Immediately prior to reading or writing by a cyclic task instruction, use a DI(693) (DISABLE
INTERRUPT) instruction to disable execution of interrupt tasks.
• Use an EI(694) (ENABLE INTERRUPT) instruction immediately after processing in order to
enable interrupt task execution.
Reading and writing I/O
memory common to
interrupt tasks.
Processing with interrupt task
execution enabled
Problems may occur with data concurrency even if DI(693) and EI(694) are used to disable interrupt
tasks during execution of an instruction that requires response reception and processing (such as a
network instruction or serial communications instruction).
Additional Information
Execution of the BIT COUNTER (BCNT), BLOCK SET (BSET), and BLOCK TRANSFER
(XFER) instructions will not be interrupted for execution of interrupt task, i.e., execution of the
instruction will be completed before the interrupt task is executed, delaying the response of the
interrupt. To prevent this, separate data processing for these instructions into more than one
instructions, as shown below for XFER.
XFER
&100
D30000
XFER instruction is
not interrupted.
CJ2 CPU Unit Software User's Manual
Cyclic task
DI
EI
Processing
separated.
D0
5 Understanding Programming
Disabled
Interrupt task
Enabled
Interrupt task
XFER
&50
D0
D30000
Interrupts are
possible as soon as
execution of XFER
has been completed.
XFER
&50
D50
D30050
5
5-39

Advertisement

Table of Contents
loading

Table of Contents