How to automatically synchronize the time and date for several logic machines? - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: How to automatically synchronize the time and date for several logic machines? (/showthread.php?tid=4823) Pages:
1
2
|
How to automatically synchronize the time and date for several logic machines? - richard7 - 09.06.2023 Dear Admin, I have a puzzle that how to automatically synchronize the time and date of several logic machines which connected with one PC (no internet connection), and PC is the time master. Just like the function by clicking the "get from system" button that is in the "utilities / date and time" tab " but not manually, just automatically? For example, this function can be executed every day or every week, automatically do synchronize time and date with the connected PC. Thanks a lot for your time. Richard RE: How to automatically synchronize the time and date for several logic machines? - admin - 09.06.2023 You need to run NTP server on your PC and modify LM NTP client settings to use PC IP as the only NTP server. RE: How to automatically synchronize the time and date for several logic machines? - richard7 - 09.06.2023 I will try it tomorrow. Thanks a lot for quite quick reply! RE: How to automatically synchronize the time and date for several logic machines? - richard7 - 14.06.2023 I have set the PC as NTP server according to the guideline from internet. And I also modify LM NTP client setting to PC( NTP server ) IP. After several days, I think no synchronization happens (almost 3 minutes ahead the PC) Could you please take a look the picture if I have set it correctly? Thanks a lot. RE: How to automatically synchronize the time and date for several logic machines? - Daniel - 14.06.2023 Just one is enough, you can also disable the local server. RE: How to automatically synchronize the time and date for several logic machines? - admin - 14.06.2023 Also check that PC firewall allows connections to UDP port 123. RE: How to automatically synchronize the time and date for several logic machines? - richard7 - 14.06.2023 Thanks for tips...Very good person! I will try later... RE: How to automatically synchronize the time and date for several logic machines? - rw_echo - 20.06.2023 Admin, I also encountered the same issue. When my PC was used as the NTP clock master, the closed-loop test result was successfully configured. However, when I used the resident script to test LM's system time, it could not synchronize with the PC. I still need your further guidance. Thank you in advance. RE: How to automatically synchronize the time and date for several logic machines? - admin - 21.06.2023 Run this script (replace NTP_SERVER_IP with your PC IP address) and check what you get in Logs: Code: res = io.readproc('ntpd -dnq -p NTP_SERVER_IP 2>&1') RE: How to automatically synchronize the time and date for several logic machines? - rw_echo - 21.06.2023 * string: ntpd: sending query to 192.168.1.111 ntpd: reply from 192.168.1.111: offset:+448.553434 delay:0.000789 status:0x1c strat:1 refid:0x4c434f4c rootdelay:0.000000 reach:0x01 ntpd: sending query to 192.168.1.111 ntpd: reply from 192.168.1.111: offset:+448.553471 delay:0.000577 status:0x1c strat:1 refid:0x4c434f4c rootdelay:0.000000 reach:0x03 ntpd: sending query to 192.168.1.111 ntpd: reply from 192.168.1.111: offset:+448.553626 delay:0.000724 status:0x1c strat:1 refid:0x4c434f4c rootdelay:0.000000 reach:0x07 ntpd: sending query to 192.168.1.111 ntpd: reply from 192.168.1.111: offset:+448.553639 delay:0.000583 status:0x1c strat:1 refid:0x4c434f4c rootdelay:0.000000 reach:0x0f ntpd: sending query to 192.168.1.111 ntpd: reply from 192.168.1.111: offset:+448.553741 delay:0.000637 status:0x1c strat:1 refid:0x4c434f4c rootdelay:0.000000 reach:0x1f ntpd: sending query to 192.168.1.111 ntpd: reply from 192.168.1.111: offset:+448.555087 delay:0.000696 status:0x1c strat:1 refid:0x4c434f4c rootdelay:0.000000 reach:0x3f RE: How to automatically synchronize the time and date for several logic machines? - admin - 21.06.2023 Looks correct. What settings do you have in System config > Services > NTP client/server? Which LM firmware is installed? RE: How to automatically synchronize the time and date for several logic machines? - rw_echo - 21.06.2023 (21.06.2023, 12:55)admin Wrote: Looks correct. What settings do you have in System config > Services > NTP client/server? Which LM firmware is installed? RE: How to automatically synchronize the time and date for several logic machines? - admin - 21.06.2023 Save the NTP configuration again. This will restart the NTP client process. See if time gets in sync then. RE: How to automatically synchronize the time and date for several logic machines? - rw_echo - 21.06.2023 I just completed the operation, but it doesn't solve the problem. RE: How to automatically synchronize the time and date for several logic machines? - admin - 21.06.2023 Run the script again with these parameters and post what you get: Code: res = io.readproc('ntpd -ddd -nq -p NTP_SERVER_IP 2>&1') RE: How to automatically synchronize the time and date for several logic machines? - rw_echo - 21.06.2023 PC time : 21:29:54, d:+00.0003551s o:+00.0000926s [ * ] 21:29:56, d:+00.0004180s o:+00.0001298s [ * ] log(res): * string: ntpd: sending query to 192.168.1.111 ntpd: reply from 192.168.1.111: offset:+446.428452 delay:0.000660 status:0x1c strat:1 refid:0x4c434f4c rootdelay:0.000000 reach:0x01 ntpd: sending query to 192.168.1.111 ntpd: reply from 192.168.1.111: offset:+446.428629 delay:0.000772 status:0x1c strat:1 refid:0x4c434f4c rootdelay:0.000000 reach:0x03 ntpd: sending query to 192.168.1.111 ntpd: reply from 192.168.1.111: offset:+446.428681 delay:0.000722 status:0x1c strat:1 refid:0x4c434f4c rootdelay:0.000000 reach:0x07 ntpd: sending query to 192.168.1.111 ntpd: reply from 192.168.1.111: offset:+446.428711 delay:0.000705 status:0x1c strat:1 refid:0x4c434f4c rootdelay:0.000000 reach:0x0f ntpd: sending query to 192.168.1.111 ntpd: reply from 192.168.1.111: offset:+446.429952 delay:0.000687 status:0x1c strat:1 refid:0x4c434f4c rootdelay:0.000000 reach:0x1f RE: How to automatically synchronize the time and date for several logic machines? - admin - 21.06.2023 Check this: https://groups.google.com/g/comp.protocols.time.ntp/c/qMpIb29KPpE/m/JucH2PIHxHEJ RE: How to automatically synchronize the time and date for several logic machines? - richard7 - 23.06.2023 Dear Admin, Above HTTPS link can NOT be opened. Could you please send a new one? My test result is similar to rw_echo . Attached screen shot for you refer. Thank. Richard RE: How to automatically synchronize the time and date for several logic machines? - admin - 23.06.2023 You need to set the LocalClockDispersion parameter to 0 in Windows. The default value is 10 which is too big for the clock source to be considered precise. So the time from such NTP server is ignored by the NTP client. RE: How to automatically synchronize the time and date for several logic machines? - richard7 - 23.06.2023 Dear Admin, I have set the LocalClockDispersion parameter to 0 in Windows(with regedit). Then, I changed the clock of PC, for example, from 16:31 to 15:31. 10 minutes later, nothing happen, the LM5 still run the clock with itself pace. What is the frequency of NTP synchronization? every munite or every hour? Thanks. Richard |