Counter retrieval - query example
- Last UpdatedJul 18, 2024
- 1 minute read
To use the counter mode, set the following parameter in your query.
wwRetrievalMode = 'Counter'
In the following example, the rollover value for the SysTimeSec system tag is set to 0. In a two-minute time span, the SysTimeSec tag increments from 0 to 59 two times. The following query returns the total count within the two-minute time span. The QualityDetail of 212 indicates that a counter rollover occurred during the query time range.
select DateTime, TagName, Value, Quality, QualityDetail as QD from History
where TagName = 'systimesec'
and DateTime >= '2009-08-13 1:00'
and DateTime < '2009-08-13 1:02'
and wwRetrievalMode = 'counter'
and wwCycleCount = 1
The results are:
|
DateTime |
TagName |
Value |
Quality |
QD |
|
2009-08-13 01:00:00.0000000 |
SysTimeSec |
120 |
0 |
212 |