Hour meter reset

To Quote Colby.Clegg [quote]Items in groups can actually be “Hour Meters”, which are pretty much what you want. You take your on/off tag, set its data type to float (or int), and set it to be an hourmeter “on 1”. While the tag is 1, it will accumulate value (the group can run at any rate). When it goes to 0, it will reset or not, depending on whether it’s “retentive”. With 7.5, there’s an additional option for when to reset the value. So, instead of logging history and calculating a sum, you could have hourmeters set up to record to the last row of a table. If you want to really get tricky, have the group set up as “bi-dir, db wins”. Then, you can just insert a new row with 0s in the columns to reset the values and start over (for shifts, or per day, for example).[/quote]

I am using SQL Server 2008.
I tried using “Minute change triggers” to insert new rows but I wasn’t as accurate as I needed to be since my SUM(times) was ±3 minutes because some of the groups were not resetting properly.
I believe I need to be using the bi dir db wins and simply inserting new rows every 1 minute without even using a trigger.
The problem is, my default values are not 0, they are NULL.
I would really prefer to create the table using Ignition as well because I may not be able to enter the management studio and change the default value although even when I did this for the columns setting the default values to 0 they were still inserting NULLs into my columns.
What is the most accurate method I can use to log hour meter minutes and sum them for each hour? I am running Ignition 7.6.2

It seems like the way I have it set up is working best.
I took a gateway timer script on 1 minute intervals to write a 1 to my triggers.
Then I have the retentive hour meters and the values to reset on trigger = 0
The group speed is 200ms and I unclicked “execute group once on trigger” so I won’t miss any logs.
The handshake resets the trigger.

I have seen this work logging individual minutes into the database around .995 minutes per minute. Not perfect but I can round the totals at least.

It sounds like you have it worked out well. One thing I wanted to mention is that setting the column’s default value in the table definition is the best way to guarantee the column values are 0. If an insert happens, any columns without explicit values will use their defaults.