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