Siemens SIMATIC S5-115U User Manual page 284

Simatic s5 series cpu 941-7ub11 cpu 942-7ub11 cpu 943-7ub11 and cpu 943-7ub21 cpu 944-7ub11 and cpu 944-7ub21
Table of Contents

Advertisement

Interrupt Processing
Example:
While the CPU is processing OB2, interrupt B occurs and shortly afterwards, interrupt A.
Result:
After processing OB2, the CPU calls OB2 again (via interrupt A) and only then does it call OB3.
If part of your cyclic or time-controlled program is not to be interrupted, you must protect this
part of the program from interrupt using the "IA" (inhibit interrupt) operation. At the end of this
"protected" part of the program, interrupts must be enabled again using the "RA" operation.
While interrupts are disabled, one interrupt can be stored per interrupt line!
Disabling interrupts is necessary, e.g. if you use integral data handling blocks both in the
cyclic/time-controlled program and in the interrupt program: you must disable interrupts before
each integral data handling block call in the cyclic/time-controlled program!
Warning
!
Many standard function blocks for IPs revoke the interrupt disable because they work
internally with the IA and RA operations!
If you use these standard function blocks in restart or in an "interrupt-protected" part
of the program, the relevant interrupt OBs may be called inadvertently!
Notes on Avoiding Programming Errors
Note that the block nesting depth of 32 levels must not be exceeded even when calling
interrupt OBs!
If you use the same flags in the interrupt-processing program as in the cyclic program, you
must save the contents of these flags at the beginning of the interrupt-processing program
(e.g. in a data block); at the end of an interrupt-processing program, transfer the saved con-
tents of the flags back to the relevant flag bytes (words).
Enabling Interrupts in the Restart Program (OB21, OB22)
If you want interrupt responses already at restart, you must enable the interrupts at the
beginning of the restart OB with the "RA" operation. Otherwise, the interrupts will only come
into effect after the restart OB has been processed.
9-2
S5-115U Manual
EWA 4NEB 811 6130-02b

Advertisement

Table of Contents
loading

Table of Contents