Making Faceplates Movable in WinCC Flexible and WinCC Unified
Movable, draggable faceplates are a long-standing requirement for operator screens that mirror plant mimic views, mobile maintenance panels, and floating diagnostic overlays. In the Siemens HMI line, the behavior is implemented differently across the two runtime generations:
- WinCC Flexible 2008 / WinCC Flexible PC Runtime — No native "Can be moved" property on faceplates; movability must be engineered through ActiveX controls, the picture window object, or VBScript.
- WinCC Unified (TIA Portal V17–V20) — Faceplate container exposes a built-in Can be moved inspector property that enables runtime drag without scripting.
This reference documents both paths, the underlying Win32 API mechanics that the legacy path depends on, and the configuration values that must match to make runtime drag work reliably.
1. Prerequisites
| Item | Required for | Notes |
|---|---|---|
| WinCC Flexible 2008 SP5 | Legacy path (ActiveX / Picture Window / VBS) | Engineering system; deploys to Panel or PC Runtime |
| WinCC Flexible PC Runtime | ActiveX-based mouse capture | ActiveX controls load only in PC Runtime, not on Windows CE Panels |
| TIA Portal V17 / V18 / V19 / V20 with WinCC Unified | Native faceplate drag | Inspector property "Can be moved" available on Unified faceplate container |
Win32 user32.dll access |
Manual mouse-position scripts | Only available on PC Runtime / Unified PC Runtime |
| STEP 7 / SIMATIC S7 PLC tags | Multi-instance faceplate addressing | Required if faceplate is reused across multiple plant objects |
2. WinCC Flexible Architecture Constraints
WinCC Flexible differentiates between three runtime targets: Windows CE Panels, Panels with Windows CE 5.0/6.0, and PC Runtime on Windows. The movability question intersects directly with this matrix because:
- ActiveX controls can only be instantiated on PC Runtime. Windows CE does not host COM/ActiveX containers.
- WinCC Flexible faceplates (template pictures inserted as instances) have no
Movableattribute in the object properties dialog. They inherit position from the calling screen and from the tag-based dynamic dialog used for indirect addressing. - The Picture Window object in WinCC Flexible does expose a
MOVABLEbit under Properties > Display > Can be moved, but only when inserted as a standalone picture window — not when carrying a faceplate that itself uses instance-specific tag prefixes.
The practical consequence is that engineers typically combine picture windows (which can be made movable) with scripts that swap the picture name, effectively producing a movable faceplate on PC Runtime.
3. WinCC Unified: Native Faceplate Container Movability
The current Siemens documentation explicitly addresses this requirement for WinCC Unified. The faceplate container object (the Unified successor to the Flexible faceplate concept) supports drag-and-drop positioning without scripting.
3.1 Inspector Path
- Open the screen in the TIA Portal screen editor.
- Select the Faceplate container instance placed on the screen.
- In the Inspector window, expand Properties > Appearance.
- Activate the option "Can be moved".
- Compile and download to the Unified Runtime (Comfort Panel with Unified firmware, Unified PC Runtime, or Open Controller).
At runtime, the operator can press and hold on the container's title area (or its body, depending on configuration) and drag it freely across the screen canvas. The position is non-persistent across screen changes unless the engineer wires the Position.X and Position.Y properties to internal tags.
4. WinCC Flexible PC Runtime: ActiveX Mouse Capture
On PC Runtime, the only reliable method for true cursor-based drag is to instantiate an ActiveX control that exposes cursor coordinates to VBScript. The standard WinCE-only animation Movement under Animations > Movement in WinCC Flexible will move an object, but only along a configured axis in response to a tag value — not in response to mouse drag.
4.1 Win32 API Contract
The Windows API exposes the cursor's screen-space coordinates through GetCursorPos in user32.dll. The function declaration for 32-bit hosts (which is what Flexible PC Runtime targets on Windows 7 / 10 / 11) is:
' --- Declarations (VBA / VBS compatible) ---
Private Type POINT_TYPE
X As Long
Y As Long
End Type
Private Declare Function GetCursorPos _
Lib "user32.dll" _
(xyPoint As POINT_TYPE) As Long
' --- Sample read ---
Dim cp As POINT_TYPE
Dim rval As Long
rval = GetCursorPos(cp)
' cp.X and cp.Y now hold screen-space cursor pixels
The values returned are in screen pixels, not in the HMI screen's pixel coordinate system. The engineer must compensate for the runtime window's origin (top-left corner) before writing the coordinates to the Left and Top properties of the picture window.
4.2 Why This Fails Inside Standard WinCC Flexible Scripts
The VBScript execution context inside a WinCC Flexible screen is sandboxed. It cannot Declare external Win32 API functions directly. Two practical workarounds exist:
-
Wrap
GetCursorPosin a custom ActiveX control. The ActiveX exposes aCursorXandCursorYproperty that the script can read. This is the path Siemens documents in the legacy ActiveX entry for WinCC Flexible: "How do you register an ActiveX object on the configuration computer and then incorporate it in WinCC flexible?" -
Use a third-party ActiveX with mouse hooks. Several vendors publish ActiveX controls that translate
WM_LBUTTONDOWN,WM_MOUSEMOVE, andWM_LBUTTONUPinto X/Y pairs.
Either path is restricted to PC Runtime. On a Windows CE Panel, the only way to move a faceplate is the picture-window trick described in Section 5, or by binding the picture window's Left / Top to a tag the operator can change from a numeric input.
5. Picture Window Approach (WinCC Flexible, All Targets)
The simplest cross-platform movable surface in WinCC Flexible is the picture window itself. The picture window can host any picture, including a faceplate template, and it exposes a MOVABLE bit under its animation properties.
5.1 Configuration Steps
- In the project tree, create a new picture (e.g.,
Faceplate_Motor.fpm) that contains the template objects. Mark it as a faceplate by enabling Picture > Use as faceplate in the picture properties. - On the target screen, insert a Picture Window object (not a faceplate instance).
- Set the picture window's Picture Name property to the faceplate name, and bind it to an internal tag if multiple instances are needed.
- Open Properties > Display on the picture window and set "Can be moved" = Yes.
- If the window should appear only when the operator taps a motor symbol, bind its Display property to a tag that flips on the symbol's click event.
At runtime, the picture window behaves like a pop-up that the operator can drag with a touch or mouse press. The faceplate inside it retains all its tag-prefixed bindings because the prefix is attached to the picture window instance, not the picture file.
6. Script-Based Dynamic Positioning
When movability must be deterministic — for example, when the faceplate must always overlay a specific alarm — drive the picture window position from a tag updated by a script. The Siemens "Application Example Blocks for STEP 7 and WinCC flexible" documents the dynamic-positioning pattern in detail.
6.1 Tag Convention
| Tag | Data type | Purpose |
|---|---|---|
HMI_FP_X |
INT | Left edge of picture window, in screen pixels |
HMI_FP_Y |
INT | Top edge of picture window, in screen pixels |
HMI_FP_Visible |
BOOL | Display flag for the picture window |
HMI_FP_Picture |
STRING | Picture name (faceplate) to load |
6.2 Binding Properties
- Picture window Left →
HMI_FP_X - Picture window Top →
HMI_FP_Y - Picture window Display →
HMI_FP_Visible - Picture window Picture Name →
HMI_FP_Picture
A VBScript on the calling button writes HMI_FP_X and HMI_FP_Y from the cursor coordinates captured by the ActiveX control, then sets HMI_FP_Visible = TRUE. On dismissal the script sets the visibility flag false and frees the cursor hook.
7. Comparison: Flexible vs Unified Movability
| Capability | WinCC Flexible 2008 | WinCC Unified V17–V20 |
|---|---|---|
| Native "Can be moved" on faceplate container | No | Yes |
| Picture window movability | Yes (Display → Can be moved) | Yes (Inspector → Can be moved) |
| Mouse cursor capture via Win32 API | Possible (ActiveX wrapper required) | Possible via scripting; not required for native drag |
| ActiveX on Windows CE Panels | Not supported | N/A (Unified Panels use different runtime) |
| Touch-drag on Comfort Panels | Picture window only | Faceplate container + picture window |
| Persistent position across screen change | Tag-driven only | Tag-driven or position-property binding |
8. Step-by-Step: Movable Faceplate on a Unified Panel
- In the TIA Portal project, create a faceplate type under HMI > Faceplates. Add the required tags and properties.
- On the process screen, drag a Faceplate container from the toolbox onto the canvas.
- Configure the container's Interface tab with the tag prefix pointing at the desired DB instance.
- Select the container and open the Inspector window.
- Expand Properties > Appearance and enable Can be moved.
- If the position must be saved through a power cycle, add two internal tags
FP_X,FP_Yof type INT. Bind the container's Position > Left toFP_Xand Position > Top toFP_Y. Write the tags back from the Position changed event using a script that triggersSmartTags("FP_X") = HmiRuntime.Screens("Main").ScreenItems("FPC_1").Left. - Compile the HMI and download to the target.
- Test drag with both finger and stylus on the panel; verify the container follows without lag.
9. Step-by-Step: Movable Picture Window in WinCC Flexible 2008
- Build the faceplate picture as described in Section 5.
- Insert a Picture Window on the calling screen.
- Open Properties > Display and set Can be moved = Yes.
- If on PC Runtime, attach an ActiveX control that exposes cursor X/Y. Bind the picture window's Left and Top to internal tags
FP_XandFP_Y. - Drive
FP_X/FP_Yfrom a VBScript that runs on the ActiveX's OnMouseMove event:
Sub ActiveX1_OnMouseMove(ByVal X As Long, ByVal Y As Long)
SmartTags("FP_X") = X
SmartTags("FP_Y") = Y
End Sub
On a Windows CE Panel, replace the ActiveX event with a numeric input dialog that lets the operator key in the new X and Y, or use the picture window's built-in touch-drag which is enabled by step 3 alone.
10. Verification
| Check | Pass criterion |
|---|---|
| Drag on Unified Panel | Container follows finger within one frame at 60 Hz; no jump-back after release |
| Drag on Flexible PC Runtime | Picture window position tracks cursor ±1 pixel; cursor leaves no trail |
| Layer count | Number of movable objects ≤ configured layer maximum |
| Tag prefix integrity | Faceplate tags update from the instance the picture window is bound to |
| Screen change persistence | If persistence is required, FP_X/FP_Y restore container within ±2 px after navigation |
| Compile warnings | No "ActiveX not registered" warnings; no "Layer overflow" warnings |
11. Troubleshooting Matrix
| Symptom | Likely cause | Fix |
|---|---|---|
| "Can be moved" greyed out on Unified container | Screen or layer access protection | Lower the runtime-level access protection on the screen object |
| Picture window will not drag on CE Panel | ActiveX was inserted instead of a Picture Window | Replace with Picture Window from toolbox under "Simple Objects" |
| Cursor coordinates off by runtime window origin | Used screen pixels, not client pixels | Subtract runtime window's left/top from GetCursorPos result |
| Faceplate tags update wrong instance after drag | Picture window tag prefix was overwritten by script | Re-bind the picture window's prefix to the original DB pointer |
| Layer flicker with multiple movable windows | Layer cycling exceeds panel memory | Reduce number of simultaneous movable picture windows to ≤6 |
user32.dll declaration rejected in Flexible script |
Sandbox blocks Declare | Wrap the API call inside an ActiveX control |
| Position resets to 0,0 after screen change | Position not bound to persistent tag | Bind container Position X/Y to internal tags and write them on the Position changed event |
| ActiveX control not listed in Flexible toolbox | Control not registered | Run regsvr32 on the OCX, then add to toolbox via Tools > Manage Add-Ins
|
12. Field-Proven Caveats
- On a TP700 Comfort running Unified, a faceplate container dragged off-screen cannot be recalled except by screen change or by writing its Position X/Y tags from a script. Always provide a "Reset position" button.
- WinCC Flexible picture windows made movable do not respect the screen's tab order. After moving, the keyboard focus does not follow the window. Plan operator workflows around touch, not keyboard navigation.
- On PC Runtime, the mouse coordinates from
GetCursorPosare in physical pixels. If the runtime window is scaled (DPI > 100%), divide by the DPI scale factor before writing toFP_X/FP_Y. - The Siemens Application Example for dynamic positioning uses multi-instance DB addressing. Each faceplate instance must have a unique tag prefix or the wrong motor's data will display.
- On Unified, drag interaction requires the runtime to grant the operator role the "Move" authorization on the screen object. Without it, "Can be moved" appears enabled in engineering but is suppressed at runtime.
13. Migration Notes: From Flexible to Unified
When porting a WinCC Flexible project that uses movable picture windows to WinCC Unified:
- Convert picture-based faceplates to Unified faceplate types under HMI > Faceplates.
- Replace picture window + ActiveX scripts with faceplate containers that have Can be moved enabled.
- Drop all Win32 API wrappers — Unified exposes cursor coordinates natively through the screen's OnMouseDown, OnMouseMove, and OnMouseUp events.
- Re-bind any persistent position tags to the new internal tag namespace because the migration tool may rename
FP_XtoHMI_Tag_1.
How do I make a faceplate movable in WinCC Unified?
Select the faceplate container on the screen, open the Inspector window, expand Properties > Appearance, and activate "Can be moved". No script is required; the Unified runtime handles drag natively on Comfort Panels and Unified PC Runtime. See the TIA Portal Unified screen-object reference at docs.tia.siemens.cloud.
Can I get the mouse cursor position inside a WinCC Flexible VBScript?
Not directly. WinCC Flexible sandboxes VBScript and blocks Declare Function for Win32 APIs. Wrap GetCursorPos from user32.dll inside a custom ActiveX control and expose its X/Y as properties. Registration steps are documented in the Siemens FAQ at support.automation.siemens.com.
Why does my movable picture window reset position after a screen change?
Because the picture window's Left and Top are not bound to internal tags. Bind them to FP_X and FP_Y and write the values on the Position changed event so they restore when the screen returns.
Does ActiveX movability work on Windows CE Panels?
No. ActiveX controls require COM, which is not available on Windows CE 5/6. On a CE Panel, use the picture window's built-in touch-drag (Display > Can be moved = Yes) and drive position changes from tags if drag-by-touch alone is insufficient.
What is the maximum number of movable picture windows per screen?
Approximately six on a 7" Comfort Panel before layer cycling produces flicker. The exact limit depends on the panel's layer configuration; check the runtime log for "Layer overflow" warnings and reduce the count accordingly.