Prerequisites and Generation Rules for the @cpu_rt (FB128) System Driver in PCS 7

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

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_RT relies exclusively on querying the internal S7 operating system using SFC 78 (OB_RT).
  • SFC 78 reads internal CPU hardware timers that record microsecond execution intervals for each priority class.
  • Firmware Architectural Boundary:

    • Standard S7-400 CPUs: SFC 78 was introduced natively in Firmware V5.0.
    • Redundant S7-400H CPUs: SFC 78 was introduced natively in Firmware V4.5.
    • High-performance CPU 410-5H: SFC 78 is fully supported across all firmware releases.
  • 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 (OB121 programming 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

  1. Inspect Physical CPU Firmware and HW Config Catalog Version:
    * In SIMATIC Manager, select the CPU and press Ctrl + D to open the Diagnostic Buffer and Module Information.
    * Inspect the Firmware Version of the physical hardware (e.g. V5.3.1 or V4.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.

  2. Upgrade the CPU Object in HW Config:
    * In HW Config, open the Hardware Catalog.
    * Navigate to SIMATIC 400 -> CPU -> CPU 41x.
    * Locate the exact MLFB matching your physical CPU with firmware V5.0 or 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.

  3. Verify System Function SFC 78 in the Blocks Folder:
    * Open SIMATIC Manager and browse the project's Blocks folder under the S7 Program.
    * Check if SFC 78 (OB_RT) is present.
    * If absent, open the Standard Library (File -> Open -> Libraries -> Standard Library -> System Function Blocks).
    * Copy SFC 78 from the Standard Library into the project's offline Blocks folder.

  4. Execute a Full CFC Compilation with Module Driver Generation:
    * Open any CFC chart.
    * Select Chart -> Compile -> Chart as Program....
    * Select Entire program.
    * Check Generate module drivers.
    * Click OK to execute compilation.
    * Open the newly generated system chart @cpu_rt; confirm that CPU_RT (FB128) is successfully placed and interconnected.

Verification

  1. In SIMATIC Manager Component View, expand the Charts folder; confirm the presence of chart @cpu_rt.
  2. Open @cpu_rt in CFC; verify that FB128 is placed with valid task interconnections to cyclic and system OBs.
  3. Download the compiled program to the CPU.
  4. Open @cpu_rt in 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

Related Articles

Related Tags

  • CPU_RT
  • FB128
  • SFC 78
  • Generate Module Drivers
  • Firmware Requirements
  • CFC Compilation
  • Basis Library
  • PCS 7 V8.1
20 respuestas