QUOTE(TWControls @ Nov 17 2008, 07:41 PM) [snapback]75847[/snapback]
The EWEB can update to an internet time server...if it's really time critical it seems like someone makes a GPS module for the Controllogix for just that purpose
You mean this?
http://www.hiprom.com/Pages/Products/1756_.../1756HP-GPS.htmAnother method is IEEE 1588. This is the protocol that CLX uses with it's IO for time stamping data and among other CLX processors (if you use it). At least with Hirschmann Ethernet switches, you can turn this on as well as NTP, which allows the switch itself to directly synchronize to an NTP clock distribution source. Beyond that you have to make the CLX synchronize to the switch. I'm not clear on the details beyond this because I've never done it but as far as I know, you should be able to synchronize to UTC within +/-100 ms. If you figure it out, post it as it will be much more elegant than my solution.
I have all my PC's running NTP and they are all synchronized through the usually chain company-wide to AT&T which gets it's synchronization from NIST. I synchronize all the PLC's every 3 minutes merely by writing the time from a script running in the SCADA system. I'm only accurate to 0-2 seconds at best but it's good enough for what I use it for (zeroing out counters at midnight and such). Most of the PLC's are only PLC-5's which seem to be good only to about 1 second per day at best anyways so I'm providing a far more accurate time service than they have natively. I'm also not slewing or anything fancy like, and I'm updating "wallclocktime", not even considering the peculiarities of daylight savings time, so there is no gaurantee of any sort that monotonicity will exist.
The result is that most of my PLC code looks something like this:
IF hour=midnight THEN (one shot) reset a counter
(note: DON'T do this at 1AM-2AM when daylight savings occurs)
...or...
IF hour<>cached_hour and mins = 1 THEN cached_hour=hour, and (do something once and hour)
(avoid clock jitter at the "top" of an hour)