IP 240 Counter, Position Decoder and Positioning Module
Interrupt Program
Interrupt Block
The interrupt program is located in the organization block OB 40.
Enabling
In the start-up program, the module is structured such that when tracks 1 or 3
Interrupts
are reached (PRA = W#16#0005) an interrupt is generated. Interrupt genera-
tion is initially blocked (control bit AMSK = '1').
In the cyclic program, a positive edge at input I 2.2 (M 180.2) causes the
control bit AMSK to be reset and transferred to the module (FC 170 with
function 2). Now an interrupt is generated when one of the tracks 1 and 3 is
reached. The enable of interrupt generation is signalled at output Q 2.2 (M
181.2).
The interrupt enable is canceled through transfer of the control bit AMSK to
the module with negative edge at input I 2.2 (M 180.2).
Acknowledging
In the interrupt program, the FC 170 function is called by means of function
Interrupts
3 (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 track 1 is reached: DB 170.DBX
40.0 is set). When an interrupt is generated in this way, the memory bit M
181.3 is set, which then causes the interrupt to be signalled via output Q 2.3
in the cyclic program.
In the cyclic program you can delete the interrupt display again with positive
edge at input I 2.3 (M 181.3).
C-26
IP 240
EWA 4NEB 811 6120-02b