Scenario 3: Track liquid and gas use with custody meters
- Last UpdatedMar 18, 2021
- 1 minute read
You can use the Counter retrieval feature to keep track of how much liquid or gas a process uses. For example, you could answer questions like:
-
How much syrup was dispensed from Tank 3?
-
How much propane have we used so far this month?
Using Counter Retrieval with Floating Point Counters
Counter retrieval also works with floating point counters, which is useful for flow meter data. Similar to the carton counter, some flow meters report accumulated flow and "roll over" after a certain amount of flow accumulates. For both examples, the need is to convert the accumulating measure to a "delta change" value over a given period. (For an example of totalizing a flow rate, see Scenario 5.)
Example: Tracking Liquid or Gas Volumes with Counter Retrieval
SELECT DateTime, TagName, Value, Quality, QualityDetail AS QD
FROM History
WHERE TagName like 'ReceivedVolume.Counter'
AND DateTime >= '2015-09-01 13:00'
AND DateTime < '2015-09-03 18:00'
AND wwResolution=3600000
AND wwRetrievalMode='counter'
AND wwQualityRule='optimistic'
AND wwTimeStampRule='start'
The results are:
|
DateTime |
TagName |
Value |
Quality |
QD |
|
2015-09-01 13:00:00.0000000 |
ReceivedVolume.Counter |
8965.23345496515 |
0 |
212 |
|
2015-09-01 14:00:00.0000000 |
ReceivedVolume.Counter |
8977.65306903776 |
0 |
212 |
|
2015-09-02 15:00:00.0000000 |
ReceivedVolume.Counter |
8959.81258651845 |
0 |
212 |
|
2015-09-02 16:00:00.0000000 |
ReceivedVolume.Counter |
8990.74717176479 |
0 |
212 |
|
2015-09-03 17:00:00.0000000 |
ReceivedVolume.Counter |
8992.89247964001 |
0 |
212 |