10/1/2015 8:14 PM | |
Joined: 9/23/2005 Last visit: 9/29/2023 Posts: 4241 Rating:
|
“Simple Samples” are small projects that demonstrate simple features. The target is give a quick overview about the theme and be used as start point for related discussions. Follow there are a short description and the configuration main steps.
Description:
By clicking on a button, information about the button and its parents (e.g. screen) are showed on GSC Diagnostic object. As second option, a similar button could be act by a Picture Window.
Read objects properties (e.g. position) could useful for many proposes, for example dynamic positioning of Picture Windows, related to its call buttons.
Requirements: WinCC Professional V13 SP1.
Project with a minimum configuration (stop button, tags, etc. See reference WinCC Professional V13 SP1 – Simple Sample: printing data for script diagnostics (GSC)”, https://support.industry.siemens.com/tf/br/en/posts/135048/).
Configuration main steps:
Sub OnClick(ByVal item)
Dim aaa Set aaa = ScreenItems.Item("Button_20")
HMIRuntime.Trace " ====================" HMIRuntime.Trace vbNewLine
HMIRuntime.Trace "Data relative to Buton_20 object:" & vbNewLine
HMIRuntime.Trace "name = " &aaa.ObjectName & vbNewLine HMIRuntime.Trace "top = " & aaa.Top & vbNewLine HMIRuntime.Trace "left = " & aaa.Left & vbNewLine HMIRuntime.Trace "hight = " & aaa.Height & vbNewLine HMIRuntime.Trace "width = " & aaa.Width & vbNewLine
HMIRuntime.Trace vbNewLine
HMIRuntime.Trace "Data relative to Buton_20 Parent object:" & vbNewLine
HMIRuntime.Trace "Name = " &aaa.Parent.ObjectName & vbNewLine HMIRuntime.Trace "top = " & aaa.Top & vbNewLine HMIRuntime.Trace "left = " & aaa.Left & vbNewLine HMIRuntime.Trace "hight = " & aaa.Parent.Height & vbNewLine HMIRuntime.Trace "width = " & aaa.Parent.Width & vbNewLine
HMIRuntime.Trace vbNewLine
HMIRuntime.Trace "Data relative to Buton_20 Parent Parent object:" & vbNewLine
HMIRuntime.Trace "Name = " &aaa.Parent.Parent.ObjectName & vbNewLine HMIRuntime.Trace "hight = " & aaa.Parent.Parent.Height & vbNewLine HMIRuntime.Trace "width = " & aaa.Parent.Parent.Width & vbNewLine
HMIRuntime.Trace vbNewLine
HMIRuntime.Trace vbNewLine
HMIRuntime.Trace "Data relative to Buton_20 Parent Parent Parent object:" & vbNewLine
HMIRuntime.Trace "Name = " &aaa.Parent.Parent.Parent.ObjectName & vbNewLine HMIRuntime.Trace "hight = " & aaa.Parent.Parent.Parent.Height & vbNewLine HMIRuntime.Trace "width = " & aaa.Parent.Parent.Parent.Width & vbNewLine
HMIRuntime.Trace vbNewLine
HMIRuntime.Trace " ====================" HMIRuntime.Trace vbNewLine End Sub
Sub OnClick(ByVal item)
Dim aaa Set aaa = ScreenItems.Item("Button_2") HMIRuntime.Trace " ====================" HMIRuntime.Trace vbNewLine
HMIRuntime.Trace "Data relative to Buton_2 object:" & vbNewLine
HMIRuntime.Trace "name = " &aaa.ObjectName & vbNewLine HMIRuntime.Trace "top = " & aaa.Top & vbNewLine HMIRuntime.Trace "left = " & aaa.Left & vbNewLine HMIRuntime.Trace "hight = " & aaa.Height & vbNewLine HMIRuntime.Trace "width = " & aaa.Width & vbNewLine
HMIRuntime.Trace vbNewLine
HMIRuntime.Trace "Data relative to Buton_2 Parent object:" & vbNewLine
HMIRuntime.Trace "Name = " &aaa.Parent.ObjectName & vbNewLine HMIRuntime.Trace "hight = " & aaa.Parent.Height & vbNewLine HMIRuntime.Trace "width = " & aaa.Parent.Width & vbNewLine
HMIRuntime.Trace vbNewLine HMIRuntime.Trace " ====================" HMIRuntime.Trace vbNewLine
End Sub
References: Manual WinCC Professional V13.0 https://support.industry.siemens.com/cs/br/pt/view/92323076/en
Online helps system WinCC Professional V13.0 SP1 https://support.industry.siemens.com/cs/br/pt/view/109096785/en
FAQ Which VBS information and VBS programming tools are there in WinCC (TIA Portal)? https://support.industry.siemens.com/cs/br/pt/view/59885894/en
Tips and tricks for creating scripts in WinCC (TIA Portal) https://support.industry.siemens.com/cs/br/pt/view/57132412/en
Project: project..zip
AttachmentProject.zip (334 Downloads) |
Denilson Pegaia |
|
Follow us on