Resolving STEP 7 V5.5 to TIA Portal Migration Compile Errors
A STEP 7 V5.5 source project that compiles cleanly inside SIMATIC Manager can still surface a wave of compiler errors after the migration wizard hands the project over to TIA Portal. The most common symptom is a tree of red entries under Program blocks, blocked offline/online comparisons, and a top-level compiler message stating that one or more blocks (typically DB10 plus any associated UDTs) could not be re-generated. The source of the failure almost always lives in the V5.5 project itself, not in TIA Portal. This reference walks through the precise recovery procedure Siemens field engineers use to clear those errors, including Check Block Consistency, Compile All, Save As with Reorganization, and targeted DB / UDT re-entry.
1. Problem Description
The sequence that produces this failure pattern is consistent across S7-300 and S7-400 migrations:
- Engineer opens an existing STEP 7 V5.5 project on the source workstation.
- Engineer launches the TIA Portal migration wizard (Project > Migrate project) and follows the prompts.
- Migration reports Migration successfully completed, but the resulting TIA Portal project shows red entries in the Program blocks folder.
- Executing Compile > Software (rebuild all blocks) in TIA Portal returns errors of the form: Block DB10 could not be compiled, Inconsistent UDT referenced by DB10, or Internal error during block generation.
- Even after Compile all in the original V5.5 project is executed again, the post-migration compile still fails with the same fault signature.
The error is reproducible: deleting the offending DB / UDT manually inside TIA Portal and re-typing it from scratch often makes the compile pass, but that is a destructive workaround that breaks references in code, HMI tags, and F-configurations. The correct fix is to clean the V5.5 project before the migration wizard runs.
2. Root Cause Analysis
STEP 7 V5.5 stores blocks in two mirror locations:
- The online container on the PLC or its offline replica (path
...\<project>\s7asrcom\<cpu>). - The offline source container under the Blocks folder in SIMATIC Manager (path
...\<project>\<station>\<cpu>\S7Program\Blocks).
When a project is edited over many years without being recompiled, the offline and online containers drift apart. SIMATIC Manager tolerates this drift and will still let the user save the project, but the TIA Portal migration translator treats every block as authoritative and regenerates cross-references, UDT expansions, and DB initial values from the offline source. If those offline sources contain orphaned fragments - for example, a UDT whose declaration was edited but never recompiled into the DB, or a DB that references a deleted UDT number - the migration wizard successfully copies the bits but cannot rebuild the symbolic table. The result is a structurally valid TIA Portal project whose blocks fail to compile in the TIA Portal compiler.
The official Siemens migration documentation states that "you can migrate all configurations and objects from SIMATIC STEP 7 V5.4 SP5 that the installed version of the TIA Portal supports". Anything older than V5.4 SP5, or anything containing pre-V5.4 SP5 block fragments even in a newer project, will silently weaken the migration. See the Siemens Migration of STEP 7 Projects (S7-300, S7-400) reference for the supported source range.
3. Symptoms and Diagnostic Matrix
Use the matrix below to map the symptom you observe against the most likely root layer in the V5.5 project.
| Symptom in TIA Portal | Likely Source | First Fix Attempt |
|---|---|---|
| Block DBxx could not be compiled for a single DB | Stale DB instance data; UDT mismatch | Re-type the DB declaration in V5.5 and recompile |
| Every DB fails with Inconsistent UDT | UDT was edited online-only | Compile all blocks in SIMATIC Manager |
| Migration wizard reports Unknown block type | Third-party block or pre-V5.4 SP5 object | Replace with V5.4 SP5+ compatible alternative |
| Project migrates but Compile (rebuild all) halts at FC0 | FC contains unresolved symbol from deleted library | Resolve symbol then recompile in V5.5 |
| Blocks compile but HMI tags show invalid pointer | DB layout changed but HMI configuration not updated | Recompile net in V5.5 to refresh symbols |
| Compiler hangs on large multi-instance DB | UDT recursion deeper than 8 levels | Flatten UDT structure before migration |
4. Prerequisites
Before executing the recovery sequence below, confirm the toolchain meets the documented baseline:
- STEP 7 V5.5 + SP x installed on the source workstation (HF1 or later recommended). The project must open cleanly in V5.5 - if it opens only in V5.4, upgrade the project first.
- TIA Portal installed at a version listed as a valid migration target for the original V5.5 release (for example, TIA Portal V16 or V20). Each TIA Portal release adds new migration compatibility modes; the latest mode is the default and the most forgiving.
- Read/write access to the project folder. The Reorganization (slow) option rewrites the offline container and cannot complete against a read-only source.
- Up-to-date backup of the V5.5 project. The reorganization path produces a new file name; preserve the original
.s7pas read-only until the migrated TIA Portal project passes the verification step in Section 9.
5. Step-by-Step Recovery Procedure
Step 1 - Open the source project in STEP 7 V5.5
Launch SIMATIC Manager and open the original .s7p project. Verify the station and CPU are present and that the Blocks folder is visible. Do not perform an online download at this stage.
Step 2 - Execute Check Block Consistency
In the Blocks folder, right-click and choose Check Block Consistency. In the dialog:
- Select the radio button Program (not Individual blocks).
- Click Check. Allow several minutes for large projects - the tool re-parses every OB, FB, FC, DB, SFB, SFC, and UDT.
- If any block reports Time stamp conflict or Inconsistency between interface and call, double-click the entry. SIMATIC Manager will open the affected block and place the cursor on the offending line.
- Note any Blocks not compiled rows. Those blocks must be compiled before the migration.
Step 3 - Compile all blocks
Right-click the Blocks folder and choose Compile. In the dialog set Scope to All (not Only changed). This rebuilds every block from source. Expected result: every block in the folder shows a fresh time stamp and the compiler closes without red rows.
Step 4 - Resolve time stamp conflicts in OB / FB / DB interfaces
If a block was edited but not saved with reorganization, its interface time stamp can drift away from the call sites. Fix the call sites first:
- Open the block that the consistency check flagged.
- Navigate to the line where the called FB or DB instance is used.
- Delete the block name entirely (do not just retype it) and re-type it from the program-element browser.
- Save and close the block, then repeat Check Block Consistency > Program.
This procedure forces SIMATIC Manager to regenerate the multi-instance dependency tables that the migration translator relies on.
Step 5 - Save As with Reorganization (slow)
With the project fully compiled, perform a structural cleanup:
- From the SIMATIC Manager menu choose File > Save As.
- Enter a new project name (for example, add the suffix
_MIG). The original project must remain untouched. - In the Options dialog of Save As, tick With reorganization (slow).
- Click OK. Reorganization can take 10-60 minutes for large S7-400 projects with deep UDT hierarchies.
- Verify the new project opens cleanly and Check Block Consistency > Program still passes.
The reorganization path physically rewrites the offline container on disk. Any orphaned fragments stored in the previous container are discarded, and any DB or UDT whose online image did not match the source is rebuilt against the source.
Step 6 - Targeted DB / UDT re-entry (if Step 5 is insufficient)
If a single DB still fails after Steps 1-5, perform a focused re-entry against the reorganized project:
- Open DB10 (or whichever DB the TIA Portal compile flagged) in LAD / FBD / STL editor.
- Right-click the DB and choose Generate source file. Save the source to disk.
- Close and delete the DB from the Blocks folder.
- Reinsert the DB by choosing Insert > S7 Block > Data Block, then compile the generated source back in.
- Recompile the project. Repeat for any UDT that the consistency check flagged before Step 5.
This procedure is destructive to the DB number only - all cross-references are rebuilt by the next compile.
Step 7 - Library blocks
If the project contains S7 libraries (for example, the PID Self-Tuner blocks or the Standard Library for S7-300/400):
- Open the library in V5.5.
- Run Check Block Consistency > Program on each library family.
- Compile all blocks in each library family.
- Save with reorganization.
Uncompiled library blocks are the most common reason the migration wizard completes but offline compile in TIA Portal then halts on the first FB that calls into the library.
Step 8 - HMI / WinCC flexible configurations
If the project bundles WinCC flexible ES or ProTool objects (the V5.5 / V5.4 SP5 source can contain them):
- Open the HMI station in WinCC flexible.
- Choose Project > Compiler > Compile (rebuild all).
- Save the project. Close WinCC flexible.
Uncompiled HMI projects convert into TIA Portal but tag pointers remain symbolic against the V5.5 DB layout. Recompiling inside WinCC flexible forces the tag DB pointers to align with the freshly compiled V5.5 blocks before migration.
6. Migration Workflow
Only after the V5.5 source passes Check Block Consistency, Compile all, and Save As with Reorganization should you invoke the TIA Portal migration wizard:
- Launch TIA Portal.
- Open the migration wizard: Project > Migrate project.
- Point the wizard at the reorganized
.s7pfile, not the original. - Select Continue migration even if errors occur only as a last resort; never select it for a project that still fails the V5.5 consistency check.
- Choose the destination TIA Portal version and click Migrate.
For the complete migration mapping reference (which objects survive the move, which need to be re-inserted, and which alarms are renumbered), consult the Siemens TIA Portal V20 migration documentation.
7. Post-Migration Verification
Inside the freshly migrated TIA Portal project, perform the following checks before declaring success:
- Compile (rebuild all blocks) under Program blocks. The expected result is zero red rows, zero warnings of class Error.
- Cross-reference of every UDT and every DB that was flagged in Section 3. The references should resolve to the same call sites as in V5.5.
- Block consistency from the project tree: right-click the CPU > Compile > Check block consistency.
- Compare online/offline: if a physical PLC is available, place the project online and run an online snapshot. The Go online result should report no differences.
- HMI tag links: open the HMI tag editor and confirm every tag points to a valid DB element. Stale pointers will appear as Quality code: Bad in the tag table.
8. Alternative Recovery Methods
If Step 5 still leaves the project uncompilable, work through these alternatives in order:
| Method | When to Apply | Trade-off |
|---|---|---|
| Export DB / UDT as source, delete and re-insert from source | Single DB misbehaves after compile all | Local fix; lowest risk |
| Cross-compile via SIMATIC Manager into a second CPU (300 <-> 400) | UDT recursion limit hit on 400 | Requires spare CPU object |
| Strip the project down to OB1 + a single FB | Wizard stops on unknown block type | Manual rebuild of test bench |
| Use TIA Portal migration "compatibility mode = V13 SP1" | Newer TIA Portal rejects a V5.5 syntax fragment | Lose newer compiler checks |
| Move to Continue on error and inspect the journal | Time-pressured recovery | Permits silent partial failure |
9. Prevention Checklist for Future Migrations
- Maintain a written Compile all checkpoint before every backup or release of a V5.5 project.
- Run Check Block Consistency > Program monthly on long-running service projects.
- After every library update, perform Save As with Reorganization on the consuming project.
- Annotate cross-references with the source compiler version (for example,
// compiled V5.5 SP2 2024-03-12) so future migrations have a build provenance. - Track which TIA Portal version each project was last migrated into; reverse migrations are not supported.
10. Common Error Messages and Resolutions
| TIA Portal Compile Message | Caused By | Resolution |
|---|---|---|
| Block DB10 could not be compiled | DB source out of sync with referenced UDT | Steps 3-5 |
| UDT12: Inconsistent declaration | UDT edited online only, never saved to source | Step 4 |
| Internal compiler error 0x80047201 | Project residue from pre-V5.4 SP5 conversion | Step 5 (reorganization) |
| Symbol FBxyz not found | Library block removed but call remained | Step 7 |
| Maximum recursion depth exceeded in UDT | UDT references itself indirectly | Flatten UDT chain |
| Access denied to S7 file | Project file marked read-only | Clear read-only flag before Save As |
11. Field-Proven Caveats
- The Save As with Reorganization path does not delete the source project; it produces a new
.s7p. Always migrate the reorganized copy. - Reorganization is single-threaded inside SIMATIC Manager. Closing the dialog during a rewrite will leave the project in a half-written state; do not interrupt.
- On Windows file systems with file-system reparse points or antivirus filters, reorganization can hang silently. Add the project folder to the AV exclusion list before starting.
- If the project contains any S7-PDIAG, S7-Graph, or S7-HiGraph source, open those editors in V5.5 once, recompile, and save before migration. Those source packages keep a parallel offline container that the migration wizard does not synthesize.
- Migrated HMI alarms keep their V5.5 numbers but the category assignments may invert. Verify the Alarm class column after the move.
12. FAQ
Do I really have to compile the V5.5 project before migrating to TIA Portal?
Yes. The migration wizard translates the compiled offline container, not the source. An uncompiled project still migrates but offline compile in TIA Portal then halts on the first inconsistent block. Always run Check Block Consistency > Program followed by Compile all before launching the migration wizard. Reference: Siemens migration documentation.
What is the minimum STEP 7 source version TIA Portal accepts?
V5.4 SP5 is the published minimum for native migration. Any project older than V5.4 SP5 - or containing block fragments from older revisions - must be upgraded in SIMATIC Manager first. Reference: Siemens TIA Portal V20 migration guide.
Will Save As with Reorganization (slow) fix every migration compiler error?
It fixes roughly 80% of structural drift errors, particularly orphan UDTs and stale DB instance data. Logical errors (missing library blocks, unresolved symbols) still need manual intervention through Steps 4 and 7 above.
Can I delete a DB in TIA Portal and recreate it after migration?
You can but you should not. The DB numbering is referenced by every FC / FB that uses it, by the HMI tag table, and by the WinCC alarm archive. Deleting and re-inserting breaks those links. The correct fix is to clean the V5.5 source before migration.
How long should Save As with Reorganization take?
For a typical S7-300 project with 50 blocks and shallow UDTs, 1-3 minutes. For a large S7-400 with several hundred blocks and deep multi-instance FBs, expect 10-60 minutes. If the dialog has not progressed in over an hour, check the AV exclusion list and retry.