ProcessValues for time defining dimension
- Last UpdatedFeb 09, 2024
- 3 minute read
This Azure function custom query returns the process values for the time defining definitions (TDD). The custom query expression supports the following parameters:
|
Parameter Name |
Parameter Choice |
Example |
Description |
|---|---|---|---|
|
QueryName |
Required |
TDDProcessValues |
Azure function query name |
|
SelectColumn |
Optional |
["*"] Or ["FQN","OpcQuality","Text","Value", |
Option to pick required properties from AVEVA Insight. Note: The previous record of same FQN’s DateTime is considered as current record StartTime, and current record DateTime is considered as Endtime. |
|
DistinctColumn |
Required |
["FQN","OpcQuality","Text","Value","StartTime","EndTime"] |
Option to pick distinct properties from AVEVA Insight |
|
Tag |
Optional |
{ "Filter": "startswith(Location,'/Lake')", "Select": ["FQN"] } |
The Tag expression is used to apply a filter on the tags. The Filter parameter is used to apply a filter on the tags. The Select parameter is used to specify the property name that could be used in the tag filter. If extended property is used in the filter, then it is must to specify in the select. |
|
StartDateTime |
Optional |
"[RequestedStartTime]" |
Any valid UTC date time value. To leverage [RequestedStartTime] parameter for populating a time defining dimension, you must enable incremental update feature for the dimension. For more information, see Configure an incremental update for a dimension. |
|
EndDateTime |
Optional |
"[RequestedEndTime]" |
Any valid UTC date time value. To leverage [RequestedEndTime] parameter for populating a time defining dimension, you must enable incremental update feature for dimension. For more information, see Configure an incremental update for a dimension. |
|
RetrievalMode |
Optional |
|
Retrieval mode of the query Note: For Deadband queries, use the Delta retrieval mode. |
|
Resolution |
Required* |
3000 |
A valid numeric value in milliseconds. This value is required for Cyclic Retrieval mode. |
|
TimeDeadband** |
Optional |
5000 |
A time deadband for retrieval controls the time resolution of data returned in delta mode. Any value changes that occur within the time deadband are not returned. Value is in milliseconds. For more information about TimeDeadband, see the AVEVA Historian Retrieval Guide. You can download the guide from AVEVA Knowledge & Support Center. |
|
ValueDeadband** |
Optional |
10 |
A value deadband for retrieval controls the value resolution of data returned in delta mode. Any data values that change less than the specified value deadband are not returned. The value deadband is a percentage of a tag’s full scale in engineering units. For more information about ValueDeadband, see the AVEVA Historian Retrieval Guide. You can download the guide from AVEVA Knowledge & Support Center. |
|
Expression |
Optional |
"UOM(hl/min)" or "UOM([t/h])" |
Any valid Engineering Unit. This is used to convert the destination Engineering Unit. Ensure that you use the Tag parameter in the query to support the Engineering Unit conversion. For more information about Engineering Units, see the AVEVA Insight Online Help. |
*The Resolution parameter is not required for the Deadband queries.
**Only the TDDProcessValues query supports the TimeDeadband and ValueDeadband parameters.
Note: If you use the Tag Extended Property (TEP) in the Filter expression, you must use the same in the SelectColumn list. The Tag Extended Property is applicable for only Online Insight queries. For more information about the Tag Extended Property, see the AVEVA Insight Help.
Data Transformation for TDDProcessValues
The TDD Dimension requires StartDateTime and EndDateTime. However, the AVEVA Insight ProcessValues endpoint returns the following data, which does not comprise of the pre-defined StartDateTime and EndDateTime.
|
FQN |
DateTime |
OpcQuality |
Value |
Text |
|---|---|---|---|---|
|
Weather.Los Angeles.Temperature |
2020-01-06T07:25:19.216486Z |
192 |
104 |
104 |
|
Weather.Los Angeles.Temperature |
2020-01-06T07:45:00.010240Z |
192 |
105 |
105 |
|
Weather.Los Angeles.Temperature |
2020-01-06T08:00:01.087106Z |
0 |
105.2 |
105.2 |
|
Weather.Los Angeles.Humidity |
2020-01-06T08:00:01.087106Z |
192 |
70 |
70 |
|
Weather.Los Angeles.Temperature |
2020-01-06T08:05:36.228415Z |
192 |
105.5 |
105.5 |
|
Weather.Los Angeles.Temperature |
2020-01-06T08:10:11.864521Z |
0 |
105.6 |
105.6 |
|
Weather.Los Angeles.Temperature |
2020-01-06T08:25:45.341932Z |
192 |
106 |
106 |
|
Weather.Los Angeles.Humidity |
2020-01-06T08:25:45.341932Z |
192 |
72 |
72 |
The AVEVA Insight Adapter processes the data returned by the ProcessValues endpoint. The processing is based on the rule that the timestamp of the current record of the same FQN is considered as the previous record's end time (EndDateTime field from the table below), and the previous record's timestamp is considered as the current record's start time (StartDateTime field from the table below). For example, the data shown in the above table is processed by the AVEVA Insight Adapter and is returned as follows.
|
FQN |
StartDateTime |
EndDateTime |
OpcQuality |
Value |
Text |
|---|---|---|---|---|---|
|
Weather.Los Angeles.Temperature |
2020-01-06T07:25:19.216486Z |
2020-01-06T07:45:00.010240Z |
192 |
104 |
104 |
|
Weather.Los Angeles.Temperature |
2020-01-06T07:45:00.010240Z |
2020-01-06T08:05:36.228415Z |
192 |
105 |
105 |
|
Weather.Los Angeles.Temperature |
2020-01-06T08:00:01.087106Z |
0 |
105.2 |
105.2 |
|
|
Weather.Los Angeles.Temperature |
2020-01-06T08:05:36.228415Z |
2020-01-06T08:25:45.341932Z |
192 |
105.5 |
105.5 |
|
Weather.Los Angeles.Temperature |
2020-01-06T08:10:11.864521Z |
0 |
105.6 |
105.6 |
|
|
Weather.Los Angeles.Temperature |
2020-01-06T08:25:45.341932Z |
9998-12-31 23:59:59.00 |
192 |
106 |
106 |
|
Weather.Los Angeles.Humidity |
2020-01-06T08:00:01.087106Z |
2020-01-06T08:25:45.341932Z |
192 |
70 |
70 |
|
Weather.Los Angeles.Humidity |
2020-01-06T08:25:45.341932Z |
9998-12-31 23:59:59.00 |
192 |
72 |
72 |
Note:
- Only the records with the "OpcQuality" value as "192" are considered for processing.
- AVEVA Insight Azure function considers “9998-12-31 23:59:59.00” as the value for
the future EndDateTime. This record reflects the current value/state of the tagname.