WinCC Night Mode: VBS Gamma Control for Dim Red Runtime Display

David Krause19 min read
HMI / SCADASiemensTutorial / How-to
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

1. Problem Statement: Night-Viewability of Operator HMIs

Industrial operator HMIs in 24/7 process environments (control rooms, marine bridges, power plants, dispatch centers) are typically viewed across a wide range of ambient light conditions. A full-brightness, full-saturation display that is perfectly readable at 1000 lux is harsh, fatiguing, and visually destructive at 0.1 lux on a night shift. The classical approach to mitigate this is to place a red celluloid or acrylic filter sheet in front of the panel. A red filter attenuates blue and green wavelengths, suppresses the photopigment rhodopsin's bleach rate in the operator's rod cells, and preserves dark-adapted (scotopic) vision in the surrounding environment.

The user requirement that drives this article is the ability to switch a Siemens WinCC Runtime (WinCC RT Professional, WinCC RT Advanced, or WinCC flexible / TIA Portal HMI Runtime) into an equivalent electronic "red filter" mode by clicking a single button or by triggering a tag event, while:

  • Preserving the existing color semantics of dynamic objects (alarm states, motor running/stopped, valve open/closed).
  • Affecting every visible pixel, including bargraph fill colors, trend backgrounds, slider tracks, and any custom-wired object properties that the global color scheme does not cover.
  • Reversing to full-color day mode without restarting WinCC Runtime.

WinCC's built-in Global Color Scheme (GCS) editor controls only the palette entries mapped to the 16 (or 32) standard Design color slots. Any object whose color is bound to a PLC tag, a script, or a custom property bypasses the GCS. Bargraph BarColor and BarBackgroundColor, trend BackgroundColor, status display back colors, and direct faceplate BackColor assignments are common offenders. This is why a layered approach is required: GCS for what it covers, plus a hardware-level gamma ramp override for the rest.

Operator-safety note: Night dimming must never invert, scramble, or hide alarm-state colors. Treat alarm priorities (red/yellow/blue/white) as untouchable and only attenuate the background luminance. If your HMI uses red for the highest alarm priority, switch the night palette to a dim red-amber combination rather than attempting to remove red entirely.

2. Prerequisites

Item Specification / Version Purpose
WinCC Runtime WinCC RT Professional V17/V18/V19, WinCC RT Advanced V17/V18/V19, or WinCC flexible 2008 SP5 Host of the VBScript environment and the screen object tree
TIA Portal / WinCC Explorer Matching engineering version (e.g. TIA V18 for RT V18) Configure the button event, tag, and script
Operator panel OS Windows 10 IoT Enterprise LTSC 2019/2021, Windows 7 Embedded Standard (legacy) Provides GDI/CIM/DXGI surface APIs that VBS will drive
Graphics adapter driver Intel HD/UHD Graphics driver package OR vendor-certified panel video driver Must expose programmable gamma ramp or ICC profile path
Optional: ICC profile editor Windows Color Management (built-in) or third-party tool such as dispcal + argyll Builds a low-luminance, red-shifted ICC profile for the night state
Internal WinCC tag Boolean NightMode with start value 0 State carrier for the button toggle and any tag-triggered automation

Confirm that VBScript is enabled in your WinCC project. In TIA Portal, this is the project property Runtime settings > Scripts > VBScript; in legacy WinCC Explorer, check Computer properties > Graphics Runtime > ActiveX / VBScript. Without VBScript enabled, none of the methods described in this article will execute.

3. Why the Global Color Scheme Falls Short

The WinCC Global Color Scheme (Siemens documentation: WinCC V18 Runtime > Configuring the User Interface > Working with Designs) maps the 16 (Classic) or 32 (Modern) design color slots to specific screen elements. When an object's color property is bound to a design slot, the screen re-renders whenever the design is switched. This is the cleanest path, but only for the slots in scope.

Objects whose color is not covered by the GCS include:

  • Bargraph BarColor and BarBackgroundColor when set to a fixed RGB literal rather than a design slot.
  • Trend view plot area, ruler, and grid colors.
  • Alarm view row state colors set via the alarm logging configuration.
  • Symbolic graphics libraries imported from third parties.
  • Custom ActiveX / .NET controls embedded in the screen.
  • Status displays driven by a tag value (the dynamic value overrides the design slot).

Modifying each of these individually to add a night-mode variant is impractical. The pragmatic answer is to apply a display-level color transformation after WinCC has rendered its frame, by adjusting the Windows graphics adapter gamma ramp or by activating a per-application ICC profile. The transformation is a 3x3 or 3x1 pixel mapping that all GDI and Direct3D surfaces pass through on the way to the panel.

4. Display Hardware Gamma Fundamentals

Every Windows graphics adapter exposes a gamma ramp per display output. The ramp is three arrays of 256 WORD (16-bit) values that map each of the R, G, B channels' 8-bit input codes to a DAC voltage. Setting the ramp to (low, low, high) values brightens red and attenuates green and blue, which is exactly the effect of red cellophane.

The Windows GDI function that writes the ramp is:

BOOL SetDeviceGammaRamp(HDC hdc, LPVOID lpRamp);

declared in gdi32.dll and callable from VBScript via the Declare statement. The getter is GetDeviceGammaRamp, which lets your script save the day-mode ramp at startup and restore it at shutdown so that the operator's desktop is not left in a red state when WinCC is closed.

Parameter Type Description
hdc Long (HDC) Device context of the target display, obtained via GetDC(0) for the primary surface
lpRamp Long (pointer) Pointer to a 1536-byte buffer: 256 WORDs for red, then 256 for green, then 256 for blue
Return value Boolean Non-zero on success; zero indicates the driver rejected the ramp (often on locked-down panel video)

The same control surface is exposed in modern Windows through DirectX's IDXGIOutput::SetGammaControl, but the GDI surface is the lowest-friction path from a WinCC VBScript because it requires no additional referenced assemblies.

5. VBScript Declaration in a WinCC Project

Open your WinCC RT project, navigate to the screen that will host the Night Mode button, and create a new action or a button's Click event with a VBScript. At the top of the project (in a global module) declare the external API once:

' ---- Global declarations (paste in a project-global VBS module) ----
Option Explicit

' GDI32 gamma ramp APIs
Private Declare Function GetDeviceGammaRamp Lib "gdi32" _
    Alias "GetDeviceGammaRamp" ( _
    ByVal hdc As Long, _
    ByVal lpvBuffer As Long) As Long

Private Declare Function SetDeviceGammaRamp Lib "gdi32" _
    Alias "SetDeviceGammaRamp" ( _
    ByVal hdc As Long, _
    ByVal lpvBuffer As Long) As Long

' GDI32 device context acquisition / release
Private Declare Function GetDC Lib "user32" _
    Alias "GetDC" (ByVal hwnd As Long) As Long

Private Declare Function ReleaseDC Lib "user32" _
    Alias "ReleaseDC" ( _
    ByVal hwnd As Long, _
    ByVal hdc As Long) As Long

' Storage for the original ramp so we can restore it on exit
Public g_rampDay(0 To 767) As Integer  ' 256*3 = 768 WORDs
Public g_rampSaved As Boolean
Word size warning. The ramp buffer is an array of unsigned 16-bit values. VBScript's Integer is signed 16-bit, which clips values above 32767. In practice, panel gamma ramps rarely exceed 0xFF00 and the clipping is invisible. If your driver emits a full-scale 0xFFFF, mask with Value And &HFFFF& to avoid overflow during array construction.

6. Building a Red-Shifted Gamma Ramp

