11/11/2020 8:32 PM | |
Joined: 9/23/2005 Last visit: 8/13/2024 Posts: 4347 Rating:
|
Simple Sample” are small projects that demonstrate simple features. The target is giving 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, trends are showed, hide, color changed and represents different tags by script commands. Requirements: WinCC Unified V16 up3. Project with a minimum configuration (stop button, tags, etc.). Configuration main steps:
For Hide the first trend: System funcition SetPropertyValue, Screen_object_type = Trend control 1; Screen Object Properety name = TrendArea[0].Trends[0].Visible; Value = 0 For Show the first trend System funcition SetPropertyValue, Screen_object_type = Trend control 1; Screen Object Properety name = TrendArea[0].Trends[0].Visible; Value = 1 To set the 2nd trend to represents the logged variable HMI_Tag_2: System funcition SetPropertyValue, Screen_object_type = Trend control 1; Screen Object Properety name = TrendArea[0].Trends[0].DataSouceY.Source; Value = log variable name (in our example, HMI_Tag_2:LogggiingTag_2 To set the first trend to be showed in red System funcition SetPropertyValue, Screen_object_type = Trend control 1; Screen Object Properety name = TrendAreas[0].Trends[1].LineColor; Value = 255,0,0 TIP: You can get the right properties name clicking inside it with the right mouse button and choosing “Copy property name” option For more complex application you can start with a system function and change it to JavaScript References: FAQ SIMATIC WinCC Unified - Tips and Tricks for Scripting (JavaScript) Project: attached as project.zip AttachmentProject.zip (918 Downloads) |
Denilson Pegaia |
|
This contribution was helpful to
3 thankful Users |
11/12/2020 5:34 PM | |
Joined: 9/23/2005 Last visit: 8/13/2024 Posts: 4347 Rating:
|
Hi, here there is a second example, where, by script, the properties of the trend is changed form other screen. I suggest take a look at the open related for FAQ for script, in special chapter 5.4 For Hide the first trend: Screen.FindItem('./Screen window_1/Trend control_1').TrendAreas[0].Trends[0].Visible = 0; For Show the first trend Screen.FindItem('./Screen window_1/Trend control_1').TrendAreas[0].Trends[0].Visible = 1; To set the 2nd trend to represents the logged variable HMI_Tag_2: Screen.FindItem('./Screen window_1/Trend control_1').TrendAreas[0].Trends[1].DataSourceY.Source = "HMI_Tag_2:LoggingTag_2"; To set the first trend to be showed in red Screen.FindItem('./Screen window_1/Trend control_1').TrendAreas[0].Trends[1].LineColor = HMIRuntime.Math.RGB(255, 0, 0, 255); AttachmentProject (2).zip (839 Downloads) |
Denilson Pegaia |
|
This contribution was helpful to
5 thankful Users |
Follow us on