Opinion of correct historical storage settings

I have a group of utility flow meters that totalize flow during the day and reset everyday at 00:01.
Each meter’s “total tag” is set to record it’s accumulated value once per hour. I set the historical to periodic with a 1 hour sample and a 2 hour max between samples.

Question 1 is will that “1 hour” sample be when “minutes = :00” or from when the gateway is activated?

I then am hoping to extract the data onto a report table showing the value from each hour with the last sample at midnight being the total for the day.

I don’t see anyway to query for a specific time to be able to pull the data at each hour? With a standard tag query using transaction groups I have access to much more to extract the data. Any ideas on the correct way to do this?

Hi Keith,

When the sample rate is set to 1 hour, it will log data every hour the moment you apply that setting to your tag.

For example, if you configured a tag history with the sample rate of 1 hour and hit the apply button at 1:04PM then at 2:04PM the data will be logged to your database.
As you have stated, using a transaction group would be more efficient and has more control over the specific time since a tag history cannot do that.

Here is the documentation for the tag history and transaction group configuration.
https://docs.inductiveautomation.com/display/DOC81/Configuring+Tag+History
https://docs.inductiveautomation.com/display/DOC81/Understanding+Transaction+Groups#UnderstandingTransactionGroups-TriggerSettings

Another option is to use Gateway Event Scripts.

These are created on the gateway. The scheduling is in the “cron” format used by Unix/Linux but the default is ‘Once per hour’ which is exactly what you want.

In the scripts section you can use system.tag.readBlocking to retrieve the tag values and then write them to your data table. This is very clean and gives you excellent control on saving your data ‘just the way you like it’!

Links:
https://docs.inductiveautomation.com/display/DOC81/Gateway+Event+Scripts

https://docs.inductiveautomation.com/display/DOC81/system.tag.readBlocking

Thank you for the reply.
In this instance a Gateway script sounds like it will be perfect.