PLC Cycle Time
PLC Cycle Time
PLC Cycle Time
5 At the end of a cycle, the operating system executes At the end of a cycle, the operating system executes
any tasks that are pending, for example downloading any tasks that are pending, for example downloading
and deleting blocks, receiving and sending global data. and deleting blocks, receiving and sending global data.
6 Finally, the CPU returns to the start of the cycle and Finally, the CPU returns to the start of the cycle and
restarts the cycle monitoring time. restarts the cycle monitoring time.
Process Images
So that the CPU has a consistent image of the process signals during cyclic program processing, the CPU does
not address the input (I) and output (Q) address areas directly on the I/O modules but rather accesses an internal
memory area of the CPU that contains an image of the inputs and outputs.
Programming Cyclic Program Processing
You program cyclic program processing by writing your user program in OB1 and in the blocks called within OB1
using STEP 7.
Cyclic program processing begins as soon as the startup program is completed without errors.
Interrupts
Cyclic program processing can be interrupted by the following:
1. An interrupt
2. A STOP command (mode selector, menu option on the programming device, SFC46 STP, SFB20
STOP)
3. A power outage
4. The occurrence of a fault or program error
Scan Cycle Time
The scan cycle time is the time required by the operating system to run the cyclic program and all the program
sections that interrupt the cycle (for example, executing other organization blocks) and system activities (for
example, updating the process image). This time is monitored.
The scan cycle time (TC) is not the same in every cycle. The following figures show different scan cycle times
(TC1 � TC2) for CPUs up to 10/98 and CPUs from 10/98:
Organization Block for Cyclic Program Processing (OB1)
duration of communication processes that always increase the scan cycle time. Examples of communication
processes include transmitting data to another CPU by means of MPI or loading blocks by means of a
programming device.
Test functions with a programming device are barely influenced by this parameter. However, you can increase the
scan cycle time considerably. In the process mode, you can limit the time set for test functions (S7-300 only).
How the Parameter works
The operating system of the CPU constantly provides the communication with the configured percent of the entire
CPU processing capacity (time slice technique). If this processing capacity is not needed for the communication, it
is available to the rest of the processing.
Effect on the Actual Scan Cycle Time
Without additional asynchronous events, the OB1 scan cycle time is extended by a factor that can be calculated
according to the following formula:
At the same time, the OB1 scan cycle time is also influenced by asynchronous events (such as hardware
interrupts or cyclic interrupts). From a statistical point of view, even more asynchronous events occur within an
OB1 scan cycle because of the extension of the scan cycle time by the communication portion. This causes an
additional increase in the OB1 scan cycle. This increase depends on how many events occur per OB1 scan cycle
and on the duration of event processing.
Example 2 (additional asynchronous events considered):
For a pure OB1 execution time of 500 ms, a communication load of 50% can result in an actual scan cycle time of
up to 1000 ms (provided that the CPU always has enough communication jobs to process). If, parallel to this, a
cyclic interrupt with 20 ms processing time is executed every 100 ms, this cyclic interrupt would extend the scan
cycle by a total of 5*20 ms = 100 ms without communication load. That is, the actual scan cycle time would be
600 ms. Because a cyclic interrupt also interrupts communication, it affects the scan cycle time by 10 * 20 ms with
50% communication load. That is, in this case, the actual scan cycle time amounts to 1200 ms instead of 1000
ms.
Note
1. Check the effects of changing the value of the "Scan Cycle Load from Communication"
parameter while the system is running.
2. The communication load must be taken into account when setting the minimum scan
cycle time; otherwise time errors will occur.
Recommendations
1. Where possible, apply the default value.
2. Increase this value only if you are using the CPU primarily for communication purposes and your user
program is not time critical.
3. In all other cases, only reduce the value.
4. Set the process mode (S7-300 only), and limit the time needed there for test functions.
See also:
Process-Image Input/Output Tables
Organization Blocks for Interrupt-Driven Program Processing
Checking Scan Cycle Times to Avoid Time Errors
Module Information Functions
Organization Block for Cyclic Program Processing (OB1)