How to Set Up PC/IPC as NTP Server

How to Set Up PC/IPC as NTP Server

Recently, a client reached out to DMC looking to improve their part traceability and simplify their future maintenance. Specifically, their Cognex camera timestamps were not synchronized with their Beckhoff IPC. This had the potential to cause traceability issues (inability to correlate a specific part to a specific picture) as well as make it more difficult for operators to determine where issues were occurring.

After trying different methods to solve this problem, I eventually realized that the simplest way was to set up an NTP server on the Beckhoff controller. When setting up the NTP server, I realized that this blog is fully transferable to setting up an NTP server on any PC/IPC, because the IPC is running a full version of Windows.

Below, I have laid out this process in Windows 10Note: this should only be marginally different in older versions of Windows.

How to Set up an NTP Server

  1. Unblock UDP port 123 bidirectionally
    1. Why port 123?
      1. NTP implementations send/receive timestamps using port 123
    2. Remote into PC/IPC
      1. Typically, if you are networked to the PC/IPC, the easiest way to do this is to RDP into the PC/IPC. Alternatively, you can hook up a monitor and mouse to your PC/IPC.
    3. Navigate to Windows Firewall
    4. Click Inbound Rules
      1. Inbound Rules
    5. Click New Rule
    6. Click Port
      1. New Inbound Rule Wizard Rule Type‚Äč
    7. Click Next
    8. Select UDP
    9. In Specific Local Ports: type 123
      1. New Inbound Rule Wizard Protocol and Ports
    10. Click Next
    11. Select Allow the Connection
      1. New Inbound Rule Wizard Allow the Connection
    12. Click Next
    13. Set up when the rule applies. For example, if you do not want the IPC to act as an NTP server when on a public network, you can deselect “Public.”
      1. New Inbound Rule Wizard Domain Private Public
    14. Add a name and finish
      1. Name and FInish
  2. Note: it is important that we do the same thing for an outbound rule. Jump back to step C above and click Outbound Rules > New Rule
  3. Registry key change
    1. Update NTP service (W32Time) to be Automatic
      1. Hit the Windows key and type in “services” in the bottom left search bar
        1. Best match Services App
      2. Navigate to the Windows Time service and change the startup type to Automatic
        1. Services (Local)
      3. Click OK and exit the application
    2. Check the registry to verify the service is enabled
      1. Navigate to the Registry Editor
        1. Navigate to the Registry Editor
      2. Navigate to: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer
      3. Go to Enabled
        1. Change Value data to "1"
          1. Enabled
    3. Command line update
      1. Open the command prompt as administrator and run w32tm /config /update
        1. Command Line Update
          1. Note: if the service has not been started, be sure to start the Windows Time service
      2. To verify this is working, open command prompt as administrator and run w32tm /query /configuration 
        1. Time Providers

Done! Now you can point your other devices at the PC/IPC IP address which will function as an NTP server.

Learn more about DMC’s expertise in Beckhoff programming and contact us today for your next project.


There are currently no comments, be the first to post one.

Post a comment

Name (required)

Email (required)

Enter the code shown above:

Related Blog Posts