Syncing Gateway clock to PLC clock

#1

Hi Guys, for some weird reason the PLC that we use to get all the data for Ignition keeps drifting off about a second every day or two.
What I figured was try to sync the gateway time to the PLC time manually so I created tags for day, month, hour, etc. using expression language. I also selected the write value back to PLC item, picked the currect OPC server and correct item path for each tag.
I made a scan class with a driven mode that basically one shot executed every time my minute tag hits zero. I used this scan class with my 5 time tags.
Am I missing something here? shouldn’t these tag values write back to the PLC clock bits once an hour on the zeroth minute?
I’m sure there are other tools that can be used but I figured I try to get it done through the designer so I can have my PLC clock and gateway clocked synced.

using 7.8.2 Ignition PLC is AB Logix 5572

Thanks

0 Likes

#2

For CompactLogix you’ll need to write to the WALLCLOCKTIME module.

An underutilized feature of Logix5000 is the Sample Programs folder. If you used the default directories when you installed it it will be in [b]C:\RSLogix 5000\Projects\Samples\ENU{version of your choice}\Rockwell Automation[/b].

The sample file you want is Add_On_Instruction_Samples.ACD. Take a peek at the T_Clock AOI, which not only reads the clock, it can also set the clock at a time of day. You can modify the AOI logic to fit your needs. :thumb_left:

There’s a bunch of other useful AOIs in there, too.

0 Likes

#3

You can also set up a linux server as a Precision Time Protocol grand master clock, which is the underlying protocol Logix processors use when you enable “Time Synchronization”. If the linux server’s ethernet ports support hardware timestamps (pretty much all the major server NICs do), the server and the PLC will synchronize to within a few microseconds. Yes, microseconds. The linuxptp package and its daemons are what you need.

1 Like

#4

[quote=“JordanCClark”]For CompactLogix you’ll need to write to the WALLCLOCKTIME module.

An underutilized feature of Logix5000 is the Sample Programs folder. If you used the default directories when you installed it it will be in [b]C:\RSLogix 5000\Projects\Samples\ENU{version of your choice}\Rockwell Automation[/b].

The sample file you want is Add_On_Instruction_Samples.ACD. Take a peek at the T_Clock AOI, which not only reads the clock, it can also set the clock at a time of day. You can modify the AOI logic to fit your needs. :thumb_left:

There’s a bunch of other useful AOIs in there, too.[/quote]
Very Interesting Jordan, I didn’t know about those AIOs , I talked to the controls guy I work with and brought it up to his attention. I’m fairly new in the world of PLC since I never went for school for it and trying to learn it on my own slowly.
As far as my issue we were finally able to fix it, what happened was on the PLC side the hour, minute and second values weren’t being passed to the PLC clock values.

0 Likes

#5

Thank you for the suggestion Phil, I talked to the IT guy I work with and he said we can certainly do something like that. trying to explore other options for now. He was even thinking of just switching to linux for the OS of the VM Ignition runs on. What you think of that?

0 Likes

#6

[quote=“Mr.K001”]He was even thinking of just switching to linux for the OS of the VM Ignition runs on. What you think of that?[/quote]If I supply and will support server hardware or OS, I supply Ubuntu Server. If a customer wants any other OS, I install and support just Ignition itself.

0 Likes

#7

can you give me some pros and cons on using Linux over Windows? I personally haven’t really messed around with Linux as much as I should.

0 Likes

#8

[quote=“Mr.K001”]can you give me some pros and cons on using Linux over Windows?[/quote]Talk about an open-ended question! And disputed by many, too. Let’s just say that I’m a control freak, and Linux lets me control every aspect of my computing environment that interests me. You can google for more. Let me know when you run into the end of the internet. :open_mouth: [quote=“Mr.K001”] I personally haven’t really messed around with Linux as much as I should.[/quote]I strongly suggest you not deploy a production system on Linux without being comfortable with it. At least get comfortable with server installs, first.

1 Like

#9

[quote=“pturmel”]Talk about an open-ended question! And disputed by many, too. Let’s just say that I’m a control freak, and Linux lets me control every aspect of my computing environment that interests me. You can google for more. Let me know when you run into the end of the internet. :open_mouth: [/quote]Haha yeah that question was ridiculous :mrgreen:

[quote=“pturmel”]I strongly suggest you not deploy a production system on Linux without being comfortable with it. At least get comfortable with server installs, first.[/quote]As far as dealing with Linux, IT would deal with all that. I would only deal with Ignition related stuff, if IT is comfortable with it then sure, if they’re not then definitely not.

0 Likes

#10

Hey everyone. Just going to bring this back from the dead real quick haha.

How are you writing to the WALLCLOCKTIME module in the PLC? I can’t seem to find an OPC item path for that to add to the tag browser, unless this isn’t the correct approach. My thought is to monitor the “Sts_UpdateReqd” tag from the T_Clock AOI mentioned above, then write the values of some expression tags with the current time in Ignition to the PLC’s respective tags.

Thanks!

0 Likes

#11

You can’t just write to it, other than from RSLogix5000. But you can write to it with ladder logic using the SSV instruction.

1 Like

#12

Ah, that makes sense. Thanks!

0 Likes