Overview
The STEP 7 optional package S7-PDIAG provides automatic process diagnostics for S7-300 and S7-400 controllers. It captures supervision and interlock results from S7-Graph sequencers, FB/FC blocks, and SFC charts, then exposes them through standardized diagnostic data blocks (DBs 0–127 in the PDIAG range) for HMI visualization through ProAgent on ProTool, WinCC flexible, or TIA Portal HMI panels. When the S7-PDIAG database in the offline project does not match the diagnostic configuration of the user program, STEP 7 raises a block-consistency warning:
This warning is generated by the Check Block Consistency function (right-click on the Blocks folder → Check Block Consistency) and stops the download-to-target workflow until the diagnostic data is regenerated. The condition is not a syntax error in the user code; it is a desynchronization between the offline PDIAG configuration and the offline user program blocks. The standard manual defines the rebuild flow in the S7-PDIAG Configuring Process Diagnostics manual (entry ID 1137078).
Problem Manifestation
Field reports cluster around three observable symptoms:
- The compiler produces a single non-fatal warning during block consistency check and refuses to continue until acknowledged.
- Subsequent downloads to the CPU are blocked because the generated diagnostic DBs (DB 0–DB 127) are flagged inconsistent.
- The HMI runtime shows "no diagnostic data available" or gray step numbers in the ProAgent unit overview, even though S7-Graph sequencers contain valid supervision and interlock logic.
Typical environment for this fault:
| Component | Typical Version | Role |
|---|---|---|
| STEP 7 (SIMATIC Manager) | V5.4 / V5.5 / V5.6 | Engineering framework |
| S7-PDIAG optional package | V5.4 or higher | Generates diagnostic DBs |
| S7-Graph | V5.3+ | Source of supervision/interlock symbols |
| ProAgent | V6.0 / V6.2 | HMI-side diagnostic display |
| ProTool / WinCC flexible | ProTool V6.0 / WinCC flexible 2008 | HMI runtime |
| Controller | S7-300 (CPU 31x) or S7-400 (CPU 41x) | Target |
Root Cause Analysis
The S7-PDIAG database is a hidden sub-tree inside the S7 program that holds the diagnostic configuration (which addresses to monitor, which message classes, which message numbers, and which operands in S7-Graph steps are linked to the diagnostic DBs). Whenever you change an S7-Graph sequencer — add a step, change an interlock address, rename a symbol, or move blocks between projects — the PDIAG configuration must be re-derived. If the derivation does not run, the database goes "stale."
Common root causes, ordered by frequency in field cases:
| # | Cause | Detection Clue |
|---|---|---|
| 1 | Blocks with PDIAG attributes were copy/pasted into a new project without re-running the diagnostic compile | Project came from a customer or archive; sequencers contain supervisions; consistency warning on first open |
| 2 | S7-PDIAG option package not installed or not licensed on the engineering station | PDIAG menu is gray; KB article 18385271 applies |
| 3 | Block-number conflict between user blocks and the PDIAG-internal range | Manual section on block number assignment in the S7-PDIAG manual |
| 4 | Corrupted PDIAG sub-folder inside the S7 program (binary inconsistency) | Warning persists even after a full project re-compile |
| 5 | Reference data was regenerated but PDIAG was not re-anchored to it | Symbol table edited; supervisions now point to obsolete addresses |
Diagnostic Prerequisites
Before applying any of the recovery methods below, verify the following baseline. Skipping this step leads to the warning reappearing after the next save.
- Open SIMATIC Manager → Options → Module Information on the station and confirm a CPU 31x/41x is configured. PDIAG is unsupported on S7-1200/1500 controllers — those use the integrated diagnostics of TIA Portal.
- Open Options → Configure Process Diagnostics. If every input field is grayed out, the option package is not installed. Close the dialog and resolve licensing first (see KB 18385271).
- In the project tree, expand the S7 program and confirm whether a PDIAG sub-folder is present. If visible, note its size and timestamp — a folder with a modification time older than the most recent S7-Graph save is the prime suspect.
- Open any S7-Graph sequencer and confirm that supervisions (red circles) and interlocks (green circles) are present. Empty sequencers do not require PDIAG data and the warning should not appear in that case.
Recovery Methods
Use the methods in the order shown. Method 1 is the in-place rebuild recommended by Siemens; Method 2 is the most common workaround when no PDIAG license is available; Methods 3–5 address secondary causes.
Method 1 — Configure Process Diagnostics: Compile All
- Open SIMATIC Manager.
- Select the S7 program node (not the Blocks folder).
- Choose Options → Configure Process Diagnostics.
- In the dialog, set the diagnostic data block range (default DB 0 – DB 127) and confirm Generate message numbers automatically is enabled.
- Click Compile All. STEP 7 walks every FB, FC, SFB, SFC, S7-Graph FB, and instance DB, regenerates the PDIAG database, and writes the matching diagnostic DBs.
- Close the dialog and rerun Check Block Consistency. The warning should be replaced by "No errors found."
Method 2 — Delete and Regenerate the PDIAG Sub-Folder
Use this when the project was inherited from a customer, contains residual PDIAG data, or when no S7-PDIAG license is present on the engineering station and you want a clean shell.
- Close STEP 7 completely.
- Using Windows Explorer, navigate to the project directory:
\<project_name>\<station_name>\<cpu_name>\S7Program\PDIAG
- Delete the entire PDIAG folder.
- Reopen the project in SIMATIC Manager.
- Right-click Blocks → Check Block Consistency. STEP 7 detects the missing PDIAG database and creates a new, empty one. The warning about being "not up to date" disappears because the project is now internally consistent (it has nothing to be out of date from).
- If you have an S7-PDIAG license, immediately follow with Method 1 to populate the freshly created folder with the correct diagnostic data.
Method 3 — Recreate the Project from Source Blocks (Not Copy/Paste)
Siemens field documentation explicitly states that copy/pasting blocks between S7 programs does not carry the PDIAG attributes. A diagnostic-enabled block pasted into a fresh program has no PDIAG anchoring, so the warning returns on the first consistency check.
- Archive the original customer project using File → Archive (do not copy individual blocks).
- Open the archive in a fresh working directory and de-archive it. This rebuilds the entire S7 program tree, including the PDIAG folder structure.
- Apply your modifications directly inside the de-archived project. Do not use Windows Explorer to copy blocks into it.
- Re-run Check Block Consistency.
Method 4 — Resolve Block-Number Conflicts
The S7-PDIAG manual reserves the block-number range normally used for the diagnostic DBs. If your user program happens to occupy those same numbers, PDIAG cannot write its generated DBs and the consistency check fails with a hidden conflict.
- Open Options → Configure Process Diagnostics and note the configured DB range (default 0–127).
- Open the symbol table and search for any user DBs whose numbers fall inside that range.
- Either renumber the user DBs (recommended: move user DBs above 200) or shift the PDIAG DB range in the configuration dialog to an unused range.
- Recompile and re-check.
Method 5 — Open a Siemens Support Request
If Methods 1–4 do not clear the warning — typically when the project tree itself is structurally corrupt and STEP 7 cannot read the PDIAG sub-folder — escalate through official Siemens support with the following information attached:
- Compressed project archive (
.zipof the full project directory). - Output of Station → Consistency Check in text form.
- Screenshot of the Check Block Consistency warning.
- Version of STEP 7, S7-PDIAG, and S7-Graph installed (from Help → About).
Working Without an S7-PDIAG License
Engineers who receive a customer project but do not own an S7-PDIAG license face a specific problem: the consistency warning cannot be cleared through Configure Process Diagnostics → Compile All because the menu is grayed out per KB 18385271. The supported path in that case is:
- Apply Method 2 to obtain a clean, license-free PDIAG shell.
- Continue editing the user program (S7-Graph, FB, FC) without diagnostic configuration.
- At the point of final acceptance or hand-back, hand the project to an engineering station that has the S7-PDIAG license so the diagnostic data can be regenerated before commissioning.
Do not attempt to populate message texts or unit assignments without a license; the fields are read-only and any manual edits to the S7 program that rely on PDIAG attributes will not be reflected in the runtime diagnostic DBs.
Block Number Allocation Reference
To prevent block-number conflicts at the design stage, observe the following allocation, taken from the S7-PDIAG manual:
| Block Type | Reserved / Recommended Range | Note |
|---|---|---|
| Diagnostic DBs (PDIAG) | DB 0 – DB 127 (default), configurable | Do not assign user DBs in this range |
| S7-Graph instance DBs | FB-specific, allocated by Graph compiler | Protected by Graph |
| User DBs | DB 200 and above (recommended) | Leave headroom for PDIAG expansion |
| S7-PDIAG system FBs | Generated by Compile All | Do not edit manually |
Verifying the Fix
After applying any of the recovery methods, perform the following verification sequence:
- Offline consistency: Right-click Blocks → Check Block Consistency. Expected: "No errors or warnings found."
- Cross-reference check: Open one S7-Graph sequencer, click on a supervision (red circle), and confirm the Cross-References view shows the diagnostic DB. If the cross-reference is empty, the supervision is not anchored to PDIAG.
- Download and online test: Download the entire program to the CPU in Stop mode, restart in Run, and force one supervision condition. The ProAgent unit view on the HMI should display the corresponding step number, message text, and timestamp within 2 scan cycles (typical CPU 315-2 DP: 40–80 ms).
- Online PDIAG status: In SIMATIC Manager, choose PLC → Diagnostics/Setting → Process Diagnostics. The status should read "PDIAG active" and list the configured units.
Preventive Best Practices
- Always run Configure Process Diagnostics → Compile All immediately after any S7-Graph edit. Treat it as a mandatory post-step, not an optional one.
- Archive the entire project (not individual blocks) when handing work to a colleague or contractor. PDIAG data only survives an archive/de-archive cycle, not a copy/paste.
- Reserve DB 0 – DB 199 for PDIAG in your coding standard, even if your current PDIAG range is narrower. Future reconfiguration will then be non-breaking.
- Document the S7-PDIAG option package version in the project header. Mixing PDIAG V5.3 projects with PDIAG V5.6 engineering stations has been observed to produce silent attribute loss.
- If you work in a mixed team where some engineers have a PDIAG license and others do not, keep the diagnostic configuration frozen on a single engineering station. Edits by un-licensed stations will be rejected by the consistency check.
Troubleshooting Matrix
| Symptom | Most Likely Cause | First Action | Fallback |
|---|---|---|---|
| Warning on inherited project | Copy/paste of PDIAG blocks | Method 3 (re-archive) | Method 2 (delete PDIAG folder) |
| PDIAG dialog fields all gray | Option package not installed | Install S7-PDIAG license | Method 2 + hand off to licensed station |
| Compile fails on block-number conflict | User DB overlaps PDIAG range | Method 4 (renumber) | Re-allocate PDIAG DB range |
| Warning persists after Method 1 | Corrupted PDIAG folder | Method 2 (delete + regenerate) | Method 5 (support request) |
| HMI shows no diagnostic data | ProAgent not linked to DBs | Recompile and re-download | Check ProAgent unit configuration in ProTool/WinCC flexible |
| Compile All does nothing | PDIAG not licensed | Per KB 18385271, install option | Method 2 to obtain a clean shell |
Why does STEP 7 say "The S7-PDIAG in the S7 program are not up to date" after I copy blocks from another project?
Copying and pasting individual blocks into a fresh S7 program does not carry the S7-PDIAG attributes. The pasted blocks retain their supervision and interlock logic, but the PDIAG sub-folder in the target project is empty or points to a different DB range. Re-archive and de-archive the project as a whole, or delete the local PDIAG folder so STEP 7 regenerates it, then re-run Options → Configure Process Diagnostics → Compile All.
I do not have an S7-PDIAG license. Can I still clear the consistency warning?
Yes — the supported path is to delete the PDIAG sub-folder inside the S7 program directory while STEP 7 is closed, then reopen the project. STEP 7 will create a new empty PDIAG folder and the "not up to date" warning disappears. Be aware that without a license you cannot edit diagnostic message texts or run Compile All (per Siemens KB 18385271), so hand the project to a licensed station before commissioning.
What block-number range does S7-PDIAG use, and can I change it?
The default is DB 0 to DB 127, allocated by the PDIAG compiler. The range is configurable in Options → Configure Process Diagnostics. Whatever range you set, do not assign user DBs inside it; the S7-PDIAG manual documents this as a hard constraint. A common coding standard is to place user DBs at DB 200 or higher.
Why are the fields in the Configure Process Diagnostics dialog grayed out?
The most frequent cause is that the S7-PDIAG optional package is not installed on that engineering station, or the license key is missing. Siemens documents this behavior in entry 18385271. Remedy: install the licensed S7-PDIAG option via the STEP 7 setup, or delete the PDIAG sub-folder to obtain a clean shell that does not require the option to compile.
Will deleting the PDIAG folder lose my diagnostic message texts?
If you have an S7-PDIAG license, yes — the message texts and unit assignments live in that folder. Export them via Configure Process Diagnostics → Export before deleting, then re-import after regenerating. If you do not have a license, the folder typically contains only residual or default data and can be deleted without functional loss, as long as you re-compile on a licensed station before commissioning.