The 256-entry ramp must be monotonically non-decreasing per channel. The simplest working approximation of a red filter is:

  • Red channel: identity (or a slight S-curve lift to compensate for the panel's lower red luminous efficacy).
  • Green channel: compressed to the lower half of the range, e.g. R[i] = (i/255)^2 * 16384.
  • Blue channel: compressed even harder, e.g. R[i] = (i/255)^3 * 8192.

A reference sub that fills the ramp:

' Build a dim, red-shifted 256*3 ramp into the byte buffer g_rampDay()
Public Sub BuildNightRamp()
    Dim i As Integer
    Dim r As Long, g As Long, b As Long
    Dim base As Long

    base = 0          ' 0 = darkest night; raise to 4096 for "moonlight" mode
    For i = 0 To 255
        ' Red: identity (or a slight power < 1 to dim)
        r = CLng(i) * 256        ' scale 0..255 to 0..65280
        If r > 65535 Then r = 65535

        ' Green: aggressive compression
        g = CLng((i / 255) ^ 2 * 16383)
        If g > 65535 Then g = 65535

        ' Blue: very aggressive compression
        b = CLng((i / 255) ^ 3 * 8191)
        If b > 65535 Then b = 65535

        g_rampDay(i)         = CInt(r And &HFFFF&)
        g_rampDay(256 + i)   = CInt(g And &HFFFF&)
        g_rampDay(512 + i)   = CInt(b And &HFFFF&)
    Next i
End Sub

For a milder "dusk" mode, raise base to 8192 and use a linear compression (exponent 1) on green and a square-root curve (exponent 0.5) on blue. Operators report the cubic blue curve as too aggressive on AMOLED panels; CCFL-backlit industrial panels are more forgiving.

7. Saving and Restoring the Day-Mode Ramp

Capture the day-mode ramp exactly once at WinCC startup, so the script can return the panel to its native state. The recommended hook is the project's Open event of the start screen, or the global ProjectOpened event handler:

' Save the OS-supplied ramp for later restoration
Public Sub SaveDayRamp()
    Dim hdc As Long
    Dim ok As Long

    hdc = GetDC(0)              ' 0 == HWND_DESKTOP, primary surface
    ok = GetDeviceGammaRamp(hdc, VarPtr(g_rampDay(0)))
    Call ReleaseDC(0, hdc)

    g_rampSaved = (ok <> 0)
End Sub

VarPtr is the WinCC VBScript intrinsic that returns the in-process address of a variable. It is the documented mechanism for handing a buffer pointer to a Win32 API and is exposed in the WinCC VBS reference manual.

8. Switching the Ramp at Runtime

The night-mode button's Click event should call one of two routines. We use an internal NightMode boolean tag as the state carrier so that other screens and tag-triggered events can react.

' Click handler of the "Night Mode" button
Public Sub btnNight_Click(ByVal Item)
    Dim hdc As Long
    Dim nightNow As Boolean

    ' Toggle the carrier tag
    nightNow = Not HMIRuntime.Tags("NightMode").Read
    HMIRuntime.Tags("NightMode").Write nightNow

    hdc = GetDC(0)

    If nightNow Then
        BuildNightRamp
        Call SetDeviceGammaRamp(hdc, VarPtr(g_rampDay(0)))
        ' Optional: show a small "NIGHT" badge on the screen
        HMIRuntime.Screens("Main").ScreenItems("lblNight").Visible = True
    Else
        If g_rampSaved Then
            ' The saved ramp is no longer in g_rampDay(); reload it from a backup buffer
            ' (Implementation: keep g_rampDayBackup alongside g_rampDay)
            Call SetDeviceGammaRamp(hdc, VarPtr(g_rampDayBackup(0)))
        End If
        HMIRuntime.Screens("Main").ScreenItems("lblNight").Visible = False
    End If

    Call ReleaseDC(0, hdc)
End Sub
Two-buffer pattern. The snippet above overwrites g_rampDay with the night ramp. In a real project, keep a separate g_rampDayBackup(0 To 767) populated in SaveDayRamp and never touched by the night ramp builder. Restoration always reads from the backup, never from a partially modified buffer.

9. Driver-Profile Switching on Intel Graphics

Some operator panels ship with Intel HD/UHD graphics and the Intel Graphics Command Center installed. The driver exposes multiple display color profiles, each of which can be activated by the OS. The user community has documented that right-clicking the Intel tray icon and selecting a different scheme (Normal vs. Night) applies a profile that closely matches the cellophane effect. To make this switch scriptable, you have two viable paths:

  1. Profile file approach. Pre-build a night ICC profile (e.g. with dispcal targeting 3000 K white point and a reduced luminance) and a day ICC profile. Save them in %SystemRoot%\System32\spool\drivers\color. Activate via the Windows Color Management control panel or via colorcpl.exe /d. Pair with a WinCC VBS that calls Shell("colorcpl.exe ..."); while this spawns a UI dialog rather than applying silently, it is reliable on locked-down operator panels.
  2. WMI MonitorBrightness / WmiMonitorBrightnessMethods. Modern WDDM drivers expose backlight brightness through the WmiMonitorBrightness class. Lowering brightness by 60 % has a similar dimming effect. This does not shift hue, but combined with the gamma ramp it produces a credible "night" profile on panels without an explicit hue control. Sample WMI call from VBS:
Set wmi = GetObject("winmgmts:\\.\root\wmi")
Set instances = wmi.ExecQuery("Select * From WmiMonitorBrightnessMethods")
For Each inst In instances
    inst.WmiSetBrightness(0, 30)   ' 0 = timeout disabled, 30 = 30 % brightness
Next

Note that this requires the panel firmware to implement ACPI backlight control. Panel PCs with a fixed-voltage backlight inverter will report WmiMonitorBrightnessMethods as empty and the call will fail silently.

10. A Complete Project-Ready Module

The following module is a drop-in, single-file reference that you can paste into a WinCC VBS project. It is structured for clarity, with a single public entry point ApplyNightMode that all screens call.

' ============================================================
'  Module:  modNightMode
'  Purpose: Toggle a dim, red-shifted display profile at runtime
'  Notes:   No external DLLs; relies on gdi32 SetDeviceGammaRamp
' ============================================================
Option Explicit

Private Declare Function GetDeviceGammaRamp Lib "gdi32" _
    (ByVal hdc As Long, ByVal lpvBuffer As Long) As Long

Private Declare Function SetDeviceGammaRamp Lib "gdi32" _
    (ByVal hdc As Long, ByVal lpvBuffer As Long) As Long

Private Declare Function GetDC Lib "user32" _
    (ByVal hwnd As Long) As Long

Private Declare Function ReleaseDC Lib "user32" _
    (ByVal hwnd As Long, ByVal hdc As Long) As Long

Private g_day(0 To 767)   As Integer
Private g_night(0 To 767) As Integer
Private g_captured        As Boolean

' ---------------------------------------------------------
' Initialise: capture the OS ramp ONCE.
' Wire to:   project "Startup" event or first screen's Open event
' ---------------------------------------------------------
Public Sub NightMode_Init()
    Dim hdc As Long, ok As Long
    hdc = GetDC(0)
    ok  = GetDeviceGammaRamp(hdc, VarPtr(g_day(0)))
    Call ReleaseDC(0, hdc)
    g_captured = (ok <> 0)
    BuildRamp g_night, 16383, 8191   ' (maxGreen, maxBlue) for night
End Sub

' ---------------------------------------------------------
' Build a 3x256 ramp. channelMaxG/Blue control the aggression.
' ---------------------------------------------------------
Private Sub BuildRamp(ByRef ramp() As Integer, _
                      ByVal maxG As Long, ByVal maxB As Long)
    Dim i As Integer, r As Long, g As Long, b As Long
    For i = 0 To 255
        r = CLng(i) * 256
        If r > 65535 Then r = 65535
        g = CLng((i / 255) ^ 2 * (maxG - 1))
        b = CLng((i / 255) ^ 3 * (maxB - 1))
        ramp(i)         = CInt(r And &HFFFF&)
        ramp(256 + i)   = CInt(g And &HFFFF&)
        ramp(512 + i)   = CInt(b And &HFFFF&)
    Next i
End Sub

' ---------------------------------------------------------
' Public entry point. Pass True to dim/redden, False to restore.
' ---------------------------------------------------------
Public Sub ApplyNightMode(ByVal nightOn As Boolean)
    Dim hdc As Long, ptr As Long
    If Not g_captured Then NightMode_Init

    hdc = GetDC(0)
    If nightOn Then
        ptr = VarPtr(g_night(0))
    Else
        ptr = VarPtr(g_day(0))
    End If
    Call SetDeviceGammaRamp(hdc, ptr)
    Call ReleaseDC(0, hdc)

    ' Mirror the state to a tag for screen logic and alarm filtering
    HMIRuntime.Tags("NightMode").Write nightOn
End Sub

' ---------------------------------------------------------
' Restore on shutdown. Wire to: project "Shutdown" event.
' ---------------------------------------------------------
Public Sub NightMode_Shutdown()
    If g_captured Then ApplyNightMode False
End Sub

11. Step-by-Step Implementation in TIA Portal

  1. Create the carrier tag. In the project tree, open HMI tags, add a Boolean tag NightMode with start value 0. Wire its update cycle to On demand.
  2. Add the VBS module. In the project tree, open VBScripts > Project-wide VBScripts (or the screen-local scripts section). Paste the modNightMode block from Section 10.
  3. Hook the startup event. Open Project tree > Runtime settings > General > Events. In the Runtime start row, click the events column and add the call NightMode_Init. Optionally also wire NightMode_Shutdown to Runtime stop.
  4. Place the toggle button. On the main screen, insert a Button object. Set its label to Night Mode. In the button's Click event, add the call ApplyNightMode Not HMIRuntime.Tags("NightMode").Read.
  5. Persist across restarts. Open the tag's properties, set Acquisition mode to Cyclic continuous only if other logic depends on it; otherwise On demand is correct and avoids unnecessary server load.
  6. Compile and download. Use Compile > Software (rebuild all) in TIA Portal, then download to the panel. The HMI Runtime will start in day mode and the button will toggle the dim/red profile.

12. Step-by-Step Implementation in WinCC Explorer (V7.x)

  1. Open the WinCC Explorer, select the project, and open Global Script > C / VBS Editor.
  2. Create a new Action and paste the modNightMode module. Mark it as a project-wide function so other pictures can call it.
  3. Open the start picture, drop a button, and in its Mouse Click event add the line ApplyNightMode Not HMIRuntime.Tags("NightMode").Read. Note that in V7 the runtime object is still HMIRuntime and the tag collection behaves identically.
  4. In the Computer properties, under Startup, append a launch parameter so that WinCC loads with the day-mode ramp captured. The WinCC startup can call NightMode_Init via a ProjectOpened event.
  5. Compile the script with F7 and run the Graphics Runtime. Toggle the button and observe the panel.

13. Verification

Check Procedure Expected result
Ramp capture Set a breakpoint on g_captured = (ok <> 0); launch the runtime. g_captured = True and g_day(0..767) populated with non-zero values.
Day-to-night toggle Click the Night Mode button. Use a photometer or the OS color picker on a white background. White pixel reports as warm red-orange; blue and green channels are heavily attenuated.
Night-to-day restore Click the button again. Check the same white pixel. White pixel returns to native white; NightMode tag reports 0.
Alarm visibility Trigger a high-priority alarm and view the alarm line in night mode. Alarm priority colors remain visible against the dim background. If using red as a priority color, switch it to amber for night mode by binding the design slot to a tag-driven color.
Shutdown restoration Close WinCC Runtime while in night mode. Desktop returns to day mode. If it does not, the NightMode_Shutdown hook was not wired correctly.
Driver rejection Run on a panel whose driver does not support gamma writes. Inspect the return value of SetDeviceGammaRamp. Function returns 0. The script must not assume success; log a warning to a tag or a file.

14. Troubleshooting Matrix

Symptom Likely cause Fix
Button has no effect on the panel Driver rejects SetDeviceGammaRamp; some panel video chips do not expose a programmable ramp Check return value; fall back to WMI brightness or ICC profile switch
Display stuck in red after closing WinCC NightMode_Shutdown not wired or fired too late Wire to the project End event and to a Windows scheduled task that runs on logoff
Colours flicker on toggle Calling SetDeviceGammaRamp more than once per frame Guard with the NightMode tag so the script is idempotent
Trend view colours look wrong in night mode Trend plot color is fixed, not bound to a design slot Bind trend colors to design slots; the GCS will not move them but at least the layered dim/red effect will still apply
VBScript compile error: "Expected statement" Module pasted inside an existing Sub/Function block Move module to a top-level script file, ensure no enclosing Sub
"VarPtr is not declared" Running on a runtime that has VarPtr disabled in the project security policy Enable VarPtr in the project's VBScript runtime options; otherwise you must use a different approach (see Section 9 WMI)
Two-panel setup: only the primary changes GetDC(0) returns the primary surface HDC only Enumerate displays with EnumDisplayMonitors and call SetDeviceGammaRamp on each HDC

15. Limitations and Edge Cases

  • Single-output assumption. The example addresses the primary monitor. Multi-monitor operator consoles (operator PC + alarm mimic) need a per-monitor loop via EnumDisplayMonitors.
  • Session-scoped. The ramp is per-adapter. RDP sessions, VNC mirror displays, and remote desktop viewer windows each have their own ramp and are not affected.
  • OS upgrade risk. A Windows 10 LTSC cumulative update can reset or reinit the graphics driver; if NightMode_Init is not re-run, the day-mode backup is stale. Hook the init to a display change WMI event to auto-recapture.
  • Color-critical workflows. Do not use this technique on screens where operators must discriminate hue precisely (e.g. a chromatography HMI or a status display with twelve coded colors). In those cases, build a per-object night variant instead.
  • Bright sunlight panels. On high-brightness outdoor panels, the gamma ramp is not enough; you must also drive the WMI brightness up to compensate, which works against the night-mode purpose.

16. Alternative: ICC Profile Switching from a WinCC Action

If the runtime OS has ICC profiles registered in %SystemRoot%\System32\spool\drivers\color, you can call the Color Management API via a small helper. The most script-friendly path is:

Set sh = CreateObject("WScript.Shell")
' Activate the "night" profile as the system default:
sh.Run "rundll32.exe colorcpl.exe,ColorCplApplyAssociatedColorProfile", 0, True

This works only on Windows 7 and early Windows 10 builds; the API surface was reduced in later versions. For modern Windows, the recommended mechanism is the SetUserDefaultLocale-style per-user profile association, which requires COM interop beyond what WinCC VBS can reliably marshal. In practice, the gamma-ramp approach is preferred for its determinism.

17. Field-Commissioning Notes

When you commission this on a customer site, do the following checks in order:

  1. Boot the panel with no WinCC. Verify the panel shows the OS desktop at native white. This is your day reference.
  2. Start WinCC. Verify the start picture displays at the same native white. If the panel is already reddish, the OS or driver started with a non-default profile; reset the profile to native before continuing.
  3. Toggle Night Mode. Verify the toggle works on the active picture, then click through every picture in the project to ensure the effect is consistent.
  4. Trigger an alarm. Confirm the highest-priority alarm is still readable. If it is not, do not deploy until the alarm colors are adjusted.
  5. Power-cycle the panel. Confirm the day mode is restored on a cold boot. If not, the NightMode_Init hook did not run early enough; move it to the project Startup event, which fires before any picture opens.

18. Glossary

Term Definition
Gamma ramp 256-entry lookup table per channel (R, G, B) mapping 8-bit input codes to DAC voltages
GCS Global Color Scheme, the WinCC design-slot color mapping
ICC profile International Color Consortium profile describing display colorimetric behavior
WDDM Windows Display Driver Model, the post-Vista driver architecture
HMIRuntime The WinCC VBS object model root, exposing Screens, Tags, and SmartTags
VarPtr VBScript intrinsic that returns the address of a variable; required for API buffer passing

19. Frequently Asked Questions

Does this dim and redden the entire Windows desktop, or only the WinCC Runtime window?

The gamma ramp is applied to the graphics adapter output, so it affects every pixel on the panel - WinCC Runtime, the Windows desktop, the taskbar, every application. This is by design, because the night-shift operator will see a Windows dialog (for example, a credentials prompt) at the same dim red level.

Is SetDeviceGammaRamp officially supported by Microsoft for production use?

Microsoft documents the function in the Windows SDK for video miniport drivers and graphics drivers, but it is not part of the Win32 application API contract. It has worked reliably across Windows 7, 8.1, 10, and 11 on Intel, AMD, and most panel video chips. Some locked-down operator panels reject the call; in that case fall back to the WMI brightness control described in Section 9.

Can I trigger night mode automatically when a photocell reports low ambient light?

Yes. Wire the photocell value to a WinCC tag, and in the tag's Value change event call ApplyNightMode (tagValue < threshold). Use a hysteresis band of 50 lux to avoid flicker at the threshold.

Why does my VBScript error out with "Variable is undefined: VarPtr"?

Your WinCC project is set to a restricted VBScript security level that disables the VarPtr intrinsic. Open the project's VBScript runtime settings and enable it, or switch to the WMI-based approach which does not need a raw pointer.

Will the night mode survive a Windows display driver crash and recovery?

No. A driver crash and recovery reinitializes the adapter to the OS default. To handle this, register a WMI event watcher for WmiMonitorConnectionParams or simply re-trigger NightMode_Init from a 60-second cyclic WinCC scheduler so the backup is refreshed and reapplied.

Does this work on WinCC Runtime Professional, RT Advanced, and Panel PCs the same way?

Yes, in all three runtime variants the VBScript host exposes the HMIRuntime object and supports the Declare statement for gdi32.dll and user32.dll. The only variant-specific difference is the event hook used to call NightMode_Init; the Siemens TIA Portal V21 documentation for WinCC Runtime Advanced objects lists the available display and operating elements and their event hooks for your project version.

Back to blog