Skip to Main Content
Cognex Support Hub
LogoLogo

How to Configure a Local PC to be Used as an NTP Server

Step-by-step guide to enabling a local PC to be an NTP server for time services

09/15/2024

Details

Question

How can I set up a computer I have on my network to act as a NTP server for time synchronization?

Answer

  1. First, ask your local IT if they have an available NTP (Network Time Protocol) server and if they do, what is the server's IP address. If one is available you may wish to consider simply using it instead.
  2. If no NTP server is available, a PC can be configured as an NTP server on the network for the local network. Choose a PC that is never turned off or falls asleep (restarts due to updates are fine).
  3. Open up regedit (search from start menu).
  4. Navigate the tree to the following location: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\Config
  5. Right click on "AnnounceFlags" (on the right) and choose "Modify".
  6. Enter the number 5 in the box, and click "OK". Decimal/hexademical doesn't matter for this.
  7. Right click on "LocalClockDispersion", and choose "Modify". Set it to 0.
  8. Next, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\TimeProviders\NtpServer
  9. Right click on "Enabled", and again choose "Modify". Set it to 1, and again decimal/hexadecimal doesn't matter here.
  10. Open up command prompt as administrator. An easy way to do this is to do the start menu search, type in "cmd", and then right-click, choose "Run as Administrator".
  11. Enter in "net stop w32time && net start w32time" and press enter.
  12. Confirm above is working by doing "w32tm /stripchart /computer:[your-ip-address]" in in a command prompt (CMD). Below is an example of an NTP server that is online: 

    placeholder

    NOTES: NTP servers require port 123 for UDP to be unblocked. If the server appears to be up but date does not update, try unchecking Enable NTP and re-enabling it (Step 6 above).

  13. If you are configuring a DataMan reader to use this NTP Server: 

    placeholder
  14. Connect to the camera using the DataMan Setup tool application and go to the system tab.
  15. Expand the System Settings menu and select Device Time Settings.
  16. Choose the desired Time Zone.
  17. Check the box for Enable NTP.
  18. Enter the IP Address of the NTP server.

    NOTE: It may be necessary to power cycle the camera before it will start accurately report time.
     

Loading component...