Interrupt Program - Siemens Simatic S5 IP 240 Manual

Counter/positioning/position decoder module
Hide thumbs Also See for Simatic S5 IP 240:
Table of Contents

Advertisement

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 the actual
Interrupts
value passes through zero (PRA = W#16#0001) an interrupt is generated.
Interrupt generation is initially blocked (control bit AMSK = '1').
In the cyclic program, positive edge at input I 3.2 (M 170.2) causes the con-
trol bit AMSK to be reset and transferred to the module (FC 172 with func-
tion 2). Now an interrupt is generated when the actual value crosses zero.
The enable of interrupt generation is signalled at output Q 3.2 (M 171.2).
The interrupt enable is canceled through transfer of the control bit AMSK to
the module with negative edge at input I 3.2 (M 170.2).
Acknowledging
In the interrupt program, the FC 172 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 at zero crossing on channel 1: DB
172.DBX 40.0 is set). When an interrupt is generated in this way, the
memory bit M 71.3 is set, which then causes the interrupt to be signalled via
output Q 3.3 in the cyclic program.
In the cyclic program you can delete the interrupt display again with positive
edge at input I 3.3 (M 171.3).
IP 240
EWA 4NEB 811 6120-02b
IP 240 Counter, Position Decoder and Positioning Module
C-19

Advertisement

Table of Contents
loading

Table of Contents