1. Problem Summary
A WinCC V7 graphic that works correctly on the local server fails to execute its VBScript handler on a WinCC/WebNavigator client. The most common manifestation is a property change event written in the Graphics Designer that fires reliably in the server Runtime and never fires (or fires silently with no output in the client diagnostic window) on a remote WebNavigator session.
The typical configuration that triggers this fault is:
- An external application built against the WinCC ODK (Open Development Kit) modifies HMI screen properties (Text, BackColor, FillColor, Visible, etc.) at runtime through the WinCC API.
- The dynamic property is not bound to a tag in the Graphics Designer; the modification is pushed by the ODK application as a runtime-only property change.
- The script handler is attached to
Object > Properties > Event > Property Changeof the affected faceplate object. - On the WinCC server, the script executes and writes to the diagnostic window. On the WebNavigator client, the same script is published but does not execute.
2. WinCC/WebNavigator Script Execution Model
WebNavigator is a thin-client topology that mirrors the active picture of the server. The execution model differs from the WinCC Runtime in three places that matter for this fault:
| Layer | WinCC Runtime (Server) | WebNavigator Client |
|---|---|---|
| VBScript engine | Full MS Script Control, full WinCC object model | Restricted script engine, restricted object model subset |
| HMIRuntime object | Resolves to local WinCC project context | Resolves to the remote session context; some members return server-side values |
| File system access | Direct, full local I/O | Indirect; only paths resolvable on the client or provided through WinCC channels |
| Property change events | Fire on every write to a property | Fire only when the change is propagated through the WebNavigator channel |
For an overview of the differences between WinCC Basic System and WinCC/WebNavigator see the Siemens documentation Using Scripts (RT Professional) - Differences to WinCC Basic System. The same restrictions apply to the WinCC V7 WebNavigator product line; the C and VB scripting rules are documented in the WinCC/WebNavigator V7 manual "Scripting in WebNavigator" (Siemens order number 6AV6361-1AA00-1... series).
3. Root Cause 1 — HMIRuntime.ActiveProject.Path Returns Server Path on Client
The VBS function HMIRuntime.ActiveProject.Path returns the file-system path of the currently loaded WinCC project. On the WebNavigator client the returned string is the path on the WebNavigator server, not on the client workstation. If the script uses the returned path to load a template, an HTML fragment, or a bitmap by reference, the WebNavigator client attempts to open the file locally and fails silently because the file does not exist at that path on the client.
Failure pattern observed in production:
' ===== Faulty: dynamic path on client =====
Dim sRefPath
sRefPath = HMIRuntime.ActiveProject.Path & "\KomiPatternRef\Piece_P0001.htm"
HMIRuntime.Trace "Loading: " & sRefPath
' Server: opens file (path resolves on D:\1_Project\WCC_ToMDB)
' Client: file not found; script aborts before any visible side-effect
The silent abort in the property change event handler is the reason no entry appears in the WebNavigator diagnostic window — the engine loads the script, encounters the I/O failure, and terminates the handler without dispatching the trace.
4. Root Cause 2 — ODK-Driven Property Change and Client-Side Event Routing
When a WinCC ODK application (built against CCOdkRtApi.dll / ODKRT.lib) writes a property directly through the WinCC automation model, the modification enters the WinCC property tree as a server-side change. The WebNavigator server forwards the new value to the client through the picture-delta channel. The client renderer updates the visual property but the client-side script engine only fires the OnPropertyChange event when the change has been routed through the WebNavigator script-event channel, not when the change is propagated purely as a visual delta.
For an event to be raised on the WebNavigator client the following must be true:
- The object whose property changes is part of a picture that the client has loaded and that the client is currently displaying.
- The property change enters the WebNavigator event bus on the server (typical when the change is a tag-bound property or a direct DM variable write).
- The script handler is published in the Graphics Designer and is part of the WebNavigator package.
- The VBS handler does not call any function that is restricted on the client.
Direct ODK IActionPicture / IScreenItem writes to non-tag-bound properties can update the screen on the server but not always raise the WebNavigator OnPropertyChange event on the client. Treat ODK-driven property changes as a server-side event and route the script trigger through an internal tag.
5. Root Cause 3 — Function Compatibility Restriction
The WebNavigator client implements a strict subset of the WinCC VBS object model. The complete list of restrictions is in the manual "WinCC/WebNavigator V7 — Programming and Programming Reference". Functions that are documented as "supported only in WinCC Runtime" or "not supported on WebNavigator client" include (non-exhaustive):
| Function / Object | Server | WebNavigator Client |
|---|---|---|
| HMIRuntime.FileSystem | Supported | Not supported |
| HMIRuntime.Trace (when writing to server path) | Supported | Limited; only client-trace buffer |
| FSO (FileSystemObject) file I/O | Supported | Not supported |
| Shell / WScript.Shell | Supported | Not supported |
| WinCC picture window navigation by direct path | Supported | Restricted; only by picture name |
| HMIRuntime.ActiveProject.Path | Server path | Returns server path — see Section 3 |
6. Diagnostic Procedure — WebNavigator Client Diagnostic Window
Open the diagnostic window on the WebNavigator client and on the server simultaneously to compare runtime behaviour. The diagnostic window is launched from the WinCC Explorer on the server with the WebNavigator client connected, or from the client itself if the WinCC Explorer plug-in is installed.
- On the server, open WinCC Explorer > Tools > WebNavigator > WebNavigator Diagnostics.
- Select the connected client in the Active Clients list.
- Open the Diagnostic Window tab and enable the following trace flags:
-
GDI_RT_TRACE— picture and object lifecycle -
WN_SCRIPT_TRACE— script load and execution -
WN_EVENT_TRACE— property change event dispatch
-
- Trigger the ODK-driven property change on the server.
- Capture the client trace and the server trace side by side.
Expected good trace on a working client:
WN_EVENT_TRACE: OnPropertyChange event raised for object "txtField1"
WN_SCRIPT_TRACE: Loading script "Script_OnPropChange.txt" size 612 bytes
WN_SCRIPT_TRACE: Script returned without error
GDI_RT_TRACE: Refresh of object "txtField1" complete
Expected fault trace when the script references a server path on the client:
WN_EVENT_TRACE: OnPropertyChange event raised for object "txtField1"
WN_SCRIPT_TRACE: Loading script "Script_OnPropChange.txt" size 612 bytes
WN_SCRIPT_TRACE: Script aborted at line 14 — file not found
If the client trace does not show OnPropertyChange event raised at all, the event is not being routed to the client. This points to the ODK event-routing issue described in Section 4, not to a script defect.
7. Fix 1 — Replace Dynamic Path with a Project Tag
Do not compute a file path from HMIRuntime.ActiveProject.Path inside a WebNavigator script. Store the absolute path as a WinCC internal tag at project startup, or hard-code the path in the script. The hard-coded form is acceptable when the project is deployed to a fixed server directory; the tag form is the recommended pattern for portable projects.
Recommended pattern (tag-driven):
' Server-side project startup script (Graphics Designer > Global Script)
Dim sRefBase
sRefBase = HMIRuntime.ActiveProject.Path & "\KomiPatternRef\"
HMIRuntime.Tags("RefBasePath").Write sRefBase
HMIRuntime.Tags("RefBasePath").Read
' Client-safe property change event handler
Dim sRefPath
Dim sBase
sBase = HMIRuntime.Tags("RefBasePath").Read
If Len(sBase) = 0 Then
sBase = "d:\1_Project\WCC_ToMDB\KomiPatternRef\" ' fallback
End If
sRefPath = sBase & "Piece_P0001.htm"
HMIRuntime.Trace "RefPath = " & sRefPath
Use an internal tag of data type Text tag, 8-bit character set, length 255. Reference the tag in the picture with a trigger on the property change so the value is available to the script before the handler runs.
8. Fix 2 — Route ODK Property Changes Through a Trigger Tag
For ODK-driven modifications, the most reliable way to fire a client-side handler is to commit the modification as a tag write inside the ODK application and let the WebNavigator event channel dispatch the property change to the client. The pattern is:
- Create an internal tag
evtPropChange_<ObjectName>(binary or byte). - Bind the visible property (Text, BackColor, etc.) to this tag through a dynamic dialog or a direct tag connection.
- From the ODK application, write the new value to the tag using
DMVarSet...or the equivalent C API call. - Attach the VBS handler to the tag's
OnChangeevent. The handler runs on every client that has loaded the picture and the tag.
// ODK C++ snippet — equivalent of a tag write
LPCSTR lpszValue = "Hello, client";
HRESULT hr = pDMVariable->SetValue(lpszValue);
if (FAILED(hr)) {
// log via ODK error channel
}
OnPropertyChange event fires on every connected client.9. Fix 3 — Verify and Remove Unsupported Functions
Audit every script that is published in the WebNavigator package against the V7 WebNavigator compatibility list. Replace unsupported calls with server-side equivalents called from a server startup script or from a C action.
| Unsupported on client | Replacement |
|---|---|
CreateObject("Scripting.FileSystemObject") |
Move file I/O to a server C action triggered by a tag |
CreateObject("WScript.Shell") |
Replace with a WinCC standard function or a C action |
HMIRuntime.ActiveProject.Path |
Use a startup tag (Section 7) |
| Direct OCX / ActiveX control methods | Wrap with a C action on the server |
10. Publishing and Deployment Checklist
A script that exists only in the Graphics Designer is not automatically distributed to the WebNavigator client. The publish step compiles the script, embeds it in the WebNavigator package, and signs it for the client. A failure in any of the following checks causes the client to silently load an empty script body.
- In the Graphics Designer, right-click the script and select Publish > Publish in WebNavigator. The icon must show a green tick on every script that the client must run.
- Open the WebNavigator Publisher tool (WinCC Explorer > WebNavigator > Publisher). Confirm the package is rebuilt after every change to a script or to a picture that contains scripts.
- On the WebNavigator client, open the picture and trigger the event. Verify in the diagnostic window that the script body is loaded (see Section 6 expected trace).
- If the script still does not execute, delete the local Internet Explorer cache and the WinCC client cache folder (default:
%LOCALAPPDATA%\Siemens\WinCC\WebNavigator\Cache).
11. Verification Procedure
Run the following checks in order. The procedure is structured so that each step isolates one of the three root causes described in Sections 3 to 5.
- Step A — Server trace. Trigger the property change on the server. Verify the script executes and the trace appears in the server APDiag. This proves the script itself is correct.
-
Step B — Client trace. Trigger the same change on the WebNavigator client. Verify whether the
OnPropertyChange event raisedline appears in the WebNavigator diagnostic window. If absent, the event is not being routed; apply Fix 2 (Section 8). -
Step C — File-system independence. Modify the script to remove every
FileSystemObject,Shell, andHMIRuntime.ActiveProject.Pathreference. If the script now runs, one of these calls is the cause; apply Fix 1 (Section 7) and Fix 3 (Section 9). -
Step D — Tag-driven trigger. Replace the property change event with a tag
OnChangeevent bound to an internal tag. Write to the tag from the ODK application. Verify the client-side event fires. - Step E — Cache reset. Clear the WebNavigator client cache and reload the picture. Re-run Step A through Step D.
12. Edge Cases and Field-Proven Caveats
- Picture caching on the client. A picture that the WebNavigator client has not opened in the current session does not run any of its scripts, even if the picture is part of the published package.
-
Property change on picture-window contents. Property change events on objects inside a picture window are not raised on the client when the picture window has been instantiated through a direct server-side path. Use a tag-driven
PictureNameconfiguration instead. - Multiple clients, different auth. WebNavigator operator-level authorization is per client. A script that depends on a tag whose access permission is restricted on the client will not fire.
- Internet Explorer dependency. WinCC V7 WebNavigator requires the WinCC WebNavigator Control for Internet Explorer. On Windows 10/11 with the Edge-IE mode the client control must be enabled in Group Policy > Administrative Templates > Windows Components > Internet Explorer > Compatibility View.
- ODK lifecycle. The ODK application must remain alive while the WinCC project is loaded. If the ODK application crashes, property changes that were already in flight can be lost. Use a watchdog tag written every second to detect ODK outages.
13. Performance and Reliability Notes
Property change events on the WebNavigator client have a per-event round-trip cost of approximately one TCP datagram exchange plus the script execution. In a high-change-rate scenario (more than 20 changes per second) the event channel becomes a bottleneck and the client drops events. Use a deadband on the internal trigger tag to throttle the rate:
' Tag OnChange handler — throttle to 100 ms minimum interval
Dim dLastChange
dLastChange = HMIRuntime.Tags("evtLastChange").Read
If (Timer - dLastChange) < 0.1 Then
Exit Sub
End If
HMIRuntime.Tags("evtLastChange").Write Timer
' ... main handler body ...
For the server-side APDiag traces, enable the Script and ODK filters only during commissioning. Leaving them enabled in production adds overhead and can mask real faults in the trace stream.
14. References for Verification
Confirm the function-level restrictions for the WinCC/WebNavigator version in use by reading the official Siemens documentation:
- Using Scripts (RT Professional) - Differences to WinCC Basic System — the canonical description of the WebNavigator script compatibility restrictions.
- WinCC/WebNavigator V7 manual "Scripting in WebNavigator" — service-pack specific function list (delivered with the WinCC V7 install media).
- WinCC ODK manual — description of the C/C++ API for property modification, included in the WinCC install media as a separate document.
Why does my WinCC WebNavigator client not run a property change VBS script that runs perfectly on the server?
Three causes cover almost every case. First, the script reads a path from HMIRuntime.ActiveProject.Path, which on the client returns a server-side path that the client cannot open. Second, the property is being written by a WinCC ODK application directly to the property tree, so the WebNavigator event channel never sees the change. Third, the script calls a function (FileSystemObject, WScript.Shell, OCX methods) that is not supported on the WebNavigator client. Apply Fix 1, Fix 2, and Fix 3 in that order.
How do I find which line of a WebNavigator client script is failing?
Open the WebNavigator diagnostic window on the client (WinCC Explorer > WebNavigator > WebNavigator Diagnostics), enable the WN_SCRIPT_TRACE flag, and trigger the event. The trace records the line at which the script aborted. The server-side APDiag is not a reliable mirror of the client behaviour because the script engines differ.
Is HMIRuntime.ActiveProject.Path safe to use in a WebNavigator client script?
No. On the WebNavigator client the value is the project path on the server, not on the client. Use an internal WinCC tag that is written by a server-side startup script, or hard-code the absolute path when the project is deployed to a fixed location.
My ODK application writes a property but the client-side event does not fire. What is the correct pattern?
Write to an internal WinCC tag from the ODK application and bind the visible property to that tag through a dynamic dialog or a direct tag connection. Attach the VBS handler to the tag's OnChange event. The WebNavigator event channel is tag-driven, so a tag write guarantees the event is dispatched to every connected client.
How do I force a WebNavigator client to load the latest published scripts?
Have the client disconnect, delete the local cache folder (default %LOCALAPPDATA%\Siemens\WinCC\WebNavigator\Cache), and reconnect. The client downloads the published package on reconnect. Scripts that are not republished remain valid only for the picture version in which they were published.