WinCC Picture Windows

Gaynor

Member
Join Date
Oct 2011
Location
Bath
Posts
2
Hi there...this is a Siemens WinCC SCADA question, rather than PLC.
By clicking on object on the base page I want to open a picture window. Within that picture window there are 2 other picture windows (let's call them pw2 and pw3)

I need to pass the name of the object as a tag prefix to both pw2 and pw3.
I am really struggling. Not that knowledgeable about VB!

Can anyone help?

Thank you
 
Here is an example of one I made earlier that sets a tag prefix. The objWindow.picturename = "PictureName" line is important to refresh the window. Bear in mind that you can't set the tag prefix until after the picture has been loaded, you will have to set the tag prefix using the "On Load" event of the parent picture.

Nick

Code:
Sub OnObjectChanged(ByVal Item)  
Dim Page, objTag, i, MyValue, myString
Dim objScreen, objWindow
i=1
Set objTag= HMIRuntime.Tags("iStepPage")
objTag.Read
Page = objTag.Value
If Page <1 Then
    Page =1
End If
If Page >7 Then
    Page =7
End If
myValue = ((page-1) *10) + i
myString = "Text_Step_"&CStr(myValue)
Set objScreen = HMIRuntime.Screens("RecipeInProduction")
Set objWindow = objscreen.ScreenItems("PictureWindow"&CStr(i))
objWindow.tagprefix = myString
objWindow.picturename = "A_Step"


Set objTag = Nothing
Set objWindow = Nothing
Set objScreen=Nothing

End Sub
 
It was quite late in the evening when I posted that reply, the first part is associated with building the string that will become the tagprefix. Maybe the code below is a little less scary.

Code:
Dim objScreen, objWindow

Set objScreen = HMIRuntime.Screens("ScreenName")
Set objWindow = objscreen.ScreenItems("PictureWindowName")
objWindow.tagprefix = "TagPrefix"
objWindow.picturename = "PictureName"

Set objWindow = Nothing
Set objScreen=Nothing
P.S. Don't forget to set your objects to "Nothing" when you've finished with them.

Nick
 

Similar Topics

Hi all, I am using WinCC V7.0 I have created some menus and toolbars in WinCC Explorer and now need to bring them to life. I have a starting...
Replies
0
Views
3,913
Dear colleagues I am trying to load a project from the multi-project in wincc. I will tell you about the procedure that I've done I've...
Replies
0
Views
5,243
Hello community, There is next issue connected with executing script in the picture window. It doesn't depend on code , it depends on the...
Replies
20
Views
15,206
Hello everybody! I'm doing dynamically change of graphic object pictures by action script in the WinCC 7.0. And it works only in the chain...
Replies
1
Views
2,668
Hi All I am busy with a project where additions are to be made to an existing WinCC v 7.2 Single user project. I managed to get the project...
Replies
2
Views
2,133
Back
Top Bottom