|
|
|
It is currently Sat May 18, 2013 8:37 pm
|
View unanswered posts | View active topics | View unsolved topics
|
Page 1 of 1
|
[ 6 posts ] |
|
| Author |
Message |
|
subodh
Cadet
Joined: Tue Jan 25, 2011 4:25 am Posts: 3
|
 Time Problem
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.
Regards, Subodh
Attachments:
File comment: the time is not fit according to the given condition
log data.xls [25.5 KiB]
Downloaded 84 times
|
| Tue Jan 25, 2011 5:19 am |
|
 |
|
Travis.Cox
Moderator
Joined: Sun Apr 02, 2006 2:46 pm Posts: 1974 Location: Sacramento, CA
|
 Re: Time Problem
What is the exact expression on the timer condition?
_________________ Travis Cox
Inductive Automation
Technical Support Rep.
|
| Tue Jan 25, 2011 9:38 am |
|
 |
|
Colby.Clegg
Moderator
Joined: Sun Apr 02, 2006 3:43 pm Posts: 2162
|
 Re: Time Problem
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: 1) On the group, turn off "store timestamp" 2) Create an Action Item, set it to "DateTime" datatype, writeback to "t_stamp", and set its expression to "now()".
Regards,
_________________ Colby Clegg
Inductive Automation
Software Development
|
| Tue Jan 25, 2011 1:38 pm |
|
 |
|
subodh
Cadet
Joined: Tue Jan 25, 2011 4:25 am Posts: 3
|
 Re: Time Problem
the exact condition for Action item "Timer" is as follow:-
If((ExtractHour(Now())=12 && ExtractMinute(Now())=59 && ExtractSecond(Now())>=0 && ExtractSecond(Now()) <=30),1,0)
and "t_stamp" data is directly dump to the server from factory SQL.
Regards, Subodh
|
| Wed Jan 26, 2011 9:29 pm |
|
 |
|
Colby.Clegg
Moderator
Joined: Sun Apr 02, 2006 3:43 pm Posts: 2162
|
 Re: Time Problem
Hello,
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.
Regards,
_________________ Colby Clegg
Inductive Automation
Software Development
|
| Thu Jan 27, 2011 6:44 am |
|
 |
|
subodh
Cadet
Joined: Tue Jan 25, 2011 4:25 am Posts: 3
|
 Re: Time Problem
After creating my own action item for date time (t_stamp) on group the problem of time mismatch has solved .... Thanks for ur help..........
Regards, Subodh Pradhan
|
| Tue Feb 01, 2011 8:47 pm |
|
 |
|
|
Page 1 of 1
|
[ 6 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 1 guest |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|