Troubleshooting
Troubleshooting SNTP clock sync on a Windows CE panel
Short answer
A Windows CE panel that loads the time service but never sets the clock is failing on the hostname: put a numeric NTP server address in the server value and run the refresh against NTP0:. A one-hour offset is the AutoDST daylight-saving setting, and a six-minute residual is an update that had not been applied yet — the clock was correct to the minute after the next refresh.
On this page
On a Windows CE panel where the time service loads but the clock never moves, the first fault is the hostname in the server value: a pool name completed no exchange at all, while a numeric NTP address answered at once. Read the rest as two separate faults. A one-hour offset is the daylight-saving setting, not the server, and a six-minute residual is an update the panel had not applied yet — the clock read correct to the minute the following morning. NTP carries its timestamps over UDP port 123, so the gateway and that port are part of the fix. If you would rather not run a time client on the panel at all, setting the HMI clock time from PC and PLC daily is the working alternative.
What the loaded service proves #
The time client lives under HKEY_LOCAL_MACHINE\Services\TIMESVC, backed by timesvc.dll. Here it was installed by copying sntp.reg to /InternalStorage over FTP and letting Autoexec.bat load it at boot. Three checks routinely get confused with success:
- Entries present in the live registry after boot prove the file imported.
Services.exe listshowingtimesvc.dllproves the service loaded."Prefix"="NTP"together with"Index"=dword:00000000registers the instanceNTP0:, the target your refresh command must name.
None of the three proves a time exchange. Run all of them on the booted panel, then issue Services.exe refresh NTP0: and judge the outcome from the clock or from captured traffic.
Replace the hostname with a numeric address #
A hostname forces a DNS lookup before the time client can send one packet; a numeric address goes straight on the wire. That is the difference between the two attempts: "server"="0.de.pool.ntp.org" produced no synchronization, "server"="192.53.103.108" produced a clock response, and the final configuration ran "server"="134.130.5.17". The two tests also reached different servers, so they do not prove the panel can never use a name — they prove you commission with a number.
| What you observe | What it separates | Next check |
|---|---|---|
| Hostname produces nothing, a numeric address works | Name resolution, or a different endpoint | Resolve the name from the panel's own subnet and test the address it returns |
| Neither form produces an exchange | Routing, filtering, or server availability | Capture traffic while a refresh runs |
| The exchange works, the displayed time is wrong | Local-time conversion | Compare a trusted UTC reading with the panel clock and its zone |
Get the exchange working against a numeric address first. Putting the name back afterwards is a DNS question, not a time-service question.
Open the path for UDP port 123 #
NTP exchanges its timestamps as UDP datagrams on port 123, and in client/server mode the panel initiates. An internet server therefore needs the panel's address, subnet mask, gateway and DNS to match the connected network. During a refresh, a capture should show the request leave and a reply return; a request with no reply points at the route, a filter or the chosen server, and none of that is fixed in the registry.
The time source can also stay inside the controls network: an S7-1500 acting as the SNTP server for PLC-to-PLC time synchronization removes the internet dependency. On the controller side of the same job, PTP, SNTP and NTP clock sync methods on Allen-Bradley controllers cover the equivalent transport choices.
The working value set, in hexadecimal #
The configuration that ended up synchronizing carried these values:
[HKEY_LOCAL_MACHINE\Services\TIMESVC]
"server"="134.130.5.17"
"AutoUpdate"=dword:1
"ServerRole"=dword:0
"refresh"=dword:927C0
"recoveryrefresh"=dword:57E40
"threshold"=dword:5265C00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Clock]
"SyncEnable"=dword:00000001
"ShowDSTUI"=dword:00000001
"AutoDST"=dword:00000001
Registry-file dword: entries are hexadecimal, so entering 927C0 as decimal writes a number several times smaller than intended. Worked example, refresh:
0x927C0 = 9×65,536 + 2×4,096 + 7×256 + 12×16 + 0×1
= 589,824 + 8,192 + 1,792 + 192 + 0
= 600,000
The same arithmetic gives recoveryrefresh dword:57E40 = 360,000 and threshold dword:5265C00 = 86,400,000, while the first file carried refresh dword:05265C00 = 86,400,000 and recoveryrefresh dword:000493E0 = 300,000. Read them as milliseconds: 300,000 is 5 minutes, 360,000 is 6 minutes, 600,000 is 10 minutes, and 86,400,000 is exactly one day — round wall-clock values that only make sense as milliseconds. What each entry controls is defined in the panel's Windows CE documentation; the arithmetic here is only the conversion.
Do not merge blindly, though. Keep the registration entries from the first file — "Dll"="timesvc.dll", "Order"=dword:00000099, "Keep"=dword:00000001, "Prefix"="NTP", "Index"=dword:00000000, plus "Clientonly", "Trustlocalclock", "Flags", "UserProcGroup" and "Context" — because the block above is a value set, not a service registration. Save a copy of the registry and of Autoexec.bat before the first edit; that copy is what makes a mistyped dword recoverable.
The one-hour offset is AutoDST, not the server #
Network time arrives referenced to UTC, and the panel builds local time from its time zone plus, when enabled, its daylight-saving adjustment — no server address removes a whole-hour error. The reading once the numeric address worked was 1 h 6 min — 66 minutes. With AutoDST moved to dword:00000001 and a daylight-time startup call added to Autoexec.bat, 66 - 60 = 6: the daylight adjustment accounts for the hour exactly, and what remains is not an hour problem. The "DefaultLCID" and "LCID" entries at dword:00000809 set regional display formats, not the time zone.
Close this fault out with three readings that must agree: a trusted UTC reference, the panel's system clock, and the HMI application's display. If the application applies its own daylight shift on top of the operating system's, you will chase an hour that keeps moving.
The six-minute residual and the fix sequence #
Six minutes is not a daylight number; it means the correction had not been applied when the clock was read. The following morning the panel was correct to the minute after one more refresh — the behavior to wait for before digging deeper. The residual matters because everything downstream believes the panel: scheduling the PLC by day of week from the HMI clock inherits the error, and so do alarm and audit timestamps.
Work the fault in this order:
- Hostname in
server, no exchange: replace it with a numeric address, refresh, and confirm the exchange on the wire. - Exchange works, error is whole hours: fix the time zone and
AutoDSTon the panel; leave the server alone. - Exchange works, error is minutes: rerun the refresh, capture the exchange, and re-check after one refresh interval before changing anything else.
- Neither address form works: fix routing and filtering with a capture before touching a clock setting.
Questions asked
A ping to the time server succeeds. Does that prove the panel can sync?
No. Ping is ICMP; the time exchange runs on UDP port 123, and a network can pass one while filtering the other. A ping reply proves routing to that address and nothing about the time service. Capture traffic while a refresh runs: an outgoing request with no reply points at filtering, the route or the server, not at the panel's configuration.
Services.exe refresh NTP0: prints nothing in the console. Did it run?
Treat silence as normal, not as an error code. The command triggers a synchronization attempt and reports no result in the console, so the evidence lands in the clock and in captured traffic. Read the panel clock against a trusted reference, or watch the exchange on the wire. Note also that Services.exe list reports the service's presence, not the outcome of its last exchange.
The clock is off by exactly one hour now that the address works. Is the server sending the wrong time?
No. The server supplies UTC and the panel builds local time from its time zone and daylight-saving setting, so a whole-hour error after a working exchange is local conversion, not server data. In the observed case AutoDST moved from dword:00000000 to dword:00000001 with a startup call to Start Daylight Time.exe; confirm that executable's exact filename and argument syntax on your OS image before copying the line, because spacing and punctuation matter in a batch file.
Are the dword values in the registry file decimal?
They are hexadecimal. dword:927C0 is 600,000 decimal and dword:57E40 is 360,000, so typing those digit strings as decimal writes numbers several times too small. A registry editor can display values in either base, so check its display mode before comparing what you read on the panel with what the file contains, and keep the service registration entries from the original file alongside the tuned values.
Why keep entries like Clientonly and Trustlocalclock from the first file?
Because the working block is a value set, not a service registration. Entries such as Dll, Prefix, Index, Order and Keep are what let the OS load timesvc.dll and expose it as NTP0: for the refresh command, while the client-only and process settings control how it runs. Tuned values with no registered service behind them do nothing, so merge the new values into the full registration instead of replacing it.