Resolving CPU Programming Error 58 on FC2936 After Splitting CFC Runtime Groups

Resolving CPU Programming Error 58 on FC2936 After Splitting CFC Runtime Groups

In SIMATIC PCS 7 and STEP 7 CFC environments, a CPU diagnostic alarm reporting 'Programming error 58: FC2936 / 858 / 4 / 122' occurs when block division across multiple runtime groups violates internal execution order dependencies or when runtime group limits are exceeded. FC2936 is a system-generated CFC execution block that coordinates chart calls and data pointers. If interdependent technological blocks or module drivers are split across disparate cyclic interrupt organization blocks (such as OB32 and OB35) or arranged out of order, FC2936 encounters an uninitialized pointer or illegal data block number, triggering error code 58. To resolve this, re-align the block execution order in the CFC Runtime Editor, ensure drivers precede consumer blocks within the same cyclic task, and perform an Entire Program compilation.

Table of Contents

CFC Runtime Group Architecture and FC2936 Functionality

Continuous Function Chart (CFC) manages the execution sequence of SIMATIC S7 controllers by structuring block calls into Runtime Groups assigned to cyclic interrupt organization blocks (OB30 through OB38). When a CFC chart is compiled, the CFC compiler automatically creates internal organization code, chart calls, and driver synchronization blocks. Among these compiler-generated artifacts are system function calls such as FC2936 (or similar internal FC numbers in the reserved CFC range FC60 to FC3000).

FC2936 serves as an internal dispatcher responsible for managing block pointer tables, local data allocations, and runtime group sequence integrity. When an engineer splits a large runtime group into several smaller groups to balance CPU cycle loads, the compiler updates pointer tables. If the calling sequence cuts across dependent data structures—such as placing a module driver (Pcs7AnIn) in a slow cycle (OB32, 1000ms) while feeding a controller (PIDConL) in a fast cycle (OB35, 100ms), or splitting interlocked blocks into disordered runtime groups—FC2936 attempts to read an unallocated instance address or nonexistent DB. The CPU operating system intercepts the invalid area access and logs Programming error 58 (Area length error reading a global or instance DB).

Root Causes of Programming Error 58 (858/4/122)

Technical evaluation of diagnostic buffer event 16#4558 (Programming error 58) in S7-400 CPUs reveals three primary failure mechanisms:

  1. Execution Sequence Inversion Across Runtime Groups: In CFC, technological blocks depend on strict chronological execution: Module Drivers -> Interlocks / Calculations -> Control Blocks -> Output Drivers. When blocks are split across multiple runtime groups, engineers frequently move blocks without verifying the sequential order of the runtime groups themselves. If a downstream block executes before the upstream block initializes its output structures, FC2936 dereferences a null pointer.

  2. Excessive Blocks per Runtime Group Leading to Stack Depletion: A single runtime group containing hundreds of complex APL blocks can deplete CPU local data stack allocations (L-stack) during OB execution. While splitting the group resolves stack usage, doing so manually without recompiling the entire program leaves stale pointer references in the CPU instance DBs.

  3. Incomplete Delta Download After Structural Runtime Changes: Splitting runtime groups and shifting blocks between different OBs fundamentally modifies the CPU calling structure in OB1 and cyclic interrupt OBs. Performing a Download Changes (delta download) during live operation can cause temporary pointer misalignment if the new runtime groups are called before the instance data blocks are fully re-allocated.

Runtime Group Parameters and Execution Hierarchy Matrix

The following table summarizes execution sequences, cycle times, and diagnostic error signatures in CFC runtime groups:

Diagnostic Code / FieldMeaning in S7-400 Diagnostic BufferSystem Component InvolvedCorrective Action RequiredError 58 (16#4558)Area length error or unallocated DBFC2936 / CFC DispatcherVerify DB allocation and block sequenceParam: 858 / 4 / 122Internal DB number (DB858) & byte offsetInstance DB / Pointer TableRecompile Entire Program in CFCOB32 (1000ms)Background monitoring & slow loopsSlow runtime groupsPlace only slow process drivers hereOB35 (100ms)Standard closed-loop controlNormal control runtime groupsHost PIDConL, MotL, and fast driversRuntime Sequence InversionDriver executes after controllerCFC Runtime Editor orderMove driver group before control group

Step-by-Step Procedure to Resolve FC2936 Runtime Group Errors

To eliminate programming error 58 and establish stable runtime group execution in PCS 7:

  1. Inspect CPU Diagnostic Buffer:
    - In SIMATIC Manager, select the CPU and open PLC -> Diagnostic/Setting -> Module Information.
    - Select the Diagnostic Buffer tab. Locate the event: 'Programming error 58: FC2936'. Note the referenced DB number and block address.
    - Click Open Block to verify whether the error points to a CFC chart block or compiler system block.

  2. Audit and Re-order Runtime Groups in CFC Runtime Editor:
    - Open any CFC chart, then launch the Runtime Editor by pressing Alt+F12 (or clicking the Runtime sequence icon).
    - In the tree view, expand the affected cyclic interrupt OB (e.g., OB35).
    - Verify the sequential order of all runtime groups within the OB. Ensure that:

    • Driver block groups (@...) execute first.
    • Measurement and analog preprocessing groups execute second.
    • Logic, interlock, and controller groups (PIDConL, MotL) execute third.
    • Output driver groups execute last.
    • If blocks were manually dragged into newly created runtime groups, ensure that interdependent blocks reside within the same OB cycle to prevent asynchronous timing gaps.
  3. Verify Local Data (L-Stack) Allocations in HW Config:
    - Open HW Config and double-click the S7-400 CPU.
    - Select the Memory tab. Review the local data allocations for each OB (e.g., OB35). If the local data is near saturation, increase the bytes allocated per priority class.
    - Save, compile, and download the hardware configuration if modified.

  4. Execute Full Compilation (Entire Program):
    - In CFC, select Chart -> Compile -> Changes Only; if compilation flags warnings regarding runtime sequence, select Compile Entire Program.
    - Ensure the option Generate module drivers is checked.
    - Once compilation finishes cleanly, schedule a plant maintenance window to perform a Download Entire Program (or carefully verified changes download with CPU in RUN) to refresh all internal pointer tables.

Verification

Verify resolution of runtime group errors:
1. Open the CPU diagnostic buffer; clear existing buffer entries and monitor for 15 minutes.
2. Confirm that event 16#4558 (Programming error 58) does not re-occur.
3. In the CFC Runtime Editor, inspect CPU cycle times; verify that OB execution times remain comfortably below the allocated cycle periods (e.g., OB35 net execution < 50ms).
4. Verify that all technological blocks update process values without communication dropouts or quality code degradation.

Limitations and Operational Precautions

  • Asynchronous OB Crossing: Crossing signal interconnections between different OBs (e.g., OB35 to OB32) introduces jitter and latency. Avoid splitting tightly coupled feedback loops across different OBs.
  • Download Entire Program Impact: If structural pointer corruption is severe, resolving it requires compiling the entire program and downloading in STOP mode. Plan accordingly for continuous processes.
  • Automatic Sequence Generation: Never disable 'Automatic runtime sequence generation' in CFC unless performing specialized optimization, as manual ordering easily leads to pointer errors.

Engineer FAQ

What is FC2936 in SIMATIC PCS 7?

FC2936 is an internal compiler-generated function used by CFC to manage block pointer dispatching, chart sequencing, and runtime group coordination.

Why did splitting blocks into new runtime groups trigger this error?

Splitting blocks separated interdependent logic or inverted the execution sequence, causing downstream blocks to access uninitialized memory addresses.

Can I fix Programming Error 58 with a Delta Download?

If the error is caused by runtime group sequencing, a delta download of CFC changes may resolve it, but if internal DB pointer tables are mismatched, an Entire Program compilation is required.

How many blocks should be placed in a single runtime group?

As a best practice, limit runtime groups to 20 to 50 technological blocks to keep execution manageable and prevent L-stack exhaustion.

Technical References

Related Articles

Related Tags

  • CFC
  • Runtime Groups
  • Programming Error 58
  • FC2936
  • OB35
  • S7-400 Diagnostic Buffer
6 respuestas