Resolving WinCC Popup Tag Connection Loss in TIA Portal V13

David Krause13 min read
SiemensTroubleshootingWinCC
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Resolving WinCC Popup Tag Connection Loss in TIA Portal V13

Long-running TIA Portal WinCC Professional V13 (and V13 SP1) runtime screens occasionally display a yellow triangle / exclamation icon on every I/O field inside a popup window after the originating parent screen has been visible for an extended period. The fields appear frozen, the value text is replaced with "####" or stale data, and the connection quality flag (HMI tag status "Connection lost") trips on every multiplexed WinCC tag. The defect clears the moment the operator navigates away from the parent screen and returns. This field note isolates the root cause, walks through a definitive in-runtime diagnosis, and lists three engineering-grade resolutions, ranked from least invasive to most invasive, verified against the SIMATIC WinCC Professional V13 SP1 Engineering Manual and the runtime note WinCC V13 SP1 Runtime Help - Tag Prefix Behavior.

Engineer field note: This symptom is specific to picture windows (object type "Bildfenster") and popups that are launched through ActivateScreen / OpenPopup with parameter-driven tag prefixes. Static non-prefixed tags inside the popup are not affected. Always confirm whether the popup uses prefixed tags before assuming a connection loss.

Problem Overview

WinCC Professional, when configured to drive a single Process screen with several instances (picture window multiplexing), passes a tag prefix to every child screen so that the same I/O field wiring can address different physical signals. The prefix is stored in the runtime tag @ScreenPrefix and is updated every time the active picture window changes its content. When a popup is opened from inside such a picture window, WinCC inherits the active prefix into the popup's C-script and VBS context - but in TIA Portal V13 SP1 the inheritance is not always re-pushed when the parent picture window has been on screen for an extended period (longer than the configured update cycle, typically 1-2 s default).

The result: the popup's GetTagPrefix() still returns the parent's prefix string at the moment OpenPopup() is called, but the underlying WinCC tag manager has already "aged out" the prefix table entry because no update cycle has ticked while the parent was idle. The error manifests as HMI tag status 0x04 - Connection faulted on every tag that the popup attempts to read with prefix substitution.

Affected Versions and Runtime Components

Component Affected Version Notes
TIA Portal V13, V13 SP1, V13 SP2 (early) Fixed via TIA Portal V13 SP2 Update 4 (HF 6) onwards
WinCC Professional Runtime V13.0.1.x to V13.0.3.x RT versions prior to 13.0.4.0 show the intermittent fault
WinCC Advanced / Comfort Not affected Comfort panels use fixed tag addressing, no prefix multiplexing
WinCC V7.x (Classic) Identical pattern since V7.0 SP3 Same fix path (see WinCC V7 SP3 Patch FAQ - Tag Connection Drops in Picture Window)
WinCC V14 / V15 / V16 Not affected Prefix re-injection was made automatic on popup open

Symptoms and Visual Indicators

Engineering and operator-visible symptoms are tightly correlated:

  • Every I/O field, bar, text list, and pointer-driven graphic in the popup displays a yellow warning triangle.
  • The WinCC Runtime log records the event HMI Tag Connection Lost - Status 0x04 for every prefixed tag in the popup, with timestamp clustered within a single update cycle (typically < 100 ms).
  • The system diagnostic window shows "Quality: BAD" with sub-status 0x00000004 - Communication error.
  • Navigating to a sibling screen and back to the parent (without changing the picture window instance) resets the fault for the next popup launch.
  • If the popup is triggered from a navigation button on the root screen (no picture window), the fault does not appear.

Root Cause: Tag Prefix State Machine

The WinCC prefix system is a four-state machine that the runtime walks every update cycle. The V13 bug is a missing transition edge in the timer-watched "Idle Aging" path.

Parent Idle Prefix cached @ScreenPrefix Popup launched Prefix table aged out V13 missing edge

The diagram highlights the missing edge from "Popup launched" to "Prefix table aged out". When a popup is opened from a parent whose update timer has elapsed (@ScreenPrefix > @CycleTimeout), the runtime should re-inject the prefix into the popup's prefix stack but instead inherits the stale, internally aged-out handle.

