R 11/92
7.3
Cyclic Program
Function blocks FB 21 and FB 10, and working data block DB 20 are called by OB 1 in the cyclic
program.
FB 21 contains the main cyclic program for the 1P 281.
FB 21
The structure of the segments makes it easy to handle the individual pro-
gram parts (e.g., when setting up your program).
During cyclic operation, the programmed functions are selected one after
another. The individual functions (load, read write, etc.) can be made de-
pendent (software links and digital input signals) on certain events.
Keep the following in mind when programming.
– When the counter value registers are read, the interrupts must be dis-
abled with 1A before the register set is called, and enabled again with RA
after the read access.
– The selected register set must be saved for all other (not interrupt–dis-
– If control register3 is to be transferred, a check in status register3 must
be made before to determine whether the parameterization bit is still set
to"1" (parameterization exists), The parameterization bit must then be
setto 1 with the OW instruction. If the parameterization bit in status regis-
ter 3 is set to "O", a new start or restart must be performed to restore the
DB 20
All accesses (read and write) are performed via working data block DB 20.
FB 10
FB 10 provides the allocation to the inputs and outputs. It is only required
when a simulator is used.
AG
1992, Order No: 6ES5 998-0KP21
Programming Example
7 – 5
Need help?
Do you have a question about the SIMATIC S5 IP 281 and is the answer not in the manual?