Specifications
C-34
IP 240
EWA 4NEB 811 6120-02b
Interrupt Program
The interrupt program is located in the organization block OB 40.
In the start-up program, the module is structured such that when the clear-
ance value BEE1 is reached (PRA1 = W#16#0001) an interrupt is generated.
Interrupt generation is initially blocked (control bit AMSK = ‘1’).
In the cyclic program, a positive edge at input I 1.2 (M 190.2) causes the
control bit AMSK to be reset and transferred to the module (FC 168 with
function B#(20,0). Now an interrupt is generated when the clearance value
BEE1 is reached. The enable of interrupt generation is signalled at output
Q 1.2 (M 191.2).
The interrupt enable is canceled through transfer of the control bit AMSK to
the module with negative edge at input I 1.2 (M 190.2).
In the interrupt program, the FC 168 function is called by means of function
3,0 (read interrupt request bytes). The interrupt request bytes are transferred
from the module to the data block. These contain the cause of the interrupt
(for example, interrupt generation when the clearance value BEE1 is reached:
DB 168.DBX 41.2 is set). When an interrupt is generated in this way, the
memory bit M 191.3 is set, which then causes the interrupt to be signalled via
output Q 1.3 in the cyclic program.
In the cyclic program you can delete the interrupt display again with positive
edge at input I 1.3 (M 191.3).
Interrupt Block
Enabling
Interrupts
Acknowledging
Interrupts
IP 240 Counter, Position Decoder and Positioning Module