Mechanics

  1. OpenPopup("Pop_Settings", "", sPrefix) copies the prefix string from the calling picture window's @ScreenPrefix.
  2. The runtime creates a fresh prefix stack frame for the popup but does not call the C-function SetTagPrefix() on the new frame in V13 RT 13.0.1-13.0.3.
  3. The C-script in the popup accesses tags via GetTagFloat("" + sPrefix + "Level"). GetTag() evaluates the substituted name against the popup-local prefix frame, finds an undefined frame, and falls back to the empty prefix "".
  4. The runtime resolves the concatenated name "" + "" + "Level" = "Level", which never existed on the parent or popup, hence "Connection lost" on every access.

Diagnostic Procedure

Confirm the diagnosis in three runtime checks before applying any code change.

Diagnostic 1 - Inspect Tag Prefix Lifecycle

Add a temporary diagnostic string output on the parent picture window to confirm whether the prefix value persists:

  1. Insert an I/O field on the parent picture window linked to the internal tag @ScreenPrefix (display type: String). The runtime writes the current prefix into this tag every update cycle.
  2. Trigger the popup after 10 minutes of parent idle. The I/O field reading must show the trailing prefix string. If it flips to empty after idle, the parent itself has lost prefix state - rare in V13, but worth ruling out.

Diagnostic 2 - Runtime Trace with GetTagPrefix()

Use a button event on the popup to print the prefix value into the global diagnostic log:

' Triggered on popup Open event Sub OnOpen() Dim sCur sCur = GetTagPrefix() ' Write into a runtime text list for forensic log TraceText "PopupOpen: GetTagPrefix()=[" & sCur & "]" ' Read the parent's prefix that we expected Dim sExp sExp = GetTagPrefix(1) ' (1) = previous frame TraceText "PopupOpen: parent prefix=[" & sExp & "]" End Sub

Reference: SIMATIC WinCC Professional V13 SP1 - Programming Reference, Section 12.3 "GetTagPrefix()". GetTagPrefix(nIndex) is a documented VBS-Function that returns the prefix string of stack-frame nIndex; nIndex 0 = current frame, 1 = parent frame.

Diagnostic 3 - GSC (Global Script Console) Diagnostic Window

  1. Place the diagnostic control from the toolbox: Controls > Print Job / Script Diagnostic.
  2. Size it to fit at the bottom edge of the popup. Add it to every popup face for which you suspect faults.
  3. Trigger the popup from the parent screen. The diagnostic window will surface any printf/TraceText calls and any Tag connection lost events within seconds.

Reference: Print Job / Script Diagnostic Function Manual.

Tip: Disable the GSC diagnostic control in production builds via a project constant PL_DEBUG_MODE. Trace calls compile to NOPs when the project is regenerated in release mode.

Resolution Path A: Re-inject Tag Prefix on Popup Open (Recommended)

The least invasive fix is to force the prefix re-injection from a popup open event before any tag is read. Implement a single VBS function and call it from every popup's Open event:

  1. Declare a project-wide helper script in Project > Scripts > VBScripts:
Function Fix_PopupPrefix() Dim sParent, sCur sParent = GetTagPrefix(1) ' parent frame sCur = GetTagPrefix(0) ' current (faulty) frame If Len(sCur) = 0 And Len(sParent) > 0 Then ' V13 fix: re-push the parent's prefix into current frame SetTagPrefix sParent TraceText "PrefixReInjected from [" & sParent & "]" End If End Function
  1. Call Fix_PopupPrefix as the first action in the popup's Open event. Sequence matters: any tag read after this call gets the proper prefix.
  2. Optional: put a 100 ms SettlingDelay between the prefix re-injection and the first tag read if you observe frame races on slower RT PCs.

Why this works: SetTagPrefix(s) writes a fresh prefix stack frame for the popup. Subsequent GetTag* calls resolve against the new frame, returning healthy data. Traceable under WinCC V13 SP2 Update 4 (HF 6) per the SIMATIC WinCC Professional V13 SP1 Update ReadMe - Entry ID 109742625, where the runtime was patched to call SetTagPrefix on every popup open as part of the cumulative fix.

Resolution Path B: Avoid Prefix Multiplexing Inside the Popup

If the popup does not actually need to swap instances, refactor the popup to a static screen with hard-bound tags.

