show the entry list
OS - WinCC -- Creating HMI configurations -- Configuring picture changes
What should you watch out for in particular with the "Loop in Alarm" function?
Closing images that the wizard has created upon image change
How can I dynamically adapt the size of the @Top display when I call a picture with the SSMOpenTopField function?
How can you have the current picture continued to be shown when you log out of WinCC Runtime?
What options are there for configuring a picture change between two or more servers and the MultiClient (MC)?
How can you display/hide a layer depending on a variable?
How can you display/hide a layer depending on a variable?
Part number:

Instructions
Depending on the status of a variable, a specific layer of a picture must be shown.

For this you can use the VBS script below, in which you only have to change the picture name, the layer, the variable and its value (for example, in a global VBS script or in a VBS action of an event of a button etc.).

This script functions only if the relevant screen is also open.

Dim Tag
Dim scrObj

Set scrObj = HMIRuntime.Screens("@Screen.@win12:@1001.@Desk:Picture name")
Set Tag = HMIRuntime.Tags("Variable")

Tag.Read

If Tag.Value = 0 Then
    scrObj.Layers(Layer).Visible = False
Else
    scrObj.Layers(layer).Visible = True
End If

Note (taken from the WinCC Online Help)
Upon access, the layers are counted in VBS starting with 1. Thus layer "0" in the WinCC Graphics Designer must be addressed with layers(1).

For example, if you want to address layer 10 in a screen,you must enter 11 for
scrObj.Layers(...).Visible.

If you have opened a screen on anther monitor, you must address it accordingly, "@Screen.@win22:@1001.@Desk:screenname", for example. More information about the addressing of different monitors is available in Entry ID: 831486.

 Entry ID:24074628   Date:2012-02-13 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour