<!-- Softwell WinCC VBScript 20-Part Tutorial · Blog 11 · updated 2026-08-29 --> WinCC VBScript Screen Navigation, Faceplates and Reusable Instances | Softwell
WinCC VBScript · Navigation · Faceplate Guide

WinCC VBScript Screen Navigation, Faceplates and Reusable Instances

Create consistent screen navigation and reusable motor, pump or valve detail views with validated equipment context and maintainable tag mapping.

Guide Overview

Supporting WinCC VBS GuideStudy time: 70 minutesDifficulty: Intermediate-Advanced

What You Will Design

  • Consistent picture, popup and faceplate navigation
  • Approved equipment-identifier and tag-prefix mapping
  • Reusable motor, pump or valve detail instances

Learning Foundation: Reusable HMI Navigation

This page has one defined job in the WinCC VBScript learning path. Master this foundation before using the same concept inside larger SCADA, SQL Server and reporting scripts.

IntermediateWinCC Explorer / Classic WinCCSQF Running Project
Prerequisite

Graphics object control, tag mapping and reusable procedures.

Core concept

Navigation must preserve equipment context. Reusable popups/faceplates should receive approved identifiers rather than duplicate screen logic for each asset.

SQF practical connection

Open one reusable SQF equipment popup and pass SQF_No/equipment context for tags and commands.

Expected competency

Build maintainable picture changes, popups and reusable equipment views with explicit context mapping.

WinCC VBScript Screen Navigation, Faceplates and Reusable Instances — ArchitectureCode-rendered HTML/CSS architecture; no image file required
Equipment Select

Operator selects asset

SQF_No
Context

Store/validate identifier

SelectedSQF
Navigation

Open picture/popup

ActivateScreen
Reusable View

Bind context to instance

Faceplate / Popup
Operate / Monitor

Use mapped tags safely

Status + Commands

Complete WinCC VBScript Learning Path

Use Previous/Next for the recommended practical order, or open any topic below as a reference.

WinCC VB Scripting Training →
Easy Testing Method: Every main code example on this page is followed by a copy-ready InputBox + MsgBox test. Use the dialog version first to understand the result, then move to the original WinCC/SQL code. Database writes and equipment commands are previewed or simulated unless the original example is already intended as a lab action.

WinCC VBScript screen navigation, faceplates and reusable instances

Learn how to open contextual detail views, pass approved equipment identity and reuse one screen design across several motors, pumps or valves.

Compatibility: Picture-window, popup and parameter-transfer APIs vary across WinCC Classic, Professional and TIA-based editions. WinCC Unified uses JavaScript. Verify navigation calls and object properties in the installed Siemens help.

1. Define the navigation architecture before scripting

Start with a screen map showing overview pictures, area displays, equipment details, modal dialogs and the path back to a known location. A script should implement this model rather than inventing navigation independently inside every button.

  • Use consistent Home, Back, Area and Close behavior.
  • Keep the current equipment identity visible in every detail view.
  • Avoid opening multiple uncontrolled copies of the same popup.

2. Choose between a full picture, picture window and popup

Display typeSuitable useDesign caution
Full pictureArea or process navigationPreserve orientation and return path
Picture windowEmbedded equipment detailManage instance context explicitly
Popup or dialogFocused diagnostics or parameter entryControl modality, position and duplicate instances
FaceplateStandardized equipment operationDefine a stable interface and version

3. Pass equipment context through an approved identifier

Instead of concatenating arbitrary operator input into tag names, map a known equipment identifier to an approved tag prefix.

Function ResolveMotorPrefix(ByVal equipmentId)
    Select Case CStr(equipmentId)
        Case "M101": ResolveMotorPrefix = "Plant1_M101"
        Case "M102": ResolveMotorPrefix = "Plant1_M102"
        Case "M103": ResolveMotorPrefix = "Plant1_M103"
        Case Else:   ResolveMotorPrefix = ""
    End Select
End Function

Easy TestEasy Test 1 — InputBox + MsgBox

A self-contained function test using the same setpoint/actual-value pattern as the SQF project.

Function TestIsOK(ByVal SetValue, ByVal ActualValue)
    TestIsOK = (ActualValue >= SetValue)
End Function

Dim SP, PV
SP = CDbl(InputBox("Enter Setpoint", "Easy Test 1 — InputBox + MsgBox", "850"))
PV = CDbl(InputBox("Enter Actual Value", "Easy Test 1 — InputBox + MsgBox", "825"))

MsgBox "Setpoint = " & SP & vbCrLf & _
       "Actual = " & PV & vbCrLf & _
       "Function Result = " & TestIsOK(SP, PV), _
       vbInformation, "Function Quick Test"

An allowlist prevents malformed names and makes the supported instances visible during review.

4. Prepare a reusable equipment context

Sub SelectEquipment(ByVal equipmentId)
    Dim prefix
    prefix = ResolveMotorPrefix(equipmentId)

    If prefix = "" Then
        HMIRuntime.Trace "Unknown equipment: " & CStr(equipmentId) & vbCrLf
        Exit Sub
    End If

    HMIRuntime.Tags("UI_SelectedEquipment").Write CStr(equipmentId)
    HMIRuntime.Tags("UI_SelectedPrefix").Write prefix
