Understanding Scan Cycle Monitoring Time and OB80 Time Faults in SIMATIC PCS 7 Controllers
In SIMATIC PCS 7 controllers (S7-400 and CPU 410-5H), 'Scan cycle monitoring time' defines the maximum permissible execution duration for the cyclic background organization block (OB1) before the CPU calls the time fault error block (OB80). 'Max. scan cycle time extension' configures how long OB80 can re-trigger watchdog execution via SFC43 (RE_TRIGR) before forcing an emergency CPU STOP. In PCS 7, where automation logic executes in cyclic interrupt blocks (OB30-OB38), excessive cycle times reaching 24+ seconds indicate severe CPU execution starvation or unhandled cyclic interrupt overruns.
Table of Contents
- Architecture of Cyclic Execution in S7-400 and CPU 410-5H
- Scan Cycle Monitoring Time vs Max Scan Cycle Time Extension
- Why PCS 7 Cyclic Interrupts (OB30-OB38) Starve OB1 Background Execution
- Comparison Table: Organization Blocks and Timing Failure Mechanisms
- Step-by-Step Procedure to Diagnose and Optimize Controller Cycle Times
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Architecture of Cyclic Execution in S7-400 and CPU 410-5H
SIMATIC S7-400 and CPU 410-5H controllers execute user programs within a prioritized multi-tasking executive:
* Priority Classes:
* Priority Class 1 (Background Task - OB1): Runs continuously at the lowest priority whenever higher priority tasks are idle.
* Priority Classes 2 to 24 (Cyclic Interrupts - OB30 to OB38): Timed interrupts executing at fixed deterministic intervals (e.g., OB35 = 100 ms, OB32 = 1000 ms).
* Priority Class 26 / 28 (Time Fault - OB80): High-priority diagnostic error block called when task execution limits are violated.
* The PCS 7 Execution Model:
In standard SIMATIC PCS 7 engineering, virtually 100% of automation logic (CFC charts, APL blocks, SFC sequencers) runs inside cyclic interrupt OBs (OB30-OB38). OB1 is largely empty, executing only background housekeeping and communication buffer processing.
Scan Cycle Monitoring Time vs Max Scan Cycle Time Extension
Configured in HW Config -> CPU Properties -> Cycle/Clock Memory:
1. Scan Cycle Monitoring Time (Default: 6000 ms):
The hardware watchdog timer monitoring the duration of one complete loop of OB1. If OB1 does not complete within this window (e.g., 6 seconds), the operating system interrupts execution and calls OB80.
2. Max. Scan Cycle Time Extension:
Defines the maximum additional time that OB80 can grant to finish the cycle by calling system function SFC43 (RE_TRIGR).
* If OB80 is not loaded in the CPU: The CPU enters STOP mode immediately.
* If OB80 is loaded: It can extend monitoring up to the configured extension limit. However, if the scan cycle exceeds twice the monitoring time without finishing, the CPU enters STOP regardless of OB80.
Why PCS 7 Cyclic Interrupts (OB30-OB38) Starve OB1 Background Execution
When an engineer notices that scan cycle monitoring has grown to massive numbers (e.g., 24,400 ms):
* The Starvation Mechanism:
If an engineer places thousands of complex PID loops, math calculations, and communication blocks into OB35 (100 ms interval), and OB35 takes 85 ms of CPU time to compute:
* 85% of every 100 ms is consumed by OB35.
* Higher priority alarms (OB82, OB86) consume another 5%.
* OB1 only gets 10 ms of CPU execution time every 100 ms.
* Consequently, an OB1 cycle that normally takes 50 ms of CPU time requires 500 ms of real-world elapsed time to complete.
* The Catastrophic Overrun:
If program growth causes OB35 to require 105 ms of computation within a 100 ms interval, the task cannot finish before its next invocation. The CPU throws OB80 with diagnostic code 16#3507 (Cyclic interrupt error: interval expired before execution finished). Expanding the scan cycle watchdog to 24 seconds only masks the underlying algorithmic overload.
Comparison Table: Organization Blocks and Timing Failure Mechanisms
The table below outlines timing-related organization blocks and their operating constraints:
16#3507)Step-by-Step Procedure to Diagnose and Optimize Controller Cycle Times
- Inspect Module Information (Ctrl+D):
In SIMATIC Manager, select the CPU and pressCtrl+D. Open the Cycle Time tab.
* Review:Shortest cycle time,Current cycle time, andLongest cycle time. - Audit Diagnostic Buffer for OB80 Triggers:
Switch to the Diagnostic Buffer tab. Look for Event ID16#3507or16#3501. Identify whether the time fault originates from OB1 or an overrun in a specific cyclic interrupt (e.g., OB35). - Analyze Runtime Execution Groups in CFC:
* In SIMATIC Manager, open any CFC chart.
* Open the Runtime Editor (Edit -> Run Sequence).
* Inspect the utilization of each cyclic interrupt OB (OB30 through OB38). - Rebalance Block Execution Groups:
Move non-critical blocks (e.g., totalizers, runtime meters, slow temperature monitors) out of fast OBs (OB35 = 100 ms) into slower OBs (OB32 = 1000 ms or OB31 = 2000 ms). - Restore Standard Watchdog Parameters in HW Config:
In HW Config -> CPU Properties -> Cycle/Clock Memory, return the Scan cycle monitoring time to realistic engineering limits (e.g., 6000 ms), eliminating excessive artificial extensions.
Verification
To verify that controller execution timing is healthy:
1. Open the Cycle Time tab in Module Information (Ctrl+D).
2. Verify that the Current cycle time settles well below the configured monitoring threshold (typically < 100 ms for normal operation).
3. Confirm that the CPU diagnostic buffer contains zero entries for OB80 or time error events.
4. Verify that WinCC faceplates and communication links respond crisply without operator lag.
Limitations and Operational Precautions
- Never Leave OB80 Empty: Ensure OB80 is present in the CPU blocks folder. While an empty OB80 prevents immediate CPU STOP on transient overruns, it should log alarms to alert engineers of execution starvation.
- CPU 410-5H Performance: The CPU 410-5H has exceptional processing speed, but misplacing heavy string manipulation or mass Modbus queries in high-speed OBs can still saturate its execution pipeline.
- Licensing Disclaimer: Upgrading controller processing hardware (
6ES7410-5HX08-0AB0) requires validation against the applicable Siemens catalog and authorized distributor quotation.
Engineer FAQ
Technical References
- SIMATIC S7-400 Programmable Controller CPU Specifications (A5E00850741-08)
- SIMATIC S7-400 CPU 410-5H Process Automation Hardware Manual (A5E32311696-AE)
- SIMATIC PCS 7 CFC for S7 Configuration Manual (A5E35802288-AB)
Related Articles
- Diagnosing Unscheduled S7-400 CPU STOP Mode Events via Diagnostic Buffer and Organization Blocks
- Resolving S7-400 Local Data Stack Exceeded in Priority Class 27 (OB100) During CFC Compilation
- Troubleshooting CPU 410-5H Startup Freezes and Blinking RUN LED Following Entire Downloads in SIMATIC PCS 7
Related Tags
- Scan Cycle Monitoring
- OB80
- OB35
- CPU 410-5H
- Time Fault
- S7-400
- Runtime Sequence