Interrupt Processing
S5-115U Manual
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
EWA 4NEB 811 6130-02b
Содержание SIMATIC S5-115U
Страница 6: ...EWA 4NEB 811 6130 02b ...
Страница 16: ...EWA 4NEB 811 6130 02b ...
Страница 18: ...EWA 4NEB 811 6130 02b ...
Страница 26: ......
Страница 62: ...EWA 4NEB 811 6130 02b ...
Страница 64: ...EWA 4NEB 811 6130 02b ...
Страница 67: ......
Страница 74: ......
Страница 79: ......
Страница 80: ......
Страница 81: ......
Страница 82: ......
Страница 83: ......
Страница 84: ......
Страница 97: ......
Страница 98: ......
Страница 99: ......
Страница 114: ...EWA 4NEB 811 6130 02b ...
Страница 280: ...EWA 4NEB 811 6130 02b ...
Страница 372: ...EWA 4NEB 811 6130 02b ...
Страница 432: ...EWA 4NEB 811 6130 02b ...
Страница 442: ......
Страница 528: ...EWA 4NEB 811 6130 02b ...
Страница 590: ......
Страница 591: ......
Страница 592: ......
Страница 593: ......
Страница 594: ......
Страница 600: ...EWA 4NEB 811 6130 02b ...
Страница 602: ...EWA 4NEB 811 6130 02b ...
Страница 604: ...EWA 4NEB 811 6130 02b ...
Страница 624: ...EWA 4NEB 811 6130 02b ...
Страница 632: ...EWA 4NEB 811 6130 02b ...
Страница 644: ...EWA 4NEB 811 6130 02b ...
Страница 646: ...EWA 4NEB 811 6130 02b ...
Страница 652: ...EWA 4NEB 811 6130 02b ...
Страница 654: ...EWA 4NEB 811 6130 02b ...
Страница 660: ...EWA 4NEB 811 6130 02b ...
Страница 662: ...EWA 4NEB 811 6130 02b ...
Страница 666: ...EWA 4NEB 811 6130 02b ...
Страница 668: ...EWA 4NEB 811 6130 02b ...
Страница 674: ...EWA 4NEB 811 6130 02b ...