Understanding Scan Cycle Monitoring Time and OB80 Time Faults in SIMATIC PCS 7 Controllers

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

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:

Organization BlockFunction / PriorityTypical Interval / PurposeDiagnostic Fault TriggerAction on FaultOB1Main Cyclic Background (Priority 1)Free-running (10 - 200 ms)Cycle time exceeds monitoring timeCalls OB80; stops if unhandledOB35Fast Cyclic Interrupt (Priority 12)100 ms (APL Control loops)Execution time exceeds 100 msCalls OB80 (Event 16#3507)OB32Slow Cyclic Interrupt (Priority 9)1000 ms (Monitoring / Math)Execution time exceeds 1000 msCalls OB80OB80Timing Error Handler (Priority 26)Event-driven error handlerUnhandled time faults / watchdogRe-triggers watchdog or halts CPU

Step-by-Step Procedure to Diagnose and Optimize Controller Cycle Times

  1. Inspect Module Information (Ctrl+D):
    In SIMATIC Manager, select the CPU and press Ctrl+D. Open the Cycle Time tab.
    * Review: Shortest cycle time, Current cycle time, and Longest cycle time.
  2. Audit Diagnostic Buffer for OB80 Triggers:
    Switch to the Diagnostic Buffer tab. Look for Event ID 16#3507 or 16#3501. Identify whether the time fault originates from OB1 or an overrun in a specific cyclic interrupt (e.g., OB35).
  3. 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).
  4. 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).
  5. 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

Related Articles

Related Tags

  • Scan Cycle Monitoring
  • OB80
  • OB35
  • CPU 410-5H
  • Time Fault
  • S7-400
  • Runtime Sequence
8 respuestas