1. Problem Overview
Hardware configuration faults in TIA Portal V15 (and the closely related V15.1) typically surface as a red banner in the project tree, a flashing SF/ERROR LED on the physical CPU, or as discrete event entries inside the online Diagnostics buffer. Two failure modes account for the majority of the field reports on S7-1200 and S7-1500 stations during the V15 generation:
- Module article number mismatch – the article number (MLFB / order number) of the device configured offline in the device view does not match the article number reported by the physical module. The CPU refuses to go to RUN and posts an entry such as "Difference between configured and plugged module".
-
Area length fault (OB121 / SF) – the user program reads or writes a memory range that exceeds the configured length of a data block, an input/output area, or a multi-instance. TIA Portal logs an
IO access errororArea length errorin the diagnostic buffer.
Both faults are recoverable without re-installation of the engineering software. This reference documents the diagnosis, root cause, and correction procedure for each, including the diagnostic buffer navigation path, the meaning of each event, and the verification sequence used to clear the CPU back to RUN.
2. Prerequisites
Before opening any project, confirm the following:
- TIA Portal V15 or V15.1 installed with administrative rights; the latest Hotfix bundle applied (HSPs for new modules are mandatory for S7-1500 firmware ≥ V2.6).
- Online access to the target station via PROFIBUS, PROFINET, or Ethernet – the PG/PC interface must match the subnet the CPU is on.
- Read/write access to the project file (offline) and the read/write password (online) for the CPU.
- The exact article number (printed on the front of the module, e.g.
6ES7511-1AK02-0AB0) and the Firmware version (printed below the article number, e.g.V2.6) for every physical module in the rack. - The current offline project should be backed up before any online compare or download.
3. Symptom Matrix
| Symptom | Location in TIA Portal | Most Likely Root Cause |
|---|---|---|
| Red icon next to the device in the project tree | Project navigation, Device view | Article number mismatch (slot empty or wrong module ordered) |
| Diagnostic event "Difference between configured and plugged module" | Online → Diagnostics buffer | Offline article number ≠ physical article number, or wrong HSP installed |
| Diagnostic event "Area length error when reading" / OB121 start event | Online → Diagnostics buffer | SCL array index out of bounds, indirect addressing past DB length, POKE/POKE_BLK beyond area |
| CPU stays in STOP, MRES required | Operator panel / online diagnostics | Peripheral access error (OB122) or programming error (OB121) unhandled |
| Online compare: "Configuration differs in slot X" | Online → Compare offline/online | Slot assigned offline but empty on rack, or vice versa |
4. Reading the Diagnostic Buffer
The diagnostic buffer is the authoritative source for any fault that brings a Siemens S7 CPU out of RUN. In TIA Portal V15, the buffer is reached via Project tree → [CPU] → Online → Diagnostics buffer after an online connection has been established. The buffer is a circular log; the most recent event is on top. Each row contains the timestamp, the event ID, and a short text.
- Right-click the CPU in the project tree and choose Go online → Online and diagnostics.
- Expand the Diagnostics folder in the diagnostics tree and double-click Diagnostics buffer.
- The default view shows the events in a list. Click a single row to populate the Details section below the table.
- For each event, note the Event ID, the Address (slot / channel / offset), and the Additional details block. The Go to button (the blue arrow icon at the top of the properties pane) jumps from the event to the affected FB/FC/DB in the program editor – this is the fastest way to locate the line that raised the fault.
- Export the entire buffer to a text file via the Save as icon on the diagnostics toolbar; the resulting
.txtis the canonical evidence you should attach to any support ticket.
5. Root Cause A – Module Article Number Mismatch
The CPU compares, on every restart and at every configuration download, the article number of every slot in the offline project against the article number returned by the physically inserted module. If the numbers differ, the CPU logs event 0x0E0E ("Difference between configured and plugged module") and refuses to enter RUN. The most common reasons are:
- The offline project still references the PLCSIM simulator (article numbers in the
6ES7 841-…range) because a previous online test against PLCSIM was not replaced before downloading to the real CPU. - The firmware version of the real CPU is newer than the firmware supported by the installed HSP. The article number is the same, but the firmware suffix (e.g.
0AB0vs0AB1) is treated as a different article. - The slot is empty in the rack but the project still has a module ordered – the diagnostic event is the same as for an article mismatch.
5.1 Procedure – resolve article number mismatch
- Identify the slot the diagnostic buffer is complaining about (column "Slot" in the event row).
- Right-click the device in the project tree and choose Device view; the slot in question is highlighted with a red icon.
- Delete the wrongly ordered module from the slot.
- Open the Hardware catalog on the right side of the device view. Use the search field and enter the article number that is printed on the physical module (for example
6ES7511-1AK02-0AB0). - Drag the correct module into the slot.
- Right-click the CPU and choose Compile → Hardware (rebuild all) to refresh the system data blocks.
- Download the new hardware configuration to the CPU. Use Download to device → Hardware configuration; do not perform a full download of the software – the program blocks are unchanged.
- Restart the CPU (STOP → RUN) and verify the diagnostic buffer no longer contains the
0x0E0Eevent.
6ES7 841 belongs to the S7-PLCSIM virtual rack. A project that still contains such an article number cannot be downloaded to a physical S7-1500 / S7-1200 CPU – the CPU will reject the configuration with the mismatch event above. Remove the PLCSIM device and replace it with a real CPU of the same family (and matching firmware) before the download.
6. Root Cause B – Area Length Fault (OB121 / OB122)
An area length fault is a programming error: the user program reads or writes past the end of a configured memory area. On S7-1500, the CPU raises OB121 (Programming error) for a DB/FB/FC access beyond the block length, and OB122 (I/O access error) for a peripheral access past the I/O area or to a non-existent slot. If neither OB is loaded, the CPU transitions to STOP.
Typical code patterns that trigger the fault:
- SCL
FORloop counter exceeds the upper bound of an array declared in the DB. - LAD/FBD MOVE_BLK or MOVE_BLK_VARIANT where the source + count exceeds the source DB length.
- Indirect addressing via
P#DBxx.DBX<offset>where the offset is computed at runtime and the resulting pointer points past the DB length. - Access to an I/O address that is not configured in the device view (e.g.
%IW100on a 16-channel analog module that only exposes 8 channels).
6.1 Interpreting the OB121 start information
| Local byte (OB121) | Meaning | Field action |
|---|---|---|
| LW0 / LB0 | Event ID (e.g. 0x2522 = area length error when reading) |
Cross-check with the diagnostic buffer |
| LW4 | Block number that raised the error | Open the block in the program editor |
| LW6 | Relative address inside the block (offset of the instruction) | Use "Go to" from the diagnostic buffer detail |
| LW8 | DB number (0 = not a DB access) | Inspect the DB length vs. the access |
6.2 Procedure – resolve area length fault
- From the diagnostic buffer, click the Go to button in the Details view to jump to the offending instruction in the program editor.
- Identify the access pattern. For an SCL array access, look at the declared array bounds in the DB and the index variable used at runtime.
- Add a guard on the index variable, for example:
// SCL – bounds check before array access IF (#iIndex >= 0) AND (#iIndex < "DB_MyData".iArrayLength) THEN "DB_MyData".arrValues[#iIndex] := #iValue; END_IF; - For a MOVE_BLK with a computed count, clamp the count to the remaining length of the source area:
// SCL – clamp MOVE_BLK count #iCount := MIN(IN := #iRequestedCount, IN2 := "DB_Source".iDataLength - #iSrcOffset); BLKMOV(SRCBLK := "DB_Source".arrData[#iSrcOffset], DSTBLK := "DB_Dest".arrData[#iDstOffset], COUNT := #iCount); - Recompile the program blocks and download the software to the CPU.
- Execute the program path that previously triggered the fault. Confirm the diagnostic buffer is clean for at least one full cycle.
7. Diagnostic Buffer Export Procedure
When escalating to a Siemens support engineer, the buffer must be exported, not screenshotted. From the diagnostics buffer view in TIA Portal V15:
- Click the Save icon in the toolbar of the diagnostics buffer view (the floppy-disk symbol, rightmost in the view toolbar).
- Choose Save as type: Text file (*.txt). The exported file contains every event with timestamp, Event ID, OB number, and full detail text – this is the version Siemens can parse.
- Compress the export plus any project screenshots into a single
.ziparchive before sending; the forum/portal upload size limit is typically 5 MB, the zip usually fits well below that.
If the online connection is unstable and the live buffer cannot be read, the CPU retains the most recent ~120 events in non-volatile memory after a power cycle. Power-cycle the CPU once, reconnect, and read the buffer before the SF LED is cleared.
8. Online/Offline Compare and Configuration Download
After editing the device configuration, always run a structured online compare before downloading:
- Right-click the device and choose Compare → Offline/online.
- The compare editor opens with three columns: offline, online, and a status column. Differences are highlighted in orange.
- For a pure article-number fix, only the Hardware configuration row should show a difference. The Software and PLC tags rows should remain green.
- Click the Download to device button at the top of the compare editor. In the download dialog, leave Download hardware configuration checked and uncheck Download software to device unless the program has also changed.
- Confirm the security prompt (TIA Portal V15 raises a dialog stating the article numbers differ). Acknowledge by clicking Load.
- Download to device – full download, stops the CPU.
- Download hardware configuration – system data only, does not affect the user program; CPU stays in RUN if the program does not reference the changed slots.
- Download software to device – program blocks, does not change I/O assignment.
9. Indirect Addressing and SCL Array Bounds – Field-Proven Patterns
Two programming patterns generate the majority of area-length faults in TIA Portal V15 projects:
9.1 Indirect any-pointer access
// SCL – safe indirect access with bounds guard
#iIndex := "DB_Ctrl".iIndex;
#iMax := "DB_Data".iDataLength - 1;
IF (#iIndex >= 0) AND (#iIndex <= #iMax) THEN
#dValue := "DB_Data".arrValues[#iIndex];
ELSE
#dValue := 0;
"DB_Ctrl".bRangeError := TRUE; // alarm to HMI
END_IF;
9.2 MOVE_BLK with runtime count
// SCL – never let COUNT exceed the destination length
#iCount := LIMIT(MN := 0,
IN := "DB_Src".iValidCount,
MX := ("DB_Dst".iDataLength - #iDstOffset));
BLKMOV(SRCBLK := "DB_Src".arrData[#iSrcOffset],
DSTBLK := "DB_Dst".arrData[#iDstOffset],
COUNT := UDINT_TO_UINT(#iCount));
9.3 Symbolic access preferred over absolute
Prefer symbolic tags (e.g. "DB_Motor".iSpeedSetpoint) over absolute addresses (DB100.DBD20). Symbolic access is type-checked at compile time; the compiler rejects an out-of-bounds symbolic access before the code ever reaches the CPU. Absolute addressing is checked only at runtime, where the only feedback is the OB121 event.
10. Firmware / HSP Compatibility
Article number mismatches are frequently caused by an installed TIA Portal that is older than the firmware of the physical module. TIA Portal V15 supports S7-1500 CPUs up to firmware V2.6 out of the box; firmware V2.7 and later require the matching Hardware Support Package (HSP) installed into the TIA Portal installation.
| CPU article number | Firmware | Minimum TIA Portal version | Required HSP |
|---|---|---|---|
| 6ES7511-1AK00-0AB0 | V1.8 | V13 SP1 | none |
| 6ES7511-1AK01-0AB0 | V2.0 | V14 SP1 | HSP 0185 |
| 6ES7511-1AK02-0AB0 | V2.6 | V15 | none (in V15 base) |
| 6ES7511-1AK03-0AB0 | V2.9 | V16 | HSP 0293 |
| 6ES7518-4AP00-0AB0 | V2.9 | V16 + Update 4 | HSP 0306 |
If the firmware of the physical CPU is newer than the highest version supported by your TIA Portal, the hardware catalog will not list the article number, and the device view will fall back to the closest older article – which is what produces the mismatch event at download time. The remediation is either to upgrade the engineering software or to downgrade the CPU firmware to a version supported by the installed TIA Portal.
To read the firmware of the physical module without a project, navigate Online → Accessible nodes, pick the CPU on the network, and inspect the Diagnostics → Module information tab – the article number, firmware version, and serial number are all listed there.
11. Verification Procedure After Repair
Once the configuration has been corrected and downloaded, run the following verification sequence to confirm the CPU is back to a clean state:
- Read the diagnostic buffer; confirm the last entry has a green status (no error pending).
- Confirm the CPU is in RUN and the RUN LED is solid green; SF/BF/MAINT LEDs are off.
- Run an online/offline compare; all rows should be green (no difference).
- Force a peripheral refresh (Online → Monitor → Update values) on the slots that were modified; the I/O values should follow the field wiring.
- Trigger the code path that previously caused the area-length fault at least three times; the diagnostic buffer should remain clean.
- Cycle power to the station (OFF, wait 5 s, ON) and re-read the buffer; the buffer must still be clean, confirming the fault is not hidden in a pending start-up event.
12. Best Practices – Preventing Hardware Configuration Errors in V15
- One CPU per project family. Maintain a master project per CPU article number; clone the master for every new station and only edit the station-specific I/O and program. This guarantees the article number in the device view matches the physical part.
- Lock the HSP set. In a multi-engineer team, agree on the exact TIA Portal version and the exact set of HSPs installed on every PG/PC. A drift of one HSP is enough to produce a mismatch event on download.
- Separate PLCSIM projects from real projects. A PLCSIM article number (6ES7 841-…) in the offline project is the most common cause of a configuration mismatch on the first download to a real CPU. Keep PLCSIM test projects in a separate folder and never copy/paste a PLCSIM device into a production project.
- Always include OB121 and OB122. With both error OBs loaded, an area-length fault no longer stops the CPU; it raises an entry in the diagnostic buffer and the program continues. The error can be diagnosed and corrected during normal operation instead of triggering an unscheduled stop.
- Use symbolic access for new code. Symbolic access is compile-checked; absolute access is only runtime-checked. Reserve absolute addressing for legacy code that cannot be migrated.
- Run "Compile → Software (rebuild all)" after every hardware change. TIA Portal V15 occasionally leaves stale system data blocks after a slot re-ordering; a full rebuild regenerates the SDBs and prevents download-time conflicts.
- Export the diagnostic buffer after every commissioning shift. A snapshot of the buffer taken at the end of the shift is the easiest way to detect intermittent faults that do not stop the CPU.
13. Quick Reference – Diagnostic Buffer Event IDs
| Event ID (hex) | Meaning | Action |
|---|---|---|
| 0x0E0E | Difference between configured and plugged module | Match article number / install correct HSP |
| 0x2521 | Area length error when writing | Bounds-check the destination access |
| 0x2522 | Area length error when reading | Bounds-check the source access |
| 0x2523 | Area length error when writing a parameter | Inspect the FB input length |
| 0x2531 | DB not loaded / wrong DB number | Check DB number vs. project |
| 0x2942 | I/O access error – slot missing | Re-download hardware configuration |
| 0x3210 | Diagnostic interrupt from module | Read module-specific diagnostic data |
| 0x4300 | PROFINET station failure | Check cable / device name / IP |
14. FAQ
What does the error "6ES7 841" mean in my TIA Portal V15 device view?
Any article number that starts with 6ES7 841 belongs to the S7-PLCSIM virtual PLC, not a physical CPU. The CPU will reject the configuration with a "Difference between configured and plugged module" event. Delete the PLCSIM device, open the hardware catalog, search for the article number printed on the front of the real CPU (for example 6ES7511-1AK02-0AB0), and drag it into the slot.
How do I read the diagnostics buffer of an S7-1500 in TIA Portal V15?
Right-click the CPU in the project tree, choose Go online → Online and diagnostics, then open Diagnostics → Diagnostics buffer. Click an event row to populate the Details view; use the Go to button in the properties pane to jump from a fault event to the offending instruction in the program editor. Export the full buffer with the Save as toolbar button, choosing Text file (*.txt).
Why does the CPU report an "Area length error" after I add a new SCL FOR loop?
The most common cause is the loop counter exceeding the declared array length in the destination DB. Add a runtime guard such as IF #i < "DB_Data".iArrayLength THEN ... END_IF, or change the array declaration in the DB to cover the full range. Compile the software, download the blocks, and re-run the code path that triggered the fault.
My TIA Portal V15 installer fails mid-way through; how do I recover?
Fully restart Windows (sign-out is not sufficient), then re-launch the TIA Portal V15 setup. If the installer still fails, use the Windows installer cleanup utility to remove any orphaned V15 registry keys, then install the latest V15.1 update on top of the V15 base installation. The official Siemens Knowledge Base article for V15.1 installation issues is referenced in the Microsoft Q&A thread on TIA Portal V15.1 install recovery.
Do I need to load OB121 and OB122 into the CPU?
It is strongly recommended. With OB121 (programming error) and OB122 (I/O access error) loaded, an area-length fault or peripheral-access fault no longer stops the CPU – the OB runs instead and the fault is recorded in the diagnostic buffer for later analysis. Without these OBs, the default reaction of the CPU is to transition to STOP, which on a production line means an unscheduled machine stop.