TN AG112 Building a Trend and Alarm Symbol - Part 1 - Linking the Data
Description
In this series of articles from InSource we will create a Wonderware ArchestrA Symbol which shows us Trend and Alarm information correlating the two sets of data with one another. In this first article we'll begin by creating a symbol which simply shows the Trends and Alarms at the same time, allowing us to double click on an alarm and bring up that tag in Trend.
- Author: Dillon Perera
- Published: 12/30/2015
- Applies to: InTouch 2014R2
This article is the first in a series:
Part 1: TN AG112 Building a Trend and Alarm Symbol - Part 1 - Linking the Data
Part 2: TN AG113 Building a Trend and Alarm Symbol - Part 2 - Adding DateTime Selection
Details
1. To begin, create a new ArchestrA symbol in the Graphic Toolbox called TrendAndAlarmDisplay. Then open this symbol for editing.
2. From the Embed Graphic icon add the TrendClient and AlarmClient to your Symbol.
3. Double click on the TrendClient1 control and go to the Historical Sources Configuration. Enter in the connection information for your Historian. Note, in this case my Historical Source is given the name "LOCALHOST".
On the Appearance configuration, unselect the Allow highlight pen option.
Click OK.
4. Double click on the AlarmClient1 control and go to the Alarm Mode configuration. Set your Client Mode to Historical Alarms, and point to your Alarm Database. .
In the Other Settings, set the time range to 5 minutes, and select Update to Current Time.
5. Create a Custom Property called SelectedAlarmTag of type String, and make this Private.
6. Double click on the AlarmClient1 control and go to the Event configuration screen. Select the Double Click event. Enter the following script:
'Get the tagname of the currently selected Alarm.
'This will grab the value in the "Name" column.
SelectedAlarmTag = GetSelectedItem("Name");
'Clear all the pens in the TrendClient1 display so we only see one tag.
TrendClient1.ClearPens();
'Add the selected pen to the TrendClient1 display
'The InTouch: will tell it to grab any new/live data directly from InTouch
TrendClient1.AddPen(SelectedAlarmTag,"InTouch:"+SelectedAlarmTag,"Localhost",SelectedAlarmTag,1);
'Scale the display appropriately.
TrendClient1.ScaleAutoAllPens();
7. Once completed save your symbol, and add it to an InTouch Window. Now when you display this Window you will be shown the last 5 minutes of Alarms that have occurred. When you double click on one of these alarms the trend screen will update to show you that tag's history over the last 5 minutes.