320
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
Содержание CP1L-L14D Series
Страница 2: ...CP1L L14D CP1L L20D CP1L M30D CP1L M40D CP1L CPU Unit Operation Manual Revised June 2007...
Страница 3: ...iv...
Страница 9: ...x...
Страница 13: ...xiv TABLE OF CONTENTS...
Страница 21: ...xxii...
Страница 33: ...xxxiv Conformance to EC Directives 6...
Страница 65: ...32 Function Blocks Section 1 5...
Страница 153: ...120 CP CPM1A series Expansion I O Unit Wiring Section 3 6...
Страница 523: ...490 Troubleshooting Unit Errors Section 9 4...
Страница 531: ...498 Replacing User serviceable Parts Section 10 2...
Страница 563: ...530 Auxiliary Area Allocations by Function Appendix C...
Страница 611: ...578 Auxiliary Area Allocations by Address Appendix D...
Страница 638: ...605 Connections to Serial Communications Option Boards Appendix F Connecting to Unit...
Страница 639: ...606 Connections to Serial Communications Option Boards Appendix F...
Страница 669: ...636 Index...
Страница 671: ...638 Revision History...