Problem Overview
The KTP400 Basic PN (and the related KTP400 Basic DP variants in the SIMATIC HMI Basic Panel line) is well known for hanging at approximately 95% of the compile step when a TIA Portal project is generated or downloaded. With TIA Portal V18 (and to a lesser extent V17 and V16 Update 7+), compile durations of 15–30 minutes are not unusual on a healthy engineering station. Once the IM (Intermediate) folder of the project becomes corrupted by antivirus scans, network share interruptions, or prior abrupt termination of TIA Portal, the compile operation may appear to hang indefinitely at the same percentage.
This article documents the root causes, diagnostic steps, and verified remediation procedures based on the Siemens Support entry 109778709 – How do you reset the temporary data of a TIA Portal project? and field reports from commissioning engineers.
Affected Hardware and Software Matrix
| Component | Article Number | Notes |
|---|---|---|
| KTP400 Basic PN | 6AV2 123-2DB03-0AX0 | 4" TFT, PROFINET, WinCC Basic V18 image |
| KTP400 Basic DP | 6AV2 123-2DA03-0AX0 | 4" TFT, PROFIBUS variant |
| KTP400 Basic PN (mono) | 6AV2 123-2DB13-0AX0 | Monochrome variant |
| TIA Portal V18 | 6ES7 822-1AA04-0YA0 (Basic) | Build 18.0.0.0 and Updates 1–5 |
| WinCC Basic V18 image for KTP400 | V18.00.01.00 | Delivered on TIA Portal DVD; runtime image |
| STEP 7 V18 (for S7-1200 behind the panel) | — | Co-install required for PLC↔HMI tag communication |
Root Cause Analysis
The 95% hang is not a single defect. It is a symptom of one or more of the following five underlying conditions, all of which converge on the same HMI generator bottleneck inside S7RTM.dll and the HMIGenerator.exe subprocess.
Cause 1 – Corrupted IM\HMI\C Directory
Every TIA Portal project contains an intermediate folder used by the HMI compile pipeline:
-
@PROJECT_ROOT@\IM\HMI\C\– current compile cache -
@PROJECT_ROOT@\IM\HMI\C_old\– previous successful compile -
@PROJECT_ROOT@\IM\HMI\SRC\– HMI source fragments -
@PROJECT_ROOT@\IM\HMI\BIN\– generated runtime files (*.fwx, *.log)
If TIA Portal terminates abnormally, a Windows Defender real-time scan locks a file mid-write, or the network share hosting the project drops a packet, the C directory can become inconsistent. On the next compile, the generator reads a partial manifest, retries, and stalls when it cannot reconcile the version table with the source tree. The progress bar will sit at 95% because the compile is functionally complete; only the IM persistence step remains.
Cause 2 – Project Stored on a Network Share or Cloud-Synced Folder
When the .ap18 archive sits on a SMB / NFS share, on OneDrive, on Dropbox, or on a Git-Annex mirror, file-locking latency dramatically extends every file enumeration performed by the HMIGenerator. Field data shows compile times on a NAS can be 6–10× longer than on a local NVMe. The 95% stall is more frequent because the share can briefly drop below the generator's timeout during the IM write-back phase.
Cause 3 – Antivirus / EDR Locking the IM Folder
Symantec Endpoint Protection, CrowdStrike Falcon, Trend Micro, Microsoft Defender ASR, and SentinelOne have all been observed scanning the IM folder every time a new *.tmp file is created. The HMI generator opens, writes, closes, renames — and each rename triggers a re-scan that can take 800–2000 ms. Cumulative delay pushes the compile beyond 30 minutes.
Cause 4 – Oversized Image Library or Wrong Image Source
KTP400 Basic images reside on the TIA Portal installation medium. If the panel image is being loaded from a DVD, from a slow USB 2.0 optical drive, or from a corrupted local mirror, every compile has to re-hash the image set. If the image directory contains manual additions (custom splash screens, customer logos), the generator may attempt to recompile bitmap resources that were never intended for the 4" panel.
Cause 5 – TIA Portal Co-Installation Conflict (V16 + V17 + V18)
Maintaining multiple TIA Portal major versions side by side is supported only when the RTM (Runtime Manager) registry keys remain consistent. If a user has installed V16 Update 7, V17 Update 9, and V18 Update 4 on the same workstation, the Siemens\Automation\PortalV18\Data\Hmi registry hive can be redirected to the V17 image path. The HMIGenerator then looks for V18 KTP400 image resources in a V17 directory, fails silently, and retries the file lookup forever.
Diagnostic Workflow
Execute the following checklist before applying a fix. Each step isolates one of the five root causes and produces verifiable evidence.
- Capture TIA Portal build and patch level. Launch TIA Portal → Help → Installed Software. Record "TIA Portal V18 Update X (Build 18.0.x.y)". Cross-reference against the TIA Portal V18 Update Center to confirm the latest cumulative update is installed.
- Verify the KTP400 image version. In the project tree, right-click the KTP400 → Properties → General. Confirm the image version field matches the installed TIA Portal version. Mismatches generate the silent retry pattern described in Cause 5.
-
Inspect the IM folder timestamp. Navigate to the project directory and observe the most recent write time inside
IM\HMI\C\. If the timestamp is older than the last "successful" compile, the persistence step is failing. - Reproduce with an empty project. File → New → Create a project containing a single KTP400 Basic PN with one start screen. Compile. If the empty project also stalls at 95%, the issue is environmental (network share, antivirus, or IM corruption) — not project content.
-
Monitor file locks with Process Monitor. Sysinternals Process Monitor with a filter for
IM\HMI\C\shows which process is holding the last file open. IfMsMpEng.exe(Defender) orCSDeviceControl.exe(CrowdStrike) is the holder, Cause 3 is confirmed. -
Check the TIA Portal log directory.
%LOCALAPPDATA%\Siemens\Automation\PortalV18\Log\containsHMIGenerator.log. Search for the stringSHLWAPIorE_FAILat the end of the file. An E_FAIL returning from the persistence call is the precise signature of the 95% stall.
Solution 1 – Rename the IM\HMI\C Directory (Field-Proven)
The most frequently successful remediation, validated across multiple V18 installations:
- Close TIA Portal completely. Confirm
S7WEBSVX.exeandHMIGenerator.exeare not running in Task Manager → Details. - Open File Explorer and navigate to the project root.
- Rename the directory:
@PROJECT_ROOT@\IM\HMI\C\→@PROJECT_ROOT@\IM\HMI\C_old\ - If a
C_olddirectory already exists from a previous attempt, suffix the new name sequentially:C_old_2,C_old_3, etc. - Relaunch TIA Portal, open the project, and re-trigger the compile.
- The generator will rebuild the
Cdirectory fromSRCin a single pass. Typical rebuild time for a 30-screen KTP400 project is 90–180 seconds.
C_old can be deleted manually. If the new compile fails, restoring C_old → C returns the project to the last known good state.Solution 2 – Reset All Temporary Data (Siemens KB 109778709)
Siemens support article 109778709 – How do you reset the temporary data of a TIA Portal project? describes the official, supported method for clearing the global TIA Portal working directory:
- Close all instances of TIA Portal and the TIA Portal Help System.
- Stop the Siemens TIA Portal Manager Windows service if it is running (services.msc → find "S7TIA Portal Manager" → Stop).
- Navigate to:
C:\Users\<USERNAME>\AppData\Local\Siemens\Automation\PortalV18\ - Rename the
Datasubfolder toData_backup(do NOT delete — preserves recovery option). - Rename the
Hmisubfolder toHmi_backupif present. - Relaunch TIA Portal. The directory structure is regenerated with default settings.
- Open the affected project and compile. First compile will be slower (cache cold) — subsequent compiles return to normal.
Additional paths to clear if the above does not resolve the issue:
%LOCALAPPDATA%\Siemens\Automation\PortalV18\Cache\%APPDATA%\Siemens\Automation\PortalV18\C:\ProgramData\Siemens\Automation\PortalV18\
Solution 3 – Move Project to Local NVMe Storage
Network shares and cloud-synced folders are a confirmed source of the 95% stall. Recommended procedure:
- Copy the entire project folder to
C:\TIA_Work\<ProjectName>\. - Verify the destination is on a local NTFS volume (not a SUBST-mapped drive or an iSCSI target served from a remote filer).
- Open the project from the new location in TIA Portal V18.
- Compile. Compare the elapsed time against the network share baseline. A 6–10× improvement is typical.
- If the project must remain on a shared drive for version control, configure Windows Defender or your EDR solution to exclude the specific UNC path, and disable opportunistic locking on the SMB share with
Set-SmbServerConfiguration -OplocksDisabled $trueon the file server.
Solution 4 – Exclude TIA Portal Directories from Antivirus
Add the following paths to the antivirus exclusion list. Adjust for your specific EDR product's interface (Microsoft Defender, CrowdStrike Falcon, Trend Micro Apex One, SentinelOne Singularity, etc.):
C:\Program Files\Siemens\Automation\PortalV18\C:\Program Files\Siemens\Automation\WinCC\C:\Users\<USERNAME>\AppData\Local\Siemens\Automation\PortalV18\-
C:\TIA_Work\(or wherever engineering projects reside) %TEMP%\Siemens\
Solution 5 – Resolve TIA Portal Co-Installation Conflicts
If multiple TIA Portal versions are installed:
- Open Registry Editor (regedit) and navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Siemens\Automation\PortalV18\Hmi. - Verify the
ImagePathvalue points toC:\Program Files\Siemens\Automation\PortalV18\WinCC\Hmi\Images\and not to a V16 or V17 path. - If incorrect, uninstall the older major version (V16 is end-of-life as of 2024 per the Siemens product lifecycle). Only keep V17 and V18 side by side, and verify with
Siemens TIA Administratorthat both versions report the correct image paths. - Reboot. Relaunch TIA Portal V18 and recompile.
Solution 6 – Reduce Project Size and Image Count
If the project contains hundreds of bitmap assets:
- Audit the image library: Project tree → HMI → Graphics. Sort by file size.
- Replace BMP / uncompressed TIFF with PNG-24 or JPG-Q85. A 2 MB BMP typically compresses to 80–200 KB without visible loss on a 4" panel.
- Confirm the
ImageSourcein the panel properties points to local TIA Portal image directory, not to an external DVD path. - Consolidate button states. Each button with three image states (released, pressed, disabled) triples the compile work. Where possible, use vector symbols from the WinCC Basic library instead of bitmaps.
Verification Procedure
After applying any solution, confirm the fix with the following checks:
- Time the compile. From Project tree → right-click KTP400 → Compile → Software (rebuild all). A healthy V18 compile of a 30-screen KTP400 should complete in 30–120 seconds on a modern engineering station (Intel Core i7-12700 / 32 GB RAM / NVMe SSD).
-
Inspect the output log. Open the Compile preview window. The final line should read
Compile complete (0 errors, 0 warnings)— not a stack trace or a genericFinishedwith a hung spinner. -
Verify the IM directory. After compile, the
IM\HMI\C\folder should be regenerated with a current timestamp. Inside, confirmruntime.fwx(the firmware/rtd file) exists and is non-zero. - Perform a clean download. Panel → Online → Extended Download → "Overwrite all". A clean transfer should take 45–90 seconds over PROFINET. If the download stalls, repeat Solution 1 and Solution 4.
- Monitor resource usage. Task Manager → Performance → CPU should not exceed 60% sustained during compile. Memory should not exceed 6 GB. If either is exceeded, the engineering station's anti-malware service is interfering — re-examine Solution 4.
Preventive Best Practices
| Practice | Benefit |
|---|---|
| Store projects on local NVMe, archive to network after compile | Eliminates share-induced retries |
| Apply antivirus exclusions during TIA Portal install | Removes file-locking contention |
| Maintain a single TIA Portal version per workstation | Prevents image path divergence |
| Schedule weekly IM\HMI\C cleanup during maintenance windows | Prevents cache drift |
| Document the panel image version per project | Simplifies reproducibility and TIA Portal upgrades |
| Keep TIA Portal fully patched to latest Update | Resolves generator bugs shipped in earlier V18 builds |
| Use Git or TIA Portal multiuser for revision control, not live file shares | Prevents concurrent-write corruption of IM folder |
Escalation Path to Siemens Support
If the above solutions do not restore normal compile behavior, escalate via the official Siemens Industry Online Support portal. Open a Support Request at support.industry.siemens.com/cs/start and include:
- TIA Portal V18 exact build and installed updates
- Hardware article numbers for the KTP400 and any associated S7-1200 / S7-1500 PLC
- The complete
HMIGenerator.logfrom%LOCALAPPDATA%\Siemens\Automation\PortalV18\Log\ - A ZIP of the project (sanitized of customer IP) reproduced with the empty-project test from the diagnostic workflow
- Process Monitor trace showing file access patterns during the 95% stall
Related References
- Siemens KB 109778709 – Reset temporary data of a TIA Portal project
- TIA Portal V18 Update Center
- SIMATIC Software Upgrade Packages
- SIMATIC HMI KTP400 Basic PN Operating Instructions
Frequently Asked Questions
Is a 30-minute compile time normal for a KTP400 Basic PN in TIA Portal V18?
No. A healthy compile of a 30-screen KTP400 project should complete in 30–120 seconds on a current engineering station (NVMe SSD, 16 GB RAM). Compile times exceeding 5 minutes indicate IM folder corruption, network-share latency, antivirus contention, or an image-path mismatch from a co-installation.
Will renaming the IM\HMI\C folder cause me to lose my HMI configuration?
No. The IM directory is an intermediate cache regenerated from the project's source files. Renaming C to C_old simply forces the HMI generator to rebuild the cache on the next compile. Your screens, tags, alarms, and scripts remain untouched in the .ap18 archive.
Which Siemens support article addresses the TIA Portal temporary data reset?
Siemens Knowledge Base entry 109778709 – How do you reset the temporary data of a TIA Portal project? documents the official procedure, including renaming %LOCALAPPDATA%\Siemens\Automation\PortalV18\Data to force regeneration of the global working directory.
Can I keep TIA Portal V16, V17, and V18 installed on the same PC?
Siemens supports co-installation of two consecutive major versions. Running V16, V17, and V18 simultaneously is not officially supported and frequently produces image-path conflicts that cause the HMI compile to stall at 95%. Uninstall V16 first; keep only V17 and V18 if dual-version capability is required.
Should I exclude the TIA Portal install directory from antivirus scanning?
Yes. Adding C:\Program Files\Siemens\Automation\PortalV18\ and %LOCALAPPDATA%\Siemens\Automation\PortalV18\ to the exclusion list is consistent with Siemens' installation guide and dramatically reduces the frequency of the 95% stall. Microsoft Defender, CrowdStrike, and Trend Micro all support per-path exclusions.
Does storing the TIA Portal project on OneDrive or Dropbox affect compile performance?
Yes, severely. Cloud sync agents hold transient file locks during sync, which the HMI generator interprets as access conflicts and retries indefinitely. Always keep the live .ap18 project on local NTFS and archive to cloud storage only after a successful compile.