10/29/2016 1:50 PM | |
Joined: 9/23/2005 Last visit: 4/21/2025 Posts: 4406 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: In this simple sample, points are plotted on trend view object by scripting. Requirements: WinCC Professional V13 SP1. Project with a minimum configuration (stop button, tags, etc.). Configuration main steps: X Y Trend by scripting (without tags):
Trend 1: name = MyTrend1, Data source = User defined tag Trend 2: name = MyTrend2, Data source = User defined tag
Sub OnClick(ByVal item) ' f(x) trend view_1 Dim IngFactor Dim dblAxisX Dim dblAxisY Dim objTrendControl Dim objTrend1 Dim objTrend2 Set objTrendControl = ScreenItems("f(x) trend view_1") Set objTrend1 = objTrendControl.GetTrend("MyTrend1") Set objTrend2 = objTrendControl.GetTrend("MyTrend2") ‘ploting by formula For IngFactor = -100 To 100 dblAxisX = CDbl(IngFactor *0.02) dblAxisY = CDbl(dblAxisX*dblAxisX+2*dblAxisX +1) objTrend1.InsertData dblAxisX, dblAxisY Next ‘ploting direct points - rectangle dblAxisX = CDbl(0) dblAxisY = CDbl(2) objTrend2.InsertData dblAxisX, dblAxisY dblAxisX = CDbl(2) dblAxisY = CDbl(2) objTrend2.InsertData dblAxisX, dblAxisY dblAxisX = CDbl(2) dblAxisY = CDbl(6) objTrend2.InsertData dblAxisX, dblAxisY dblAxisX = CDbl(0) dblAxisY = CDbl(6) objTrend2.InsertData dblAxisX, dblAxisY dblAxisX = CDbl(0) dblAxisY = CDbl(2) objTrend2.InsertData dblAxisX, dblAxisY End Sub AttachmentProject2 a.zip (318 Downloads) |
Denilson Pegaia |
|
This contribution was helpful to
2 thankful Users |
10/26/2017 8:56 PM | |
Posts: 8 Rating:
|
Hi Sorry, how can I assign trends type user defined from process tag using vbcript in f(t) trend view |
Follow us on