Jump to content

Set PLC time from the Internet


Recommended Posts

  • MVP 2023

Has anyone come up with a way to set a Vision PLC clock from the internet? I have a V1210 connected to the Internet and I'd like to keep the clock reasonably accurate. I can go online with it at any time and set it from my PC through VisiLogic, but I need to find a way to automate the process to keep it accurate.

Link to comment
Share on other sites

I did a few, but they work on local NTP server. I guess logic is the same for server on the internet.

You need an UDP socket on port 123 for RFC-1305 function. You can try building it from the example program, if I recall correctly program from the example worked when I tried it out. Also you need to have a logic for daylight savings time.RFC.thumb.PNG.bc1becd83f201fbeffbb715a3ad4b154.PNG 

I attached a snip because rest of subroutine is a mess because I needed to switch a socket to UDP for time update and then back to TCP and that's a lot of gymnastics. If something goes wrong RFC returns 0 and resets the date so that's why there are Lower and Upper limits.

Link to comment
Share on other sites

  • 1 year later...

Hello!

Would like to update this topic. Flex did You manage to get the online time update working from NTP server?

I tried but the answer returned always the same from multiple NTP servers in internet. 7199 in decmal. It would be nice to have the clock updated from for example time.google.com.

Also I noticed that after 2010 I guess, there are new protocols out instead of RFC-1305. Does the RFC-1305 work at all today?

Thanks,

Jan

Link to comment
Share on other sites

I am also very interested! Internal clock of the Vision series doesn't hold the clock accurate for longer period and if You have to log something that is needed to prove something for example, then it is quite annoying when You can't rely on data the PLC has gathered. So - has anyone ideas, how to get the clock update working with online internet NTP server?

Basically You need the IP address of the NTP server, which You can get if You ping the server and then You need UDP and port number 123. Unfortunately for me it didn't work.

Jan

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...