Problem Overview
During CFC (Continuous Function Chart) compilation or offline-to-online download to a SIMATIC S7-414-4H CPU, STEP 7 raises the following diagnostic on the connected offline CPU:
W: The local data requirements (252 bytes, including OB121 and OB122) of organization block OB83 exceed the warning limit set for the configured local data stack of the corresponding priority class on the connected offline CPU.
The same warning is repeated for OB82, OB83, OB85, and OB86. The size shown (252 bytes in this case) is the sum of:
- TEMP variables declared in the error OB itself,
- TEMP variables of any FB/FC/SFB/SFC statically called inside the error OB,
- TEMP footprint of nested blocks, and
- TEMP footprint automatically appended by STEP 7 for OB121 (programming error) and OB122 (I/O access error) when those synchronous error OBs are used as fallback handlers.
The message is a warning, not a hard fault. The program will still download, but if the configured local data for the OB's priority class is smaller than 252 bytes, the CPU may run into STOP with diagnostic buffer entry SF / STACK B overflow the moment the error OB is triggered at runtime.
Local Data Stack Architecture on S7-400
The SIMATIC S7-400 uses a local data stack (German: Lokaldatenstack, register area B) that is allocated per priority class. Each OB runs in a priority class; when the OB starts, the CPU reserves local data for the entire call chain rooted in that OB.
Key facts:
- The maximum local data stack size is a fixed property of the CPU type and is not user-expandable. For CPU 414-4H the maximum is 64 KB (65 536 bytes), shared between the two priority class sub-stacks.
- The CPU stores a local data size per priority class in the system data. STEP 7 distributes the total available local data budget across the 27 priority classes (1 to 26, plus the OB25 startup class).
- Local data is consumed for:
- TEMP variables in OBs, FBs, FCs, SFBs, SFCs,
- Pass-by-value parameters of FB/FC calls,
- Block start information (the 20-byte OB header for S7-400),
- Internal stack frames used by the operating system for nesting.
- Priority classes 1–8 are reserved for OB1 (cyclics) and the SFCs scheduled by the operating system. Priority 9–26 are user-assignable via OB priority in the OB Properties dialog.
Priority class of the error OBs
| OB | Name | Default priority (S7-400) | User-configurable |
|---|---|---|---|
| OB1 | Main cyclic | 1 | No |
| OB10–OB17 | Time-of-day interrupts | 2–24 (any free) | Yes |
| OB40–OB47 | Hardware interrupts | 16–23 (any free) | Yes |
| OB55–OB57 | Status / update / profile | 2–24 | Yes |
| OB80 | Time error | 26 | No (S7-400 fixed at 26) |
| OB82 | Diagnostic interrupt | 26 | No (fixed 26 in S7-400) |
| OB83 | Insert/remove module | 26 | No (fixed 26 in S7-400) |
| OB85 | Program execution error | 26 | No (fixed 26 in S7-400) |
| OB86 | Rack/DP slave failure | 26 | No (fixed 26 in S7-400) |
| OB100–OB102 | Startup | 27 | No |
| OB121 | Programming error | = priority of the OB that caused the error | Derived |
| OB122 | I/O access error | = priority of the OB that caused the error | Derived |
On the S7-400, OB82/OB83/OB85/OB86 share the same fixed priority 26. OB121/OB122 do not have their own priority class — they run at the priority of the OB that was executing when the error was detected, so their TEMP footprint is allocated from the same priority class as the calling OB.
S7-414-4H CPU Specifications
The S7-414-4H is a fault-tolerant CPU of the SIMATIC S7-400 family. Relevant local data parameters:
| Parameter | Value |
|---|---|
| MLFB (order number) | 6ES7 414-4HM14-0AB0 (V6.x) / 6ES7 414-4HF04-0AB0 (V4.x) / 6ES7 414-4HL04-0AB0 (V5.x) |
| Work memory (RAM), integrated | 4 MB (code + data) |
| Load memory (RAM card, integrated) | 1 MB Flash or 2 MB Flash depending on variant |
| Max local data stack | 64 KB (65 536 bytes) |
| Number of priority classes | 27 (OB1 + OB10–17 + OB40–47 + OB55–57 + OB80–87 + OB100–102 + OB121/OB122 derived) |
| Number of OBs total | up to 1 024 |
| Bit memory | 8 192 bytes |
| FB / FC / DB count (max) | 2 048 / 2 048 / 4 096 |
| Default local data, OB1 (priority 1) | 256 bytes (STEP 7 default) |
| Default local data, priority 9–24 (OB10/40/55) | 0 bytes (you must allocate if used) |
| Default local data, priority 26 (OB80/82/83/85/86) | 256 bytes (factory default; frequently insufficient for CFC error handling) |
You can confirm the exact local data budget of your specific CPU in the S7-400 reference manual, entry ID S7-400 Automation System (entry 109751799), and the CPU-specific data sheet at CPU 414-4H datasheet (entry 44240626).
Why the Warning is Generated
When you compile a CFC chart that is triggered by an error OB (or called from one), the compiler computes the cumulative TEMP data of the chart, the underlying FB/FC instances, the CFC runtime block (the chart container with its ICON and TASKREF structures), and the run-time nesting of OB_DIAG / OB_BEGIN / OB_END blocks inserted by CFC. The result is compared with the local data budget of the OB's priority class stored in the offline hardware configuration.
Two distinct situations trigger the message:
- Budget lower than requirement: the priority class is set to 0 or to a small value, but the compiled blocks need 252+ bytes. The download proceeds with the larger of the two values, but STEP 7 warns because the next download may overflow.
-
Sum of all priorities exceeds 64 KB: STEP 7 detects that re-sizing the offending priority to fit the new requirement would push the cumulative local data above the CPU's hardware maximum. This is the most dangerous case because the CPU rejects the configuration at startup with
STOPand diagnostic entryParameter assignment error.
Root Cause Analysis
The root cause of the warning in the user's report is straightforward: CFC charts placed in OB82/83/85/86 carry the full static and TEMP overhead of the CFC runtime, and the priority class budget for priority 26 is left at the STEP 7 default of 256 bytes. With OB121/OB122 also being pulled in for synchronous error handling, the worst-case footprint of any one error OB exceeds the budget.
The two avenues of remediation are independent and complementary:
| Approach | Effect | Risk |
|---|---|---|
| Increase the priority 26 budget in HW Config | All error OBs gain more stack; warning disappears | Cumulative local data can exceed 64 KB; cannot be cured by configuration |
| Reduce TEMP variables in the CFC charts placed in error OBs | Compiler computes a smaller footprint; warning disappears | None — just refactor the chart |
| Both together | Best long-term result; margin between budget and worst case grows | None |
Solution 1 — Resize the Priority 26 Budget in HW Config
The recommended route is to increase the local data allocated to the priority class of the error OBs. On the S7-414-4H the error OBs all sit in priority 26, so a single change covers OB82, OB83, OB85, and OB86. Do not change the budget for OB80 (time error) unless you have a custom time-error OB; OB80 also runs at priority 26 on S7-400 and shares the same budget.
Step-by-step procedure
- Open the S7 project in SIMATIC Manager and select the S7-400 station.
- Double-click Hardware to launch HW Config.
- Right-click the CPU 414-4H rack slot and choose Object Properties.
- Switch to the Memory tab.
- Locate the row for the OB priority class used by your error OBs (priority 26 on S7-400 error OBs). The columns are Local data (bytes).
- Change the value for priority 26 from the default 256 to the value required by the worst-case error OB plus headroom. With a worst-case of 252 bytes, set the value to 512 bytes (2× overhead to allow OB121/OB122 nesting and additional nesting depth).
- Verify the total of all priority classes ≤ 65 536 bytes. The Memory tab shows the current sum in the status bar.
- Click OK, then Station → Save and Compile.
- Download the hardware configuration to the CPU. On an H-station, download to both CPUs in the order prompted by STEP 7.
Sample size calculation
The worst-case local data requirement for one OB is:
L_total = L_OB + L_FB(1) + L_FB(2) + ... + L_FB(n) + L_OB121 + L_OB122 + L_overhead
where
-
L_OB≈ 20 bytes (OB start info on S7-400), -
L_FB(i)= sum of TEMP variables in the i-th statically called FB/FC, -
L_OB121,L_OB122= 0 if not programmed, otherwise their own TEMP sum, -
L_overhead≈ 30–60 bytes for OS and stack framing.
For a typical CFC chart running five driver blocks (e.g., CTD, TP, R_TRIG, ADD, MUL) plus the CFC runtime wrapper, the measured footprint is 200–280 bytes. With OB121 and OB122 handling common errors, an additional 60–80 bytes is realistic. A budget of 512 bytes for priority 26 therefore provides ~1.5× margin.
Cumulative budget check
The sum of all priority class budgets on CPU 414-4H must remain ≤ 65 536 bytes. A typical budget distribution after correction is:
| Priority class | Assigned OB(s) | Recommended size (bytes) |
|---|---|---|
| 1 | OB1 (cyclic) | 4 096 |
| 9 | OB10 (time-of-day) | 256 |
| 16 | OB40 (hardware interrupt) | 512 |
| 24 | OB55 (status) | 256 |
| 25 | (free / reserved) | 0 |
| 26 | OB80/82/83/85/86 (error) | 512 |
| 27 | OB100–OB102 (startup) | 512 |
| 2–8, 10–15, 17–23 | (free) | 0 |
| Total | 6 144 |
This leaves ~59 KB free for OB1 call chains, which is the main consumer in CFC-heavy applications.
Solution 2 — Reduce TEMP Variables in CFC Charts
When the budget cannot be increased (e.g., OB1 is already consuming the local data cap, or the project has many large FBs at priority 26), refactor the charts placed in the error OBs.
Common TEMP bloat sources in CFC
- Implicit ICON variables that CFC generates for every chart pin (I1, I2, …, Q1, Q2, …) — typically 4 bytes each.
- Implicit CHART and CHART_DW instance DB fields the CFC runtime writes for runtime diagnostics.
- Floating-point computations in the chart that map to two 32-bit TEMP words per operator.
- Type-conversion blocks (
REAL_TO_INT,INT_TO_DWORD, etc.) that allocate a TEMP for both input and output shadows. - Long FB instances with extensive STAT variables that CFC implicitly copies to TEMP on call.
Refactor checklist
- Open the CFC chart assigned to OB82/OB83/OB85/OB86 in the CFC Editor.
- Open Chart → Properties → Compilation and read the Local data (bytes) figure. Record it.
- Replace user-defined connector and block I/O with a small number of FBs that hold the data in STAT (instance DB) and pass minimal TEMP parameters.
- Move any state variables that survive across OB invocations to global DBs. Remember that TEMP is undefined on entry to an OB, so storing fault state in TEMP will silently fail at the next call.
- Re-compile and check the new local data size. Iterate until the worst-case OB is below 256 bytes; the default budget then suffices and the warning disappears.
CFC-Specific Considerations
CFC is widely used on S7-400 with the CFC option package (separate license, part of the SIMATIC PCS 7 / CFC V8.x / V9.x toolchain). It introduces additional block types that always appear in the local data of any OB that hosts a chart:
| Block type | Role | Typical local data contribution |
|---|---|---|
| CHART | Chart runtime header | ~ 32 bytes |
| CHART_DW | Chart runtime instance DB header | 0 bytes TEMP (instance only) |
| TSK_C6 / TSKSRT / TSKHALT | Task block family for OB assignment | ~ 12 bytes |
| @CFC | CFC runtime state machine | ~ 40 bytes |
| SEQUENCER | Optional sequencer blocks | ~ 24 bytes per sequencer |
If the CFC chart is used as a fault handler that calls vendor FBs (e.g., PCS 7 APL blocks like CTRL_PID, MOT_SPEED), each APL block can contribute 60–250 bytes of TEMP. For a PCS 7-style fault handler with a single APL block, the typical footprint is 280–450 bytes — well above the STEP 7 default 256.
Refer to the CFC manual (entry 18652696) and the S7-400 system manual (entry 109751799) for canonical block data and supported firmware.
Verification Procedure
After applying either solution, verify the configuration is consistent and the CPU accepts it.
- Offline compile in STEP 7: select the S7 program → Edit → Object Properties → Block. STEP 7 reports whether the maximum priority-class size is exceeded.
- Online consistency check: with the station online, right-click the CPU → PLC → Compare Offline/Online. Local data size mismatches are flagged here even if the download succeeded.
-
Diagnostic buffer sanity check: trigger a benign diagnostic (e.g., remove and re-insert a dummy module) and confirm OB82 runs without
STOP. The diagnostic buffer must showMode transition from RUN to RUNrather thanSTOP. - Buffer-local-data read: with STEP 7, open PLC → Diagnostic Setting → Local Data of the Currently Active OB. Compare the peak with the configured priority-class size. Peak should be ≤ budget.
-
Stack overflow scan: monitor the CPU diagnostic buffer for entries
STOP caused by local data stack overflow(event ID 0x4B3F) during the next 24 hours of operation.
Sample diagnostic buffer entries
| Event ID | Meaning | Cause |
|---|---|---|
| 0x4B3F | Local data stack overflow | Priority class budget < required; size the priority class up |
| 0x4B1F | OB not loaded | Error OB missing; download the OB (do not just create it offline) |
| 0x4B47 | OB call conflict | OB is being re-entered because priority was mis-configured |
| 0x4E1F | Communication error | Distinct from local data; check CP firmware |
Common Pitfalls
-
Setting the priority to 0 for an unused class is correct, but setting the priority class used by the error OBs to 0 will cause
STOPat the first error event. STEP 7 should reject 0 for active OBs, but manual edits in the SDB may not. - Resizing OB1 only: OB1's priority class is the largest in most projects. If you increase priority 1 from 4 096 to 16 384 and forget to add budget for priority 26, the warning stays and the CPU may even refuse the configuration if the cumulative > 64 KB.
-
OB121/OB122 not installed: When synchronous error OBs are not loaded, the CPU defaults to
STOPon the first programming or I/O access error. The 252-byte figure in the warning already includes a notional allowance for OB121/OB122; you can ignore it only if you have explicitly decided not to handle synchronous errors. - Firmware mismatches: Local data is enforced by firmware. CPU 414-4H with firmware V4.x and V6.x differ in the granularity of the priority class table. On V4.x, the priority table is 26 entries; on V6.x, the table is 27 entries and OB100 has its own slot. The change is forward-compatible but not backward.
- H-system event distribution: in a redundant H-station, error OBs run on the master CPU only. The partner's priority 26 budget is unused at runtime, but STEP 7 still applies the same budget on both sides. If you change it on one, change it on both before link-up.
- CFC cross-chart calls: CFC charts can call across charts via block connectors. Cross-chart references inside an error OB can pull the entire called chart's TEMP into the priority-26 budget. Avoid this; use global DBs for cross-chart data in error handlers.
Related Firmware and Hardware Notes
The following versions of the S7-400 / CPU 414-4H are known to support the local data settings described above and were current at the time of writing:
| CPU | MLFB | Firmware | Local data max | Notes |
|---|---|---|---|---|
| CPU 414-4HF04 | 6ES7 414-4HF04-0AB0 | V4.0 – V4.7 | 64 KB | Earlier generation; 256-byte granularity on some classes |
| CPU 414-4HL04 | 6ES7 414-4HL04-0AB0 | V5.0 – V5.7 | 64 KB | Adds extended priority table |
| CPU 414-4HM14 | 6ES7 414-4HM14-0AB0 | V6.0 – V6.2 | 64 KB | Current production; supports S7-400 V6 OS |
For firmware updates and the latest MLFB list, see the Siemens Industry Online Support portal. The S7-400 / CPU 414-4H product lifecycle status can be verified on the portal under Product support → SIMATIC S7-400 → CPU 414-4H.
Diagnostic Cross-Reference
The local data stack is closely related to other S7-400 diagnostic and resource limits. When this warning appears it is worth checking:
- Process image size – must be ≤ 8 KB on CPU 414-4H. Beyond this the OB1 local data required for input/output shadowing grows.
- Communication resources – each configured S7 connection reduces the local data available for user blocks because of internal CFB (communication function block) TEMP.
- Number of active FBs – the FB/FC instance DB count is itself limited to 4 096 / 2 048; CFC charts compile into instance DBs that share the same budget.
Summary
The warning is benign at compile time but is a leading indicator of a STOP at runtime if not addressed. The shortest fix is to raise the local data size of priority 26 in the CPU Memory tab. The most robust fix is to combine that re-sizing with a refactor of the CFC charts placed in OB82/OB83/OB85/OB86. Either way, verify the cumulative local data is still ≤ 65 536 bytes and exercise one error path in production to confirm OB stack depth stays below the new budget.
FAQ
What is the maximum local data stack on a CPU 414-4H?
The SIMATIC CPU 414-4H provides a 64 KB (65 536 byte) local data stack shared between the 27 priority classes. The sum of all per-class allocations must not exceed this value; STEP 7 will reject the configuration if it does.
Which priority class is shared by OB82, OB83, OB85, and OB86 on S7-400?
On S7-400, OB82 (diagnostic interrupt), OB83 (insert/remove module), OB85 (program execution error), and OB86 (rack failure) all run at the fixed priority 26. A single change to the priority 26 budget in the HW Config Memory tab covers all four.
Why does the warning include OB121 and OB122 if those OBs are not programmed?
STEP 7 reserves a worst-case TEMP allowance for OB121 (programming error) and OB122 (I/O access error) inside the local data budget of the OB that triggered them. Even if you have not loaded OB121/OB122, the figure is included so the budget reflects what the CPU would need if synchronous errors occurred.
Can I keep the default 256-byte budget and just reduce the CFC chart size?
Yes. If you refactor the CFC charts placed in OB82/83/85/86 so that their compiled local data (including OB121/OB122 allowance) stays below 256 bytes, the default budget is sufficient and the warning disappears. This is the cleanest long-term solution when OB1 also consumes a large local data footprint.
Will the CPU go to STOP if I ignore the warning?
Not necessarily on every error event, but the first runtime error that triggers the affected OB can produce a STOP with diagnostic buffer entry 0x4B3F (local data stack overflow) if the configured priority-class budget is smaller than the worst-case requirement. Treat the warning as a hard requirement, not a soft suggestion.