When to Use OB10 or SFC1 with a 100 ms OB35
OB10 and SFC1 perform different clock-related tasks on a SIMATIC S7-400H: OB10 is a time-of-day interrupt, while SFC 1 (READ_CLK) reads the CPU clock. Replacing OB10 with SFC 1 is therefore suitable only if the logic needs to read the current date and time; it does not reproduce an OB10 event. One CPU 410H user reported that disabling OB10 and an AFP clock-generator block stopped OB35 timing errors, but the available details do not establish which change resolved that particular case.
Table of Contents
- Applies To
- OB10 and SFC 1 Serve Different Purposes
- Why OB35 Can Trigger OB80
- Diagnostic Procedure
- Choosing a Clock Function
- Expected Results and Verification
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Applies To
This explanation concerns SIMATIC S7-300/400 time-of-day interrupt behavior and a source-reported CPU 410H/PCS 7 configuration. The PCS 7, CPU firmware, AFP library and block versions were not provided, so the reported corrective sequence cannot be generalized to other projects.
OB10 and SFC 1 Serve Different Purposes
OB10 is an operating-system interrupt organization block for a configured time-of-day event. Siemens documents one-time and recurring schedules for OB10–OB17, including recurring intervals down to once per minute. SFC 1, named READ_CLK, reads the CPU system clock and returns the date/time in its CDT output with a status in RET_VAL. It is a read operation, not an interrupt scheduler. A 100 ms OB35 cyclic interrupt is a separate execution mechanism; reading the clock in OB35 does not create a 100 ms clock event.
Why OB35 Can Trigger OB80
The reported symptom was OB35 exceeding its monitoring time and causing OB80. Siemens documentation identifies OB80 as the time-error interrupt OB. In the cited S7-300/400 documentation, if a time-of-day interrupt OB is still being processed when its next start event occurs, the operating system calls OB80; response depends on OB80 handling and CPU configuration. The source discussion also proposes excessive work in a cyclic OB or a block that does not finish in time. These are plausible diagnostic directions, but the conversation provides no trace, call path, cycle-time measurement or block source that confirms a cause. A claim that an unsolved WHILE loop caused this particular event remains unverified.
Diagnostic Procedure
- Identify which event calls OB80 and inspect its diagnostic information and the CPU diagnostic buffer; preserve the exact event details and timestamps.
- Confirm the configured OB35 interval, the CPU type and the applicable monitoring/watchdog configuration from the project and version-matched manuals.
- Review execution load and the blocks called from OB35. Isolate suspect logic only in a controlled test or approved maintenance window; do not infer a defective block solely because changing OB assignment changes timing.
- Check separately whether OB10 is configured and whether its associated processing can overlap its next scheduled event. Review any clock-generation logic, including the exact AFP block and its version.
- Change one factor at a time in a test environment, then observe OB35 execution and OB80 diagnostics across representative operating conditions before considering a production change.
Choosing a Clock Function
Use OB10 when the application requires logic to be invoked by a configured time-of-day event. Use SFC 1 when logic must obtain the CPU's current date/time for processing or recording. If replacing an AFP clock-generator function with CPU clock memory, first identify the required pulse period, duty cycle, memory-byte assignment and CPU configuration; the source report does not specify them, and the cited READ_CLK documentation does not document those clock-memory details. Do not treat SFC 1, OB10 and a clock-memory bit as interchangeable.
Expected Results and Verification
A successful change should be verified against the intended function: a time-of-day event should still occur at its configured schedule, a clock read should return a usable CDT value and acceptable RET_VAL, and OB35 should complete within its configured monitoring limit without recurring time-error events during the observation period. A single successful cycle or the absence of one immediate OB80 call does not prove the configuration is robust.
Verification
Check the CPU diagnostic buffer and relevant time-error OB information before and after each controlled change. Confirm that OB10 behavior, if still required, remains correct; independently check the data returned by READ_CLK if used. Compare execution behavior under normal and peak project load. The source report says the CPU410H returned to normal after several changes, but it does not isolate the effective change or document the verification interval.
Limitations and Operational Precautions
The reported project versions, OB10 schedule, AFP block identity, OB35 load, diagnostic record and exact clock-memory configuration are missing. Siemens documentation supports the distinction between scheduling with OB10 and reading the clock with SFC 1; it does not substantiate the source author's complete workaround as a universal fix. Changes to cyclic execution, interrupt configuration or CPU memory can affect control behavior. Back up the project, assess process impact, validate offline or in a suitable test system, and use the site's approved change and rollback process before modifying a running controller.
Engineer FAQ
Can SFC 1 replace OB10? Only when the requirement is to read the current CPU date/time. It does not schedule a time-of-day interrupt.
Does OB10 run every 100 ms? No such 100 ms cadence is documented for OB10 in the cited S7-300/400 time-of-day interrupt description; OB35 is the cyclic interrupt in this case.
Does an OB35 timing error prove a block contains an infinite loop? No. The source discussion suggests that possibility, but no block-level evidence is provided. Examine diagnostics and execution load.
Did removing AFP fix the reported CPU410H issue? The user changed OB10, AFP and clock-memory configuration as a group. The report does not isolate which change mattered.
Does the article establish a PCS 7 version-specific fix? No. The PCS 7 version and AFP version are absent, so applicability must be checked against the installed versions.
Technical References
- Siemens, S7-300/400 System Software: Time-of-Day Interrupt OBs (OB10–OB17), describing scheduling intervals and the OB80 behavior when an interrupt OB is still executing at the next start event: https://support.industry.siemens.com/cs/document/ (official Siemens documentation page surfaced as “Time-of-day interrupt OBs (OB10 to OB17)” in the S7-300/400 system software documentation).
- Siemens, CPU 410-5H Process Automation Parameter Manual, A5E31664440-AA (05/2013), §3.33 SFC list; SFC 1 READ_CLK reads time of day: https://cache.industry.siemens.com/dl/files/834/74736834/att_455/v1/s7400_parameter_manual_en-US_en-US.pdf
- Siemens, System Software for S7-300/400 System and Standard Functions, Volume 1/2, SFC 1 READ_CLK: https://cache.industry.siemens.com/dl/files/574/1214574/att_44504/v1/SFC_e.pdf?download=true
Related Articles
- SIMATIC S7-400H OB35 cyclic interrupt timing
- SIMATIC S7-400 OB80 time error diagnostics
- S7-300/400 READ_CLK SFC 1