Prerequisites and Generation Rules for the @cpu_rt (FB128) System Driver in PCS 7
In SIMATIC PCS 7, the system diagnostic driver @cpu_rt (FB128 - CPU Runtime) is generated automatically during a full CFC compilation with 'Generate module drivers' only if the target S7 controller firmware supports the underlying operating system runtime measurement function SFC 78 (OB_RT). If @cpu_rt fails to generate while other system blocks (@1, @2) are created, it is because the CPU configured in HW Config has a firmware version below V5.0 for standard S7-400 CPUs or below V4.5 for fault-tolerant S7-400H CPUs. To generate @cpu_rt: upgrade the CPU catalog object in HW Config to firmware V5.0 or higher (matching physical hardware), ensure SFC 78 exists in the S7 Program blocks folder, and re-compile CFC charts.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
During continuous automation engineering and system maintenance in SIMATIC PCS 7 V8.x or V9.x, engineers rely on the Module Driver Generator utility within CFC to automatically instantiate system diagnostic blocks that monitor controller cycle times, communication loads, and operating system performance. A perplexing issue occurs when an engineer executes a full CFC compilation with 'Generate module drivers', observing that standard diagnostic blocks (such as @1, @2, RACK, and MOD_) are created successfully in the @... charts, but the critical CPU runtime calculation block @cpu_rt (FB128) is completely omitted without generating any compiler errors or warnings. This article explains the internal hardware and firmware prerequisites demanded by CPU_RT, identifies why legacy CPU catalog entries inhibit its generation, and provides the step-by-step resolution.
Architecture and Fundamental Mechanics
CFC Module Driver Generation Concept, CPU_RT (FB128) Mechanics, and SFC 78 Support Rules:
- Role and Purpose of the
@cpu_rt(FB128) Block: CPU_RT(FB128) is a standardized system function block provided by the PCS 7 Basis Library.- When instantiated, it runs cyclically to calculate:
- Net execution time of all cyclic and interrupt Organization Blocks (OB1, OB3x, OB8x).
- Percentage load consumed by communication tasks.
- Current, maximum, and minimum scan cycle execution times.
-
It transfers this diagnostic telemetry to the PCS 7 Maintenance Station and WinCC diagnostic views.
-
The Hardware and Firmware Prerequisite (SFC 78 Dependency):
- The algorithmic calculation inside
CPU_RTrelies exclusively on querying the internal S7 operating system using SFC 78 (OB_RT). SFC 78reads internal CPU hardware timers that record microsecond execution intervals for each priority class.-
Firmware Architectural Boundary:
- Standard S7-400 CPUs:
SFC 78was introduced natively in Firmware V5.0. - Redundant S7-400H CPUs:
SFC 78was introduced natively in Firmware V4.5. - High-performance CPU 410-5H:
SFC 78is fully supported across all firmware releases.
- Standard S7-400 CPUs:
-
Compiler Decision Logic during 'Generate Module Drivers':
- When CFC compilation begins with 'Generate module drivers' selected, the driver generator inspects the exact MLFB and firmware version of the CPU configured in the station's Hardware Configuration (HW Config).
- If the CPU object in HW Config is a legacy version (e.g. CPU 416-3 with Firmware V4.1 or V3.1), the compiler recognizes that the target CPU lacks the microcode for
SFC 78. - To prevent generating invalid code that would cause an immediate CPU STOP (
OB121programming error / illegal opcode), the compiler intentionally and silently skips generating@cpu_rt. - Because skipping an unsupported diagnostic feature is considered a normal fallback, no compiler error is generated.
Step-by-Step Implementation Procedure
-
Inspect Physical CPU Firmware and HW Config Catalog Version:
* In SIMATIC Manager, select the CPU and pressCtrl + Dto open the Diagnostic Buffer and Module Information.
* Inspect the Firmware Version of the physical hardware (e.g.V5.3.1orV4.5.2).
* Open HW Config on the Engineering Station.
* Double-click the CPU in the rack; check the firmware version configured in HW Config.
* If the physical CPU is Firmware V5.3, but HW Config still contains an old Firmware V4.0 object, the discrepancy causes the compiler to suppress@cpu_rt. -
Upgrade the CPU Object in HW Config:
* In HW Config, open the Hardware Catalog.
* Navigate toSIMATIC 400 -> CPU -> CPU 41x.
* Locate the exact MLFB matching your physical CPU with firmwareV5.0or higher.
* Drag and drop the newer firmware version onto the CPU slot in the rack (or use 'Replace Object').
* Verify that network parameters (PROFIBUS / PROFINET addresses) and memory settings are preserved.
* Save and compile the hardware configuration. -
Verify System Function SFC 78 in the Blocks Folder:
* Open SIMATIC Manager and browse the project'sBlocksfolder under the S7 Program.
* Check ifSFC 78(OB_RT) is present.
* If absent, open the Standard Library (File -> Open -> Libraries -> Standard Library -> System Function Blocks).
* CopySFC 78from the Standard Library into the project's offlineBlocksfolder. -
Execute a Full CFC Compilation with Module Driver Generation:
* Open any CFC chart.
* SelectChart -> Compile -> Chart as Program....
* Select Entire program.
* Check Generate module drivers.
* ClickOKto execute compilation.
* Open the newly generated system chart@cpu_rt; confirm thatCPU_RT(FB128) is successfully placed and interconnected.
Verification
- In SIMATIC Manager Component View, expand the
Chartsfolder; confirm the presence of chart@cpu_rt. - Open
@cpu_rtin CFC; verify that FB128 is placed with valid task interconnections to cyclic and system OBs. - Download the compiled program to the CPU.
- Open
@cpu_rtin online Test Mode (Ctrl + F); verify that live cycle time parameters (NET_TIME,COMM_LOAD) update in real time.
Limitations and Operational Precautions
Replacing a CPU in HW Config with a newer firmware object requires downloading the Hardware Configuration to the controller, which mandates an operating state transition (STOP/RUN) unless supported via CiR on H-systems. If the physical CPU hardware genuinely cannot support firmware V5.0+ due to hardware memory limits, @cpu_rt cannot be generated.
Engineer FAQ
Why is @cpu_rt (FB128) not generated during CFC compilation?
Because the CPU configured in HW Config has a firmware version below V5.0 (or below V4.5 for H-CPUs), which lacks support for SFC 78.
What is the function of SFC 78 in S7-400 controllers?
SFC 78 (OB_RT) queries internal CPU timers to measure cycle time, interrupt durations, and communication load.
What is the minimum firmware required for CPU_RT on standard S7-400 CPUs?
Firmware V5.0 or higher is required.
What is the minimum firmware required for CPU_RT on fault-tolerant S7-400H CPUs?
Firmware V4.5 or higher is required.
Does the omission of @cpu_rt cause an alarm or compiler error?
No, the CFC compiler silently skips generating @cpu_rt on legacy CPUs to prevent loading illegal SFC calls that would fault the CPU.
Technical References
- SIMATIC PCS 7 Basis Library V9.0 Function Manual - CPU_RT Block
- SIMATIC S7-400 System and Standard Functions Reference Manual - SFC 78
- Siemens Industry Online Support FAQ - Prerequisites for CPU_RT (Entry 24190888)
Related Articles
- Resolving PROFIBUS Intermittent Signal Faults and S7-400 Cycle Time Overrun Alarms in PCS 7
- Comparing PCS 7 APL vs Basis Library Architecture and Configuring Channel Driver Simulation
- Resolving Module Driver QMODF Faults and Bad Signal Quality in SIMIT and PCS 7
- Retaining Output Channel Driver States Across CPU Restart and Module Driver Generation in PCS 7
Related Tags
- CPU_RT
- FB128
- SFC 78
- Generate Module Drivers
- Firmware Requirements
- CFC Compilation
- Basis Library
- PCS 7 V8.1