MVP 2023 Flex727 Posted May 12, 2019 MVP 2023 Report Share Posted May 12, 2019 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 More sharing options...
Cam Posted May 13, 2019 Report Share Posted May 13, 2019 I seem to remember that the Visions have a FB for a NTP server. RCF is the block you want I think. Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted May 13, 2019 MVP 2023 Report Share Posted May 13, 2019 Please try to find RFC-1305 in help. Maybe is useful https://lastminuteengineers.com/esp32-ntp-server-date-time-tutorial/ Link to comment Share on other sites More sharing options...
Isakovic Posted May 13, 2019 Report Share Posted May 13, 2019 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. 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 More sharing options...
MVP 2023 Flex727 Posted May 13, 2019 Author MVP 2023 Report Share Posted May 13, 2019 Thank you! Link to comment Share on other sites More sharing options...
Jan N Posted March 30, 2021 Report Share Posted March 30, 2021 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 More sharing options...
MVP 2023 Flex727 Posted March 30, 2021 Author MVP 2023 Report Share Posted March 30, 2021 No, the requirement changed and I never made the attempt. Still interested as an intellectual matter though. Link to comment Share on other sites More sharing options...
Jan N Posted March 31, 2021 Report Share Posted March 31, 2021 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 More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now