Professional Documents
Culture Documents
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:
z An interrupt
z A STOP command (mode selector, menu option on the programming device, SFC46 STP, SFB20 STOP)
z A power outage
z 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 z TC2) for CPUs up to 10/98 and CPUs from
10/98:
mk:@MSITStore:C:\Program%20Files%20(x86)\Siemens\Step7\S7bin\s7bashdB.chm::/bas00105.htm 5/24/2019
Organization Block for Cyclic Program Processing (OB1) Page 2 of 3
mk:@MSITStore:C:\Program%20Files%20(x86)\Siemens\Step7\S7bin\s7bashdB.chm::/bas00105.htm 5/24/2019
Organization Block for Cyclic Program Processing (OB1) Page 3 of 3
When you set the load added to the cycle by communication to 50%, the OB1 scan cycle time can be doubled.
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
z Check the effects of changing the value of the "Scan Cycle Load from
Communication" parameter while the system is running.
z The communication load must be taken into account when setting the
minimum scan cycle time; otherwise time errors will occur.
Recommendations
z Where possible, apply the default value.
z Increase this value only if you are using the CPU primarily for communication purposes and your user program is not time critical.
z In all other cases, only reduce the value.
z Set the process mode (S7-300 only), and limit the time needed there for test functions.
See also:
mk:@MSITStore:C:\Program%20Files%20(x86)\Siemens\Step7\S7bin\s7bashdB.chm::/bas00105.htm 5/24/2019