ValueState retrieval query 3
- Last UpdatedFeb 06, 2025
- 1 minute read
The following query finds the maximum time-in-state for the SteamValve discrete tag in the same time period as in Query 1. Note how both the minimum and maximum values for the "1" state are very similar, while they are very different for the "0" state. This is due to the "cut-off" effect.
SELECT DateTime, TagName, vValue, StateTime, wwStateCalc FROM History
WHERE TagName IN ('SteamValve')
AND DateTime >= '2005-04-17 10:00:00'
AND DateTime <= '2005-04-17 10:05:00'
AND wwCycleCount = 1
AND wwRetrievalMode = 'ValueState'
AND wwStateCalc = 'Max'
The results are:
|
DateTime |
TagName |
vValue |
StateTime |
wwStateCalc |
|---|---|---|---|---|
|
2005-04-17 10:00:00.000 |
SteamValve |
0 |
107514.0 |
MAXIMUM |
|
2005-04-17 10:00:00.000 |
SteamValve |
1 |
43750.0 |
MAXIMUM |
|
2005-04-17 10:05:00.000 |
SteamValve |
0 |
107514.0 |
MAXIMUM |
|
2005-04-17 10:05:00.000 |
SteamValve |
1 |
43750.0 |
MAXIMUM |