Leading edge detection for analog tags
- Last UpdatedFeb 06, 2025
- 1 minute read
If Leading is specified as the parameter in the edge detection time domain extension, the only rows in the result set are those that are the first to successfully meet the WHERE clause criteria (returned true) after a row did not successfully meet the WHERE clause criteria (returned false).
The following query selects the first values of "SysTimeSec" from the History table to meet the Value criterion between 10:00 and 10:02 a.m. on December 2, 2001.
SELECT DateTime, Value
FROM History
WHERE TagName = 'SysTimeSec'
AND DateTime >= '2001-12-02 10:00:00'
AND DateTime <= '2001-12-02 10:02:00'
AND wwRetrievalMode = 'Cyclic'
AND wwResolution = 2000
AND Value >= 50
AND wwEdgeDetection = 'Leading'
The query will return only the two values that were greater than or equal to 50 for the time period specified:
|
DateTime |
Value |
|---|---|
|
2001-12-02 10:00:50.000 |
50 |
|
2001-12-02 10:01:50.000 |
50 |
Compare these results with the same query using no edge detection, as shown in Edge detection for analog tags. Notice that even though the original query returned ten rows, the edge detection only returns the first row recorded after the event criteria returned true.