Configuring the AVEVA Historian Connection
- Last UpdatedMar 29, 2022
- 4 minute read
You can configure the AVEVA Historian data adapter to connect to the AVEVA Historian Server and retrieve the names of the available source data items. In the context of this data adapter, a data item typically represents a Tag name in the AVEVA Historian. The adapter also allows to define and validate custom queries, as well as to retrieve the Historian tags meta data. The AVEVA Historian adapter retrieves the:
-
Fields and Types for the specified tag based on the tagname. It retrieves tag definitions for analog, string, and discrete type tags.
-
Data for the specified tag depending on the filter string. The filter string can have single or multiple fields.
-
Tag data values for the specified calculation field in measure objects. The aggregates are valid for both analog and discrete tag types.
-
Metadata for all tags. This is done through four source data items available through the Historian data adapter. The four source data items are: All Tags, Analog Tags, Discrete Tags, and String Tags. These source data items are available in the BI Gateway Source Data item Picker under a group called Metadata.
-
Metadata along with the data for the specified custom query.
All Historian analog and state summary tags and tag groups are excluded from the Source Data item Picker.
The maximum number of source data items that is recommended to be used for optimal performance is 25,000. If the data source contains more than 25,000 tags, apply a filter to limit the amount of data items returned.
You must provide the Historian server name to configure the connection information for the Historian. The Historian data adapter uses the Windows authentication mode and the Intelligence Data Adapter Service credentials to connect to the Historian.
The minimum and maximum aggregate calculations are not supported for string tags. However, you can use a custom query to work around this.
The following custom query casts the string value to a decimal if the string value is numeric; otherwise, it sets the value to null. When you use this query, you can perform the minimum and maximum aggregate calculations on the DecimalValueOfSysString field. For more information, see Using Custom Queries to Create Custom Source Data Items.
SELECT TagName, DateTime,
CASE WHEN (ISNumeric(vValue) = 1)
THEN
CAST (vValue as decimal)
ELSE
NULL
END) AS DecimalValueOfSysString
FROM History
WHERE TagName = 'StringUDO_000.TagValue'
AND DateTime >= [[RequestedStartTime]]
AND DateTime < [[RequestedEndTime]]
If you are using a custom query for a Historian data adapter and you are using column aliases, be sure that you either do not create an alias for the DateTime column or, if you use an alias, that you duplicate the DateTime column in the SELECT statement. The DateTime column is a reserved word for the time filtering. For example, if the DateTime column has an alias called "TimeStamp" in the custom query, an error occurs and no measure results are returned. However, the following query, which specifies the duplicate DateTime column, works:
SELECT DateTime AS TimeStamp, DateTime, Tagname AS Tagname, Value AS Value FROM history
WHERE tagname LIKE 'SysTimeHour'
AND DateTime > '10/03/2009 06:30'
AND DateTime < '10/03/2011 08:30'
If you use Historian tag data instead of metadata as a source for dimension data, there is a possibility that the AVEVA Historian returns multiple records with the same date/time and value, but with a differing QualityDetail value. If one or both of these fields (date/time and value) are being used as a key for the dimension, the dimension will not be populated, as the dimension expects the key to be unique. To avoid this, configure date/time, value, and quality detail to be dimension keys. Or, you could use a custom query on the AVEVA Historian data source to filter the data based on the quality detail you expect, so that unwanted duplicate records are not passed to the BI Gateway system.
To configure the AVEVA Historian connection
-
In the Data Adapter Type box, select AVEVA Historian.
-
In the Data Source Configuration section, do the following:

-
In the Data Source time zone list, click the time zone of the database that the external data source system is referencing.
The default time zone is the time zone of your computer. You can select the (UTC) Coordinated Universal Time option if the external data source system being referenced uses UTC for its time fields.
You can click the Automatically adjust time for Daylight Savings check box if the time zone that you select is affected by daylight saving time (DST). For more information, see Time Zone for a Data Source.
-
In the Server name box, type the name of the AVEVA Historian server.
The Authentication box shows the default Windows Authentication mode. The AVEVA Historian data adapter uses the Intelligence Data Adapter Service credentials.
-
In the Tag Name Filter box, type a tag name pattern to limit the number of tags to be retrieved from the AVEVA Historian depending on the filter string. The filter syntax is the same as using the Transact-SQL LIKE comparison operator. For example, to retrieve only the tags starting with "Sys", enter Sys%.
-
-
Click Connect. If the connection succeeds, the Getting schema notification message appears. It can take few minutes to retrieve the schema from the data source. For more information about retrieving the schema, see Retrieve the schema.
-
Click Done and then click Save.
NOTE: For the Historian Data Adapter compatibility with Historian 2012 R2, the Hot Fix CR L00136281 is needed on the Historian Server machine and for compatibility with Historian 2014 P01, the Hot Fix CR L00136283 is required. Contact your distributor or the AVEVA Technical Support to obtain these hot fixes.