Set Gateway time to match PLC time

I need to set a CompactLogix as the master time server, but I need to update the Ignition gateway to match that time. How can I go about doing this?

Point them both to the same NTP server?
Many companies have their own internal NTP servers.

1 Like

Unfortunately, they don't have an NTP server yet. It will be available later so they have requested to set the PLC as time master for now

You'll have to use system.util.execute to shell out and execute some command that can sync the time on whatever OS your Ignition Gateway is running on, assuming there is one.

Would it maybe be smarter/easier to have the Ignition server act as the time master? IIRC CompactLogix has quite a bit of clock drift.

For the Compact Logix, if you pass the date time as a 7 numbers (Year, Month, Day, Hour, Minute, Sec, uSec) you can do a single Set System Value instruction to set the UTC clock value.

You could set up a gateway scheduled script to shove the time to the PLC at midnight every night.

3 Likes

I do this for several AB PLCs and works fine.
Otherwise you must purchase a card to get time from NTP. Sadly a very basic thing is not so basic in an AB PLC.
Newer models may be able to do some trickery using TCP/Sockets.

1 Like

Simply not true.

All ControlLogix and CompactLogix models since firmware 13 or so can synchronize to a Precision Time Protocol (IEEE 1588) multicast source without any other hardware. Just turn on clock synchronization in the controller properties. (Also have the CPU make "Time Sync" connections to any chassis network cards, for older ControlLogix.)

Rockwell pitched a third party card to provide this for a long time, but many other, much cheaper, devices can be hung on your network to do this. I recommend the Time Machines TM2000B, fwiw. One of those will synchronize every Logix system on a subnet to within single-digit microseconds of UTC via GPS.

Linux systems can use a PTP daemon to participate, too, though the above device also offers NTP to the systems that cannot do the higher-precision PTP.

(IEEE 1588 is a critical part of the suite of technologies now called "Time Sensitive Networking" in audio and video distribution. Rockwell was an early adopter, as NTP doesn't provide servo-loop-quality time sync.)

3 Likes

Correct, that is required for cip motion/safety synchronization and is generally used for that.
A general NTP sync is what I was talking about. It isn't a "native" feature unless you write the code in the PLC to use TCP/Sockets to get the time from an NTP server, or there may be an addon instruction now for it. Otherwise, you would need to write to the WallClock from some other source that is sync'd to an NTP or have some intermediary device like you said.

Personally, if my only requirement was to make sure my real time clock was synced to other devices in my plant, including PCs and servers, I would want to use NTP or write to the WallClock from a source that is sync'd to an NTP that the rest of the plant uses.
I had not heard of that Time Machine device, thanks for the info.

We use TimeMachines as well as they're inexpensive for what they do. But there is an NTP AOI that Rockwell provides that's flexible to also adjust for DST and gives sync status back on successful or not. I have started dropping it into most every program I write now just in case, and if you have a domain controller, you can point the PLC to one of the DCs and it will grab time off of it.

1 Like

How accurate is PTP when not using switches that support PTP to modify the PTP packets to adjust the time for the switch processing delays? In theory this should be minimal, but when talking microseconds, it's probably measurable. (If you really need that accurate of time keeping - which not all industries/systems need that accurate)

If the switches do not make intelligent adjustments, the accuracy degrades from sub-microsecond to single-digit microseconds. I assume stupid switches, which is why I stated that latter above.

I have a daily gateway script that re-syncs all PLCs to the Ignition gateway's time. Much easier than trying to mess with the PC settings