TN IT115 Automatically load a Combo Box to select a Historical Trend file and display the Trend in an Archestra Graphic.
Description
This TechNote discusses the following:
-
Automatically look at a specific system directory for Historian Client Trend files.
-
Automatically load an Archestra Combo Box with a list of the files to be selected.
-
Have the ability to select a specific Trend file to be opened.
-
Open the Historical Trend file inside an Archestra Graphic
- Author: Ted Fluehr
- Published: 03/25/2015
- Applies to: Tested on System Platform 2014R2
Details
Make sure you have the Historian Client Trend Control available in the Graphic Toolbox. If not you will need to import using the Galaxy/Import/Client Control from the IDE. You will browse to the install CD to find the control. (E:\InstallFiles\CD-HistorianClients\HistorianClient\Global Assembly Cache\aaHistClientTrendControl.dll)
Create a new Archestra Symbol and insert the Trend Control
Create 2 String Custom Properties (Right Click on the graphic background and select Custom Properties) as shown below. Set the default value of the TrendDir to be the directory where you will host your your .aaTrnd files.
Place a Combo Box on the canvas and configure the Selected Item Value Reference to point to the Custom Property “TrendFile” as shown below.
Create two scripts (Right Click on canvas and select scripts) as shown below. The On Show script will load the Combo Box with all the Trend Files found in the Trend Directory (TrendDir) to be selected by the user.
Create the “UpdateTrend” script as shown below. This script will trigger when the user selects a new Trend File from the Combo Box and open the selected Trend file in the HistClient Trend control.
Place the newly created Archestra Symbol in an InTouch Window and test at runtime. Below shows this new graphic with all the Trend files found in the specified Trend directory loaded into the Combo Box and when selected will then open it's Trend configuration.