Troubleshooting Sample Time Acceleration and Cycling Interrupt Failures in CPU 417-4 with CEMAT

Troubleshooting Sample Time Acceleration and Cycling Interrupt Failures in CPU 417-4 with CEMAT

When timer countdowns accelerate (e.g., a 10-second timer elapsing in 5 seconds) in a CPU 417-4 running a CEMAT multiproject following a memory reset, the root cause is a mismatch between the controller hardware cyclic interrupt interval and the block SAMPLE_T (Sample Time) parameter, or incorrect organization block placement. In classic CEMAT standards, all CEMAT drive and group blocks must reside strictly in OB1, while PID controllers belong in OB35. Furthermore, if a CPU memory reset restored default OB35 intervals (100 ms) while the original project used modified hardware timings, or if AS compilation omitted 'Set sample time', block timers execute at double frequency. Re-assigning CEMAT blocks to OB1 and synchronizing sample times in CFC resolves the timing fault.

Table of Contents

Time Tracking Mechanics in S7-400 and CEMAT Blocks

In SIMATIC PCS 7, blocks containing internal timers, ramp generators, integrators, and lag filters do not query the real-time system clock every millisecond. Instead, they calculate time intervals by accumulating their configured sampling interval: Accumulated_Time = Accumulated_Time + SAMPLE_T on every execution scan.

If a block has parameter SAMPLE_T = 0.2s (expecting execution every 200 ms), but the organization block calling it actually fires every 100 ms (twice as fast), the internal accumulator increments by 0.2 seconds every 0.1 seconds. Consequently, a 10-second countdown expires in exactly 5 seconds, causing pre-warning horns, run-up timers, and fault delays to elapse prematurely.

Root Causes of Timer Acceleration After CPU Memory Reset

The table below details why timers run erratically following power loss and controller memory reset:

MechanismTechnical ConditionDiagnostic ImpactHW Config DesynchronizationBattery failure caused full reset (Reset in as-delivered state); default OB intervals restored.OB32/OB35 intervals in physical CPU differ from compiled CFC block assumptions.Omitted 'Set Sample Time'CFC compiled without updating SAMPLE_T attributes against the target OB task.Blocks retain stale sample time constants that do not match hardware execution cycles.Violation of CEMAT OB1 StandardCEMAT drive/group blocks placed in cyclic interrupt OBs (OB34/OB35) rather than OB1.Violates CEMAT operating system guidelines, causing timing distortion and bus communication latency.Scan Cycle Overrun HalvingController scan cycle exceeded safety thresholds (> 6000 ms), triggering CPU cycle-halving protection.CPU automatically stretches or alters interrupt rates to preserve controller liveness.

Mandatory CEMAT Organization Block Placement Rules

The Siemens CEMAT Minerals & Cement DCS architecture defines strict execution placement rules:

CEMAT Block Execution Standards:
- OB1 (Main Cyclic Task):           ALL CEMAT core blocks MUST reside here:
                                    - C_DRIVE_1D, C_DRIVE_2D (Drive blocks)
                                    - C_GROUP (Group coordinators)
                                    - C_ROUTE (Transport routes)
                                    - C_DAMPER, C_VALVE (Actuators)
                                    - C_MEASUR (Analog measurements)
- OB35 (Cyclic Interrupt - 100 ms): ONLY closed-loop controllers reside here:
                                    - CTRL_PID / PIDConL
                                    - Custom APL analog PID control loops
- OB100 (Warm Restart):             Restart blocks (e.g., C_OB100) for initialization

Remediation Procedure and Sample Time Alignment

To resolve the accelerated timer behavior and restore deterministic CEMAT timing:

Step 1: Relocate CEMAT Blocks to OB1

  1. Open the CFC Editor -> open the Run Sequence editor (Options -> Customize -> Run Sequence).
  2. Inspect OB30 through OB38: identify any CEMAT drive, group, route, or damper blocks residing in interrupt OBs.
  3. Move all CEMAT blocks into OB1, maintaining logical execution order (measurements -> drives -> groups).

Step 2: Audit and Download HW Config

  1. Open HW Config for the CPU 417-4 (6ES7417-4XT05-0AB0).
  2. Double-click the CPU -> navigate to the Cycle/Clock Memory tab.
  3. Verify cyclic interrupt settings (e.g., OB35 interval) match the project design baseline.
  4. Compile and download HW Config to the CPU.

Step 3: Recompile CFC with 'Set Sample Time'

  1. In the CFC Editor, select Compile -> Compile Entire Program.
  2. Ensure the option 'Set sample time' is checked: this forces the compiler to re-write accurate time constants into all block SAMPLE_T parameters.
  3. Download changes to the controller.

Verification

To verify accurate timing across CEMAT control blocks:

  1. In WinCC OS Runtime, open the faceplate for a CEMAT group block (C_GROUP).
  2. Initiate a group start: monitor the pre-warning horn timer (HORN_TIM) with a physical stopwatch.
  3. Confirm that a 10-second pre-warning timer elapses in exactly 10 seconds (1.0x real time) rather than counting down in 2-second jumps.
  4. Open CFC Online Test mode on a drive block (C_DRIVE_1D): verify that the run delay accumulator matches clock time.
  5. Check the CPU Diagnostic Buffer: verify scan cycle time remains stable (typically 30 ms to 80 ms) well below the 6000 ms watchdog limit.

Limitations and Operational Precautions

Operational boundaries in CEMAT S7-400 systems:

  • Cycle Time Monitoring: When moving hundreds of CEMAT blocks into OB1, monitor the OB1 cycle time in CPU Properties. Ensure OB1 scan time remains comfortably below 150 ms to ensure responsive operator button feedback.
  • Battery Maintenance: Maintain functioning backup batteries (6ES7971-0BA00) in the PS 407 power supply to prevent catastrophic memory loss during plant power outages.
  • Do Not Mix Library Timing: Never place classic CEMAT blocks into APL-style 100 ms cyclic interrupt OBs; CEMAT internal pulse logic expects OB1 scan dynamics.

Engineer FAQ

Why did moving CEMAT blocks to OB1 fix the timer counting speed?

CEMAT blocks are designed to calculate internal timer decrements based on OB1 execution dynamics. When placed in OB35 or OB34 with mismatched sample times, the timer accumulators received double the expected execution ticks.

What does the 'Set sample time' option do during CFC compilation?

It scans the organization block to which each block instance is assigned in the run sequence, reads the OB's configured hardware interval, and automatically writes that exact value to the block's SAMPLE_T parameter.

Can CEMAT drive blocks be placed in OB35 with APL blocks?

No. The CEMAT standard explicitly mandates that all drive, group, route, and valve blocks must execute in OB1. Only PID controllers should be assigned to OB35.

What happens to S7-400 CPUs when cycle time exceeds 6000 ms?

If the main cycle time breaches protective watchdog thresholds, the CPU operating system enters a degraded protective state, altering or halving interrupt OB execution rates to maintain controller survivability.

Technical References

Related Articles

Related Tags

  • CPU-417-4
  • CEMAT
  • SAMPLE_T
  • OB1
  • OB35
  • Timer-Acceleration
6 respuestas