This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

How to automatically synchronize the time and date for several logic machines?
#1
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
Reply
#2
You need to run NTP server on your PC and modify LM NTP client settings to use PC IP as the only NTP server.
Reply
#3
I will try it tomorrow.
Thanks a lot for quite quick reply!
Reply
#4
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.

Attached Files Thumbnail(s)
   
Reply
#5
Just one is enough, you can also disable the local server.
------------------------------
Ctrl+F5
Reply
#6
Also check that PC firewall allows connections to UDP port 123.
Reply
#7
Thanks for tips...Very good person! I will try later...
Reply
#8
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.

Attached Files Thumbnail(s)
   
Reply
#9
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')
log(res)
Reply
#10
* 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
Reply
#11
Looks correct. What settings do you have in System config > Services > NTP client/server? Which LM firmware is installed?
Reply
#12
(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?

Attached Files Thumbnail(s)
       
Reply
#13
Save the NTP configuration again. This will restart the NTP client process. See if time gets in sync then.
Reply
#14
I just completed the operation, but it doesn't solve the problem.
Reply
#15
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')
log(res)
Reply
#16
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
Reply
#17
Check this: https://groups.google.com/g/comp.protoco...cH2PIHxHEJ
Reply
#18
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

Attached Files Thumbnail(s)
   
Reply
#19
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.
Reply
#20
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

Attached Files Thumbnail(s)
   
Reply


Forum Jump: