Omron CP1L-EL20DR-D Operation Manual page 412

Sysmac cp series cp1l-el/em cpu unit
Table of Contents

Advertisement

Interrupt Functions
378
b. The following example shows duplicate processing by an interrupt
task, which interrupts processing while BSET is writing to a block of
words and yields an incorrect comparison result.
Cyclic task
BSET
#1234
D0
D10
Flow of Processing
#1234 set in D0.
#1234 set in D1.
Interrupted.
CMP(020)
BSET(071)
processing
processing
Continued.
#1234 set in D2.
#1234 set in D10.
Since the interrupt occurs during BSET(071) processing and before #1234 is
set in D10, the content of D0 and D10 do not match when the comparison is
made in the interrupt task (*1) and output A remains OFF.
In the end (*2), the D0 and D10 both contain #1234 and match, but the correct
comparison result is not reflected in comparison result output A.
Prevention of Duplicate Processing
Cyclic task
DI
BSET
EI
Interrupt task
CMP
A
Equals Flag
Interrupt occurs.
Read D0.
Read D1.
Compare D0 and D10.
Output result.
Interrupt completed.
Disables execution of
interrupt programs.
#1234
D0
D10
Enables execution of
interrupt programs.
Section 8-1
D0
D10
D0
D1
D2
D10
1234
003E 0502
ABCD
OFF
1234
1234
ABCD
OFF*
0502
1234
ABCD
1234
1234
1234
2
OFF
1234*
A
1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents