318
Interrupt Functions
Section 6-1
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.
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.
+B
D0
#0001
D0
MOV
#0010
D0
D0
1234
0010
1235
Processing
interrupted.
Cyclic task
Interrupt task
Read D0 value (1234).
BCD addition: 1234 + 1 = 1235
Interrupt occurs.
MOV executed
0010 moved to D0.
Interrupt completed.
Data saved.
Addition result (1235)
Write addition result (1235).
Processing
of +B
instruction
Processing
continues.
Flow of Processing
Summary of Contents for CP1L - 12-2007
Page 3: ...iv...
Page 9: ...x...
Page 13: ...xiv TABLE OF CONTENTS...
Page 21: ...xxii...
Page 33: ...xxxiv Conformance to EC Directives 6...
Page 65: ...32 Function Blocks Section 1 5...
Page 428: ...395 Clock Section 6 9...
Page 429: ...396 Clock Section 6 9...
Page 523: ...488 Troubleshooting Unit Errors Section 9 4...
Page 531: ...496 Replacing User serviceable Parts Section 10 2...
Page 563: ...528 Auxiliary Area Allocations by Function Appendix C...
Page 611: ...576 Auxiliary Area Allocations by Address Appendix D...
Page 638: ...603 Connections to Serial Communications Option Boards Appendix F Connecting to Unit...
Page 639: ...604 Connections to Serial Communications Option Boards Appendix F...
Page 669: ...634 Index...
Page 671: ...636 Revision History...