Omron CP1L Operation Manual page 374

Sysmac cp series
Hide thumbs Also See for CP1L:
Table of Contents

Advertisement

Interrupt Functions
340
When an interrupt occurs, execution of the cyclic task will be interrupted
immediately, even during execution of a cyclic task's instruction, and the par-
tially processed data is saved. After the interrupt task is completed, process-
ing returns to the cyclic task and the interrupted processing restarts with the
data saved before the interrupt processing. If the interrupt task overwrites a
memory address used by one of the interrupted instruction's operands, that
overwrite may not be reflected after the saved data is restored as processing
returns to the cyclic task.
To prevent an instruction from being interrupted during processing, enter
DI(693) just before the instruction to disable interrupts and EI(694) just after
the instruction to enable interrupts again.
a. The following example shows duplicate processing by an interrupt
task, which interrupts processing of a +B instruction between the first
and third operands and overwrites the same memory address.
Cyclic task
+B
Flow of Processing
Read D0 value (1234).
BCD addition: 1234 + 1 = 1235
Processing
interrupted.
Data saved.
Processing
of +B
Addition result (1235)
instruction
Processing
continues.
Write addition result (1235).
The interrupt occurs during processing of the +B instruction and the result is
saved temporarily without being written to the destination word (D0).
The interrupt task transfers the value of #0010 to D0, but the saved result of
the +B instruction (1235) is written to D0 when processing returns to the cyclic
task. In the end, the interrupt task's processing has no effect.
Interrupt task
D0
#0001
D0
Interrupt occurs.
0010 moved to D0.
Interrupt completed.
Section 6-1
MOV
#0010
D0
D0
1234
MOV executed
0010
1235

Advertisement

Table of Contents
loading

Table of Contents