WinCC Unified V21: Open Pop-up Windows from Faceplates via Tag Prefix
Overview
The faceplate concept in Siemens WinCC Unified lets engineers author a single reusable HMI symbol (motor, valve, PID loop) and instantiate it dozens of times on a process screen, with each instance bound to a different data source through the Tag Prefix property. The natural next step in a standardized HMI library is drill-down: clicking the symbol opens a detailed pop-up window that shows status, diagnostics, and command buttons specific to that instance.
This reference covers how to:
- Author a faceplate with a structure-typed data interface.
- Configure the Tag Prefix so an instance on a screen resolves to the correct PLC tags.
- Trigger a pop-up at runtime using the
UI.OpenFaceplateInPopup()JavaScript method. - Chain pop-ups (a popup opens another popup) without losing the data binding.
- Animate faceplate elements from structure members.
Tested against WinCC Unified V21 (TIA Portal V21 engineering). The method and behavior are similar from V18 onward, but the documented parameter set for UI.OpenFaceplateInPopup() is current for V20/V21 help.
Prerequisites
| Item | Required | Notes |
|---|---|---|
| TIA Portal | V18 or later | V21 recommended for current documentation set |
| WinCC Unified Runtime | V18+ | Same major version as engineering |
| HMI device type | Unified Comfort Panel or Unified PC Runtime | The faceplate popup API is Unified-only |
| PLC data blocks | Optimized DBs with structure tags | Tags must be reachable via the HMI connection |
| HMI tags | DB structure mapped to HMI tags | Connection configured in the Connections editor |
| Script runtime | JavaScript (WinCC Unified) | VBScript is deprecated in Unified; use ECMAScript 2022 syntax |
| License | WinCC Unified Comfort / PC RT | Standard or higher; faceplates are included |
Faceplate Fundamentals
A faceplate is a reusable screen object stored in the HMI project library. Each instance on a process screen receives its own data context through the Tag Prefix property. Because the prefix is a plain string, the same faceplate can read from any data source: a DB element, a tag array slice, or an arbitrary path of HMI tags.
Structure-Typed Interface on the PLC
Define a PLC data block (for example DB_Motor) with members the faceplate will display and control:
TYPE "UDT_Motor"
VERSION : 0.1
STRUCT
StartCommand : Bool;
StopCommand : Bool;
Running : Bool;
Fault : Bool;
Current : Real; // A
Speed : Real; // rpm
SetpointSpeed : Real; // rpm
OperatingMode : Int; // 0=Manual, 1=Auto
END_STRUCT;
END_TYPE;
Create an array of this UDT in the PLC (Array[1..20] of "UDT_Motor") and map the array to HMI tags. Each element of the array becomes a candidate Tag Prefix for a faceplate instance.
Tag Prefix Property
In the faceplate instance properties (Properties pane → Interface), set the Tag Prefix:
| Property | Value | Effect |
|---|---|---|
| Tag Prefix | HMI_Tags::Motor[3] |
Resolves faceplate I/O to DB element index 3 |
| Quality code source | Automatic | Uses the connection status |
| Update cycle | 500 ms (1000 ms default acceptable) | Refresh rate of the bound tags |
The prefix is a string that WinCC Unified prepends to every tag reference inside the faceplate. The HMI tag database must contain the full path; otherwise the faceplate shows ### placeholders or quality code "Bad Configuration".
UI.OpenFaceplateInPopup() Method
The runtime object model exposes UI.OpenFaceplateInPopup() to launch a faceplate in a floating window at runtime. The official reference is the UI.OpenFaceplateInPopup() (RT Unified) – TIA Portal V21 Help page.
Signature
UI.OpenFaceplateInPopup(
faceplateType : String, // Name of the faceplate type in the library
tagPrefix : String, // Tag prefix for the instance
popupOptions : Object // Optional: position, size, title, modality
);
Parameters
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| faceplateType | String | Yes | Library name of the faceplate (e.g., "fpMotor") |
| tagPrefix | String | Yes | Same syntax as the instance property; e.g., "HMI_Tags::Motor[3]"
|
| popupOptions | Object | No | Controls placement, size, title, modality, close behavior |
popupOptions Object
| Key | Type | Default | Description |
|---|---|---|---|
x |
Number | Center | X position in pixels |
y |
Number | Center | Y position in pixels |
width |
Number | Faceplate size | Window width in pixels |
height |
Number | Faceplate size | Window height in pixels |
title |
String | Faceplate name | Window caption |
modal |
Boolean | false | If true, blocks underlying screen interaction |
closeOnTouchOutside |
Boolean | true | Dismiss on click outside the popup |
draggable |
Boolean | true | Allow user to move the window |
resizable |
Boolean | true | Allow user to resize |
UI.OpenFaceplateInPopup().Return Value
UI.OpenFaceplateInPopup() returns a handle object that lets you close the popup programmatically:
{
handle: Number, // Unique handle for the popup
close(): Void // Method to close the popup programmatically
}
Store the handle if you plan to dismiss the popup on a condition (e.g., a fault clears) without relying on the user clicking the X.
Configuring the Faceplate for Popup Use
- In the HMI project library, open your faceplate (e.g.,
fpMotor). - In the Faceplate Interface editor, add a property of type String named
TagPrefix. Mark it as the runtime reference. - Bind the faceplate's internal tag references to
Interface.TagPrefix + ".Running",Interface.TagPrefix + ".Current", etc., using dynamic addressing. - Expose any commands (
Start,Stop,Reset) as faceplate events. - Add a script event on the faceplate body OnClick that calls
UI.OpenFaceplateInPopup("fpMotorDetail", TagPrefix, ...).
Inside a faceplate script, the symbol TagPrefix refers to the current instance prefix automatically. It is a runtime-resolved context variable; you do not need to pass it from the screen.
JavaScript: Opening the Popup
The following script is placed in a faceplate event (e.g., "Mouse click" on the body rectangle):
// Open a detailed faceplate popup for the current instance
export function Faceplate_OnMouseDown(item, x, y, modifiers, trigger) {
const options = {
x: 200,
y: 150,
width: 480,
height: 320,
title: "Motor Detail - " + TagPrefix,
modal: false,
closeOnTouchOutside: true
};
UI.OpenFaceplateInPopup("fpMotorDetail", TagPrefix, options);
}
For a screen-level button that operates on a selected instance, pass the prefix explicitly:
// Bound to a screen button; the prefix comes from a screen tag
export function Btn_OpenDetail_OnClick(item) {
const prefix = Tags("SelectedMotorPrefix").Read();
if (!prefix) {
HMIRuntime.Trace("No motor selected");
return;
}
UI.OpenFaceplateInPopup("fpMotorDetail", prefix, {
title: "Motor Detail",
width: 480,
height: 320
});
}
Verifying the Tag Prefix Resolution
Add a temporary trace to confirm the prefix reaches the popup:
export function Faceplate_OnMouseDown(item, x, y, modifiers, trigger) {
HMIRuntime.Trace("Opening popup for prefix: " + TagPrefix);
UI.OpenFaceplateInPopup("fpMotorDetail", TagPrefix);
}
Run the project, click the faceplate, and inspect the RT log. The output should match the configured prefix string exactly (e.g., HMI_Tags::Motor[3]). Mismatches here are the most common cause of "popup shows the wrong data".
Tag Prefix Configuration Patterns
Single Tag Prefix per Faceplate
The most common case. The faceplate body has a single TagPrefix interface property; the popup uses the same string. No remapping is required.
Multi-Prefix Faceplates (Mixed Sources)
Some faceplates need to read from one DB and write to another (for example, a tuning popup that writes setpoints to a separate recipe DB). Define two interface properties:
| Interface Property | Direction | Example Value |
|---|---|---|
TagPrefix |
Read | HMI_Tags::Motor[3] |
CmdPrefix |
Read/Write | HMI_Tags::MotorCmd[3] |
UI.OpenFaceplateInPopup() accepts only one prefix. For the second prefix, stage it in a tag and recover it inside the popup:
export function Faceplate_OnMouseDown(item) {
Tags("CmdPrefix_" + UID).Write(TagPrefix + "_Cmd"); // pre-stage
UI.OpenFaceplateInPopup("fpMotorDetail", TagPrefix);
}
Inside the popup, read Tags("CmdPrefix_" + UID).Read() to recover the second prefix. The UID symbol is a per-instance identifier provided by the faceplate runtime.
Dynamic Prefix from Array Index
When a faceplate is generated in a loop (C-script or screen generator tool), construct the prefix at runtime:
export function LoopInstance_OnClick(item) {
const idx = item.Parent.Index; // index of the loop faceplate instance
const prefix = `HMI_Tags::Loop[${idx}]`;
UI.OpenFaceplateInPopup("fpLoopDetail", prefix);
}
Opening Popups from Popups
The runtime allows a popup to launch another popup. The original popup remains open, and the new popup is created on top of it. The two popups can have different faceplate types and different tag prefixes.
// Inside the detail popup, a "Tuning" button launches a second popup
export function Btn_Tuning_OnClick(item) {
UI.OpenFaceplateInPopup("fpLoopTuning", TagPrefix, {
title: "Tuning - " + TagPrefix,
width: 600,
height: 400,
modal: true
});
}
Recommendations for Chained Popups
- Cap the chain at 2 levels. Deeper nesting hurts usability on panels with small screens.
- Use
modal: trueon the second popup when the user must finish or cancel before returning to the first. - Always expose a Close button inside the popup; the runtime's X icon may be hidden in full-screen mode.
- If the same faceplate type is opened twice with different prefixes, both popups remain open and operate on independent data contexts.
Animating Faceplate Elements from Structure Tags
Inside the faceplate editor, you have two options for animation: declarative tag binding or script-based logic.
Option A: Direct Tag Binding (Declarative)
In the Properties pane of an element (for example, a circle's "Visibility"), select the dynamic value, choose the faceplate's interface property, and append a member. For a running indicator:
| Element | Property | Source | Animation |
|---|---|---|---|
| Circle (green) | Visibility | Interface.TagPrefix + ".Running" |
Visible when Running = true
|
| Circle (red) | Visibility | Interface.TagPrefix + ".Fault" |
Visible when Fault = true
|
| IO field | Value | Interface.TagPrefix + ".Current" |
Numeric, 1 decimal place |
This is the preferred path. It requires no scripting and updates automatically at the configured refresh cycle.
Option B: Script-Based Animation (Procedural)
For complex animations (color ramp, dynamic text, multi-condition logic), use a script on a screen event or in a faceplate "Update" trigger:
// Called cyclically; recompute color based on Current value
export function Current_Indicator_OnUpdate(item) {
const current = Tags(TagPrefix + ".Current").Read();
let color = 0xFF00FF00; // green
if (current > 50) color = 0xFFFFA500; // orange
if (current > 80) color = 0xFFFF0000; // red
item.BackColor = color;
}
Verification and Commissioning
After configuring the faceplate and popup:
- Compile the HMI project in TIA Portal. Watch for warnings about unbound interface properties.
- Download to the Unified Runtime (panel or PC).
- Open the project. Navigate to the screen containing the faceplate instances.
- Click an instance. The popup must appear with the correct title and data.
- Verify each instance by clicking 2–3 of them. Each must show its own data and respond to commands independently.
- Check the RT trace log for warnings about missing tags or invalid prefixes.
Acceptance Test Checklist
| Test | Expected Result | Pass / Fail |
|---|---|---|
| Popup opens on click of instance #1 | Detail window for Motor[1] appears | |
| Popup opens on click of instance #2 | Detail window for Motor[2] appears | |
| Start command in popup updates running indicator in source faceplate | Indicator turns green | |
| Close button dismisses popup | Window closes, no errors in trace | |
| Multiple popups open simultaneously | Both operate independently | |
| Restart of runtime | Re-clicking instance re-opens popup cleanly |
Troubleshooting
| Symptom | Likely Cause | Fix |
|---|---|---|
| Popup does not open | Faceplate type name misspelled in OpenFaceplateInPopup
|
Match the library name exactly; case-sensitive |
Popup opens with ### in all fields |
Tag prefix does not resolve to existing HMI tags | Verify the prefix string matches a tag or array element in the HMI tag table |
| Popup shows wrong instance data | Prefix parameter was a constant, not the faceplate's TagPrefix
|
Use the implicit TagPrefix symbol inside faceplate scripts, or pass the screen's Tags("SelectedPrefix").Read()
|
| Popup closes immediately |
closeOnTouchOutside: true and the click registered as outside |
Set closeOnTouchOutside: false for mandatory drill-downs |
| "Bad quality" overlays in popup | Connection to PLC interrupted or wrong area pointer | Check HMI connection in Connections editor; warm-restart |
| Popup opens off-screen |
x/y set beyond the panel resolution |
Use defaults (center) or set within panel pixel dimensions |
Script error: UI is undefined
|
Script running in a VBScript context | Convert to JavaScript; VBScript is not supported in Unified |
| Only one popup opens at a time |
modal: true blocks the second call |
Set modal: false if multiple popups are required |
| Faceplate instance shows the same data as the popup | Prefix of the popup is empty or matches the instance accidentally | Pass the instance prefix explicitly; never call with ""
|
| Popup flickers when tag updates | Update cycle too fast for the panel | Increase the faceplate's update cycle to 1000 ms or higher |
Field-Proven Cautions
- The implicit
TagPrefixsymbol is only valid inside faceplate scripts. CallingUI.OpenFaceplateInPopup()from a screen-level script requires an explicit prefix string. - Map the full UDT array once, not each element separately. Per-element mappings defeat the whole purpose of Tag Prefix.
- Never hardcode prefix strings like
"Motor[3]". Use a parameter tag or compute the prefix from a screen tag, so the design survives renumbering. - On Unified Comfort Panels, popup dragging is constrained to the visible screen. Tests in the RT simulator can give false positives that the popup will be reachable on a 7-inch panel.
- The TIA Portal V21 help documents
UI.OpenFaceplateInPopup()under the RT Unified JavaScript object model. Earlier V18/V17 builds expose the same method name but with fewerpopupOptionskeys. Pin your engineering version to match your runtime version.
References Embedded Above
Frequently Asked Questions
How do I open a pop-up window from a faceplate in WinCC Unified V21?
Add a script event (for example, OnMouseDown) on the faceplate body and call UI.OpenFaceplateInPopup("fpDetail", TagPrefix, { title: "Detail", width: 480, height: 320 }). The implicit TagPrefix symbol passes the current instance prefix automatically. The method is documented in the TIA Portal V21 Unified runtime JavaScript object model.
What is the Tag Prefix property in a WinCC Unified faceplate?
Tag Prefix is a string property on the faceplate instance that the runtime prepends to every internal tag reference. Setting it to HMI_Tags::Motor[3] binds the faceplate to element 3 of the Motor HMI tag array, so the same faceplate shows different data per instance without duplicating the symbol.
Can a WinCC Unified pop-up open another pop-up at runtime?
Yes. A script inside the first popup can call UI.OpenFaceplateInPopup() again with a different faceplate type and prefix. The original popup stays open; the new popup is created on top. Use modal: true on the second popup to force the user to finish or cancel before returning to the first.
Why does my popup show the wrong data after clicking a faceplate?
Most often the prefix passed to OpenFaceplateInPopup() is a constant or a screen-level tag that was not updated for the clicked instance. Inside a faceplate script, use the implicit TagPrefix symbol. From a screen script, read the prefix from a tag that you update on selection change, and verify it in the RT trace before debugging the faceplate itself.
How do I close a popup that was opened with UI.OpenFaceplateInPopup()?
Capture the return value of the call. The object exposes a handle number and a close() method. Call handle.close() from any script, or trigger it from a faceplate event such as an "Acknowledge" button inside the popup.
Does UI.OpenFaceplateInPopup() work in TIA Portal V18 or V19?
Yes. The method name has been present since Unified V17. The popupOptions object keys (modal, closeOnTouchOutside, draggable, resizable) are documented in V20/V21; older builds support a subset. Keep the TIA Portal engineering version aligned with the runtime version to avoid missing-option warnings during compile.