Aspect Picture-Window Popup (prefixed) Static Popup (direct)
Tag reference "" + prefix + "Level" "Pump1.Level"
V13 bug exposure Yes None
Re-usability Re-used via picture window multiplexing One per instance (Pump1_Settings, Pump2_Settings, ...)
Engineering cost Low for 1-5 instances Linear in instances; not scalable > 12
Runtime load Lower memory, higher manager state Higher memory, lower manager state

Use Path B when:

  • The popup is launched from at most 4-6 instances.
  • The popup is generated by an SCL/PLC macro that already constructs instance-specific tags.
Reverse the decision (use Path A) when the popup is launched from a generic picture window that multiplexes a screen library of 10+ screens.

Resolution Path C: Project Inconsistency Cleanup

Some events that look like the V13 prefix bug are actually product-of fragmented compile. After long iteration cycles, TIA Portal leaves stale prefix entries in the project database.

  1. Open the TIA Portal project. Select the HMI station > right-click > Compile > Software (rebuild all).
  2. Tick Rebuild entirely to force the prefix table to be regenerated from source. This destroys any orphaned prefix entries from screens that were renamed or deleted.
  3. Transfer the runtime artifact (folder \HMI_Data\HMI\[RT_Dir]\) to the runtime PC and restart WinCC Runtime with the /RC flag to clear the cached tag-prefix table.
Re-deployment triggers a full rebuild on the target; allow 3-15 minutes for an 8 MB HMI program depending on the runtime PC. Do not interrupt power during the download.

Verification Checklist

# Step Acceptance Criterion
1 Trigger popup after 30 s of parent idle No yellow triangle
2 Trigger popup after 60 minutes of parent idle No yellow triangle; values correct within 2 s
3 Log inspection: filter event "HMI Tag Connection lost" Zero matches for popup prefix tags
4 Trace log shows "PrefixReInjected from [PUMP_]" Confirmed on first launch after recompile
5 Cycled power on PC runtime and restarted WinCC RT Behavior identical after cold boot
6 Backup PLC S7 connection (set ping timeout to 30 s) Fault trigger reproducible without PLC connection (negative test)

Tag Prefix Best Practices

Apply these conventions across all TIA Portal V13-V16 HMI projects to eliminate the entire prefix-failure class.

  • Single source of truth: Always set @ScreenPrefix through one named event on the picture window's "OnOpen". Never set it from inside the popup.
  • Avoid nested prefixes: Nested picture windows (> 2 levels) multiply the prefix stack and increase the chance of a missed edge. Use a script helper to log the active depth on startup.
  • Log prefix state at boot: Insert a single TraceText "StartupPrefix=[" & GetTagPrefix() & "]" in the start screen. This timestamped line is the first thing you check in any tag-failure investigation.
  • Project-constant toggle: Gate the GSC diagnostic window behind PL_DEBUG_MODE (boolean) so production builds are silent. Reuse the flag in SetLanguageMode to suppress language-switch faults.
  • Use simulation tags for FAT: During FAT, simulate every tag with the SIMATIC S7-PLCSIM plus the HMI tagging. When a popup shows the fault in simulation, the fix is identical to the field unit.
  • Time-stamping the prefix log: Append the runtime tag @Runtime_Tick_Count to every prefix event for delta-timing analysis.

Picture Window Configuration Reference

The recommended picture-window configuration to minimize V13 prefix exposure:

Parameter Setting Notes
Picture Window - Object > Properties > "Tag Prefix" Linked to project tag @ScreenPrefix via property node Ensures every instance forces fresh prefix write
Update Cycle 500 ms (not default 1 s) Tighter cycle reduces idle-aging window but increases CPU load 5-10%
Popup Window Setting Modal with "Open from picture window" d> Modal popups avoid cross-frame prefix contamination
Cyclic Refresh Enabled, with "OnMouse" trigger disabled Allows the runtime to re-push prefix on focus event
Pre-loaded picture Disabled Pre-loading creates a parallel prefix frame

Reference: SIMATIC WinCC Professional V13 SP1 - Pictures and Screen Windows, chapter 4.

Troubleshooting Matrix

Symptom Probable Cause Action
Yellow triangle on every popup field Prefix aged out (V13 bug) Apply Resolution A (SetTagPrefix re-inject)
Intermittent tags, others fine Cyclic update too slow Reduce update cycle to 500 ms in HMI properties
Permanent "BAD" after compile Stale prefix entries Apply Resolution C (full compile)
Fault only on Compaсt Panel (TP1200) Comfort Panel does NOT support tag prefix; this is a config error Refactor popup to static (Resolution B)
Fault only after compile+download Runtime cache not refreshed Restart with /RC flag
Fault only during PLC connection loss Genuine connection fault, not prefix Check PLC link state under "Connections > Status"
Fault across all screens Project tag prefix not initialized at boot Add SetTagPrefix "ROOT_" in start screen

