Classic event subsystem variables
- Last UpdatedFeb 27, 2025
- 1 minute read
The Classic Event subsystem uses a set of variables to facilitate event detections and actions. The purpose of these variables is to provide ease of query creation by a user (or a configuration editor). These variables are replaced with the associated values by the event components immediately before actual query execution. The query actually being received by the AVEVA Historian never contains the variables.
The variables and their associated values are as follows:
|
Variable |
Description/Associated Value |
|---|---|
|
@EventTime |
Date/time of the detected event of the current detector. |
|
@EventTagName |
Tagname associated with the detected event. |
|
@StartTime |
Start date/time for the detector query. |
|
@EndTime |
End date/time for the detector query. |
The @StartTime and @EndTime variables can be used only in detector strings. The @EventTime and @EventTagName variables can be used only in action strings.
All of the variables are case-sensitive.
Typically, a detection query executed by a detector component is similar to the following example:
SELECT DateTime
FROM History
WHERE Tagname = 'BoilerPressure' AND Value > 75
AND DateTime > '@StartTime'
AND DateTime < '@EndTime'
@StartTime and @EndTime are simply placeholders for the detector component to coordinate event detection over a moving time range.
The following action query show how event variables can be used:
SELECT * INTO TEMPTABLE
FROM History
WHERE DateTime = '@EventTime'
AND TagName IN
(SELECT TagName FROM SnapshotTag
WHERE EventTagName = '@EventTagName'
AND TagType = 1)
Note: These variables only function in the internal context of the Classic Event subsystem and do not apply to queries from client tools such as SQL Server Query Analyzer.