End Sub

Easy TestEasy Test 2 — InputBox + MsgBox

Write is simulated to avoid accidental equipment commands during beginner testing.

Dim TestValue
TestValue = InputBox("Enter value to test for WinCC tag: UI_SelectedEquipment", "Easy Test 2 — InputBox + MsgBox", "1")
If TestValue = "" Then
    MsgBox "Test cancelled.", vbInformation, "Tag Write Quick Test"
Else
    MsgBox "SIMULATION ONLY" & vbCrLf & _
           "Tag: UI_SelectedEquipment" & vbCrLf & _
           "Value that would be written: " & TestValue & vbCrLf & vbCrLf & _
           "After checking interlocks, use the original .Write code above in Runtime.", _
           vbInformation, "Tag Write Quick Test"
End If

Internal context tags are one possible pattern. Faceplate interfaces or picture-window properties may provide a cleaner supported mechanism in the installed release.

5. Bind the detail view consistently

The reusable view should read its approved context once, validate it and then bind captions, states and commands through a documented interface.

  • Display the equipment identifier and description prominently.
  • Use separate feedback and command tags.
  • Show unavailable or bad-quality states explicitly.
  • Reset stale context when the view closes.

6. Open the supported picture or popup

Use the documented WinCC function for the deployed edition. Keep the navigation request in one reusable function so version-specific calls are not duplicated throughout the project.

Sub OpenMotorDetail(ByVal equipmentId)
    Call SelectEquipment(equipmentId)

    'Call the supported picture-window or popup method here.
    HMIRuntime.Trace "Motor detail requested: " & _
        CStr(equipmentId) & vbCrLf
End Sub

Easy TestEasy Test 3 — InputBox + MsgBox

Self-contained procedure test; no PLC or SQL Server is required.

Sub ShowSQFValue(ByVal NameText, ByVal ValueText)
    MsgBox NameText & " = " & ValueText, vbInformation, "Sub Quick Test"
End Sub

Dim TempAct
TempAct = InputBox("Enter Temp_Act", "Easy Test 3 — InputBox + MsgBox", "825.5")
Call ShowSQFValue("Temp_Act", TempAct)

7. Design multi-instance faceplate commands safely

A reusable faceplate should submit a request for the selected instance, not write directly to an arbitrary constructed tag.

  1. Resolve the selected instance against the approved equipment map.
  2. Verify the current view still represents that instance.
  3. Apply WinCC authorization and operator confirmation where required.
  4. Write the request to the documented interface.
  5. Display the PLC acknowledgment or rejection reason.

8. Prevent stale context and navigation faults

Failure modePrevention or diagnostic
Wrong motor details shownDisplay and trace the resolved identifier and prefix
Old popup context remainsInitialize context on open and clear it on close
Duplicate popupsCheck instance state before opening another
Object required errorConfirm active picture, window and exact object name
Navigation loop or dead endTest every entry, close and return path

9. Commission the reusable instance design

  • Test every approved equipment identifier.
  • Attempt an unknown identifier and confirm it is rejected.
  • Change screens rapidly and verify context does not cross between instances.
  • Test communication loss, user logout and PLC command rejection.
  • Document the faceplate interface, tag map and version.

10. Example: one motor faceplate for three conveyors

An overview contains motors M101, M102 and M103. Selecting a motor resolves its approved prefix, updates the internal context and opens the same motor-detail view. The faceplate displays feedback, mode and fault information for that instance while command requests still pass through PLC validation.

Frequently asked questions

Should tag names be built directly from operator input?

No. Resolve a selected equipment identifier through an approved map or supported faceplate interface.

Why use one reusable faceplate?

It provides consistent behavior and reduces duplicated screens, but it also requires disciplined context validation and version control.

Can the popup method be copied between all WinCC editions?

No. Navigation and popup APIs vary. Verify the exact method in the installed product documentation.

Get the WinCC VB Scripting syllabus

Request practical online, classroom or corporate training details.

SQF Running Project Lab · Blog 11

Carry SQF context into a detail popup

Dim SQFNo, Charge
SQFNo = HMIRuntime.Tags("SQF_No").Read
Charge = CStr(HMIRuntime.Tags("ChargeNo").Read)

HMIRuntime.Trace "Open SQF detail: " & SQFNo & _
                 " / Charge " & Charge & vbCrLf

Easy TestEasy Test 4 — InputBox + MsgBox

Offline tag simulation: useful before connecting the participant PC to WinCC Runtime.

Dim TestValue, ResultText
ResultText = ""
TestValue = InputBox("Enter simulated value for SQF_No", "Easy Test 4 — InputBox + MsgBox", "TEST")
ResultText = ResultText & "SQF_No = " & TestValue & vbCrLf
TestValue = InputBox("Enter simulated value for ChargeNo", "Easy Test 4 — InputBox + MsgBox", "TEST")
ResultText = ResultText & "ChargeNo = " & TestValue & vbCrLf
MsgBox ResultText & vbCrLf & "Now compare these values with the original HMIRuntime .Read example.", vbInformation, "Tag Read Quick Test"
Use consistent SQF/Charge context when navigating overview, detail, history and report screens.

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