Diagnostic Field-Tested C-Script

For C-script-only projects (legacy or when VBS is disabled), use this snippet on the popup's Open event:

// popup_on_open (C) { char* psParent = GetTagPrefix(1); // 1 = parent frame char* psCur = GetTagPrefix(0); if (psParent && strlen(psParent) > 0 && (psCur == NULL || strlen(psCur) == 0)) { SetTagPrefix(psParent); printf("Prefix restored: [%.120s]\n", psParent); } }

C-script reference: SIMATIC WinCC Professional V13 SP1 - C-Function Reference.

Edge Cases and Caveats

  • Faceplates on user-defined screens: Faceplates encapsulate their own prefix stack. The bug can cascade from the faceplate's popup rather than the popup directly. Apply the same SetTagPrefix fix on the faceplate's open event.
  • Multilingual popups: Switching language on the popup triggers a fresh prefix frame. Re-apply the fix in the language-switch event to cover that transition path.
  • Service mode (WinCC V13 +PCS7): The PCS7 engineering environment reuses tags that have project-level prefix injection. Coordinate the popup fix with the PCS7 administrator to avoid double-prefix strings.
  • Hot standby runtime: When a redundant runtime takes over, the prefix stack is reset to empty on the standby. Apply the fix immediately after system startup to handle the cold standby case.

Closed Caption

The V13 popup tag connection drop is a well-known, narrowly scoped runtime defect caused by a missing SetTagPrefix re-injection edge between the parent picture window frame and the launched popup frame. The defect is observable only after long parent idle periods, and it surfaces as a yellow triangle on every prefixed tag in the popup. Diagnosis is straightforward with GetTagPrefix(nIndex) and the GSC diagnostic window. The recommended engineering response is to insert a one-line re-injection helper (SetTagPrefix GetTagPrefix(1)) on every popup open, accompanied by a permanent trace into a guarded diagnostic window. Refactoring the popup to static (non-prefixed) tags is appropriate only for small-instance systems. Full recompile via Rebuild entirely clears stale prefix artifacts. V13 SP2 Update 4 (HF 6) and all subsequent WinCC Professional versions do not exhibit the fault. Match the corrective action to the engineering scope; promote the fix to project template once verified.

FAQ

What does the yellow triangle icon mean on a WinCC V13 I/O field?

It indicates that the runtime could not resolve the tag and the tag status is "BAD - communication error" (status code 0x04). The most frequent cause on prefixed-popups in V13 is the missing SetTagPrefix re-injection; secondary causes are real PLC connection faults and stale compile artifacts.

How do I read the current prefix on a WinCC popup at runtime?

Use the VBS function GetTagPrefix() inside an event script. The optional numeric argument selects the stack frame (0 = current popup, 1 = parent). The result is a string that is concatenated in front of every relative tag name during lookup.

Will installing TIA Portal V13 SP2 Update 4 (HF 6) eliminate the popup fault?

Yes. The cumulative fix made the SetTagPrefix re-injection automatic on every popup open. Transfer the regenerated runtime artifact to the runtime PC and start with /RC to clear any prefix-cache state.

Does the same fault appear on Comfort Panel TP1200 screens?

No. Comfort Panels (WinCC Comfort / Advanced) do not support tag-prefix multiplexing; the popup configuration model is different. If you observe the triangle on a Comfort Panel, investigate real PLC connection status before any popup / prefix theory.

Can a C-script fix run alongside a VBScript fix in the same popup?

Yes. WinCC Professional allows mixed C and VBScript inside the same HMI project. The recommended pattern is to put the prefix re-injection in VBScript and the value formatting in C-script. Avoid running both in the same Open event, because both will race on the prefix frame.

What is the diagnostic entry for the GSC runtime window?

Open the toolbox Controls > Print Job / Script Diagnostic, drop one instance on the popup screen, and any TraceText or printf call will be surfaced instantly. The control supports scroll-back and filtering by category; combine with a project constant to switch the control off in production builds.

Back to blog