WinCC Explorer · VBScript · Practical Tutorial

Control WinCC Graphics Designer Objects with VBScript

Use WinCC VBScript to control screen objects, colors, visibility, text, picture windows and navigation through HMIRuntime.

Lab Overview

WinCC VBS Lab 3Estimated time: 75 minutesDifficulty: Intermediate

Prerequisites / What You’ll Need

  • Backed-up WinCC Explorer test project
  • Graphics Designer and Global Script VBS access
  • Internal test tags and Runtime diagnostics

Control WinCC Graphics Designer Objects with VBScript

This lab targets wincc graphics designer vbscript with copy-ready examples, expected results and diagnostic guidance.

Safety: Test on internal tags or an approved simulation system. Do not bypass PLC permissives, interlocks, user authorization or plant change control.

1. Access Screen Items through HMIRuntime

WinCC exposes the active picture and its configured objects through HMIRuntime.ActiveScreen.ScreenItems. Use the exact configured object name, not the visible caption.

Dim statusText
Set statusText = HMIRuntime.ActiveScreen.ScreenItems("txtMotorStatus")
statusText.Text = "RUNNING"
Set statusText = Nothing

2. Control Visibility and Operator Feedback

Dim warningObject
Dim alarmTag

Set alarmTag = HMIRuntime.Tags("Demo_AlarmActive")
alarmTag.Read
Set warningObject = HMIRuntime.ActiveScreen.ScreenItems("grpAlarmWarning")
warningObject.Visible = CBool(alarmTag.Value)

Set warningObject = Nothing
Set alarmTag = Nothing

Use standard dynamics for simple visibility or color changes when possible. Use VBS when several objects or conditions must be coordinated.

3. Change Colors without Hiding Meaning

Keep the plant HMI color standard authoritative. Do not rely on color alone; combine it with text, symbol shape or state. Test default, invalid-quality and communication-loss states as well as normal process states.

4. Navigate Pictures and Picture Windows

Use the WinCC functions and object model available in the installed release. Picture-window object names, properties and navigation functions can differ by project architecture, so validate examples in the installed WinCC V8.1 help before deployment.

5. Graphics Script Troubleshooting

ProblemAction
Object requiredConfirm the picture is active and the configured object name is exact
Property does not changeCheck whether another dynamic or script overwrites the same property
Screen becomes slowReplace frequently evaluated VBS with standard dynamics or a slower trigger

Hands-On Verification Lab

Hands-on
1

Prepare a controlled test

Create only the internal tags, folders or disposable database rows required by this tutorial.

The test scope is isolated and documented.
2

Run the smallest example

Execute one operation and inspect WinCC diagnostics before expanding the script.

The expected value, file, object or database result appears once.
3

Test a failure path

Use a safe backup copy to test an invalid tag, path or disposable input.

The script records a useful error and cleans up without an uncontrolled action.

Frequently Asked Questions

Should this WinCC VBScript be tested in production?

No. Use a backed-up training or staging project and follow the plant change-control process.

Which WinCC versions does the example target?

The examples target classic WinCC Explorer V7.x/V8.x. Verify object properties, action signatures and providers in the installed WinCC help.

How should Runtime failures be diagnosed?

Use scoped Err checks, WinCC object diagnostics and HMIRuntime.Trace while recording the exact station, trigger, tag and Runtime identity.

Get the WinCC VB Scripting syllabus

Share your details and a Softwell advisor will contact you with training options.

Build reliable WinCC VBScript projects

Join practical online, classroom or corporate training.

Request Course Details
Verified learning pathway

Discuss WinCC VB Scripting Training

Explore practical WinCC VBS, SCADA, SQL reporting and industrial automation training options.

Content reviewed: 4 August 2026

☎ Call WhatsApp ✉ Email Enquire Now