In a group I added a Action Item “timer” which condition set as hour=23, min=59 and sec>=0 and sec<=30
and Group’s Update Rate=30 second. The timer is the trigger item for the group i.e it has to log data every day at 23:59:(0-30) but I am facing some variation of time on data logging at SQL server.
Sometime it log data at 23:58,00:06…
please refer to attached file for variation.
Also, is the database on a different server? How are you getting the time for the trigger? It could be a difference between the clocks of the FactorySQL machine, and the database server. The query that FactorySQL sends to the server will have “t_stamp=CURRENT_TIMESTAMP”, so the time recorded will be the database time. If you’re getting the trigger time with an expression and “now()” (or one of the other similar functions), you’re using the time on the local machine.
If this sounds like your setup, I would recommend logging the local machine time as the timestamp. You can do this easily:
On the group, turn off “store timestamp”
Create an Action Item, set it to “DateTime” datatype, writeback to “t_stamp”, and set its expression to “now()”.
You forgot to mention if the database is on a different machine. I suspect it’s as I described earlier- I recommend turning off “store timestamp” and making your own timestamp item based on “now()” and seeing if that changes things.