1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
6 <meta name="generator" content="HTML Tidy, see www.w3.org">
7 <title>NTP PARSE clock data formats</title>
8 <link href="scripts/style.css" type="text/css" rel="stylesheet">
12 <h3>NTP PARSE clock data formats</h3>
13 <p>The parse driver currently supports several clocks with different query mechanisms. In order for you to find a sample that might be similar to a clock you might want to integrate into parse i'll sum up the major features of the clocks (this information is distributed in the parse/clk_*.c and ntpd/refclock_parse.c files).</p>
15 <h4>Meinberg clocks</h4>
17 Meinberg: start=<STX>, end=<ETX>, sync on start
18 pattern="\2D: . . ;T: ;U: . . ; \3"
19 pattern="\2 . . ; ; : : ; \3"
20 pattern="\2 . . ; ; : : ; : ; ; . . "
22 <p>Meinberg is a German manufacturer of time code receivers. Those clocks have a pretty common output format in the stock version. In order to support NTP Meinberg was so kind to produce some special versions of the firmware for the use with NTP. So, if you are going to use a Meinberg clock please ask whether there is a special Uni Erlangen version. You can reach <a href="http://www.meinberg.de/">Meinberg</a> via the Web. Information can also be ordered via eMail from <a href="mailto:%20info@meinberg.de">info@meinberg.de</a></p>
23 <p>General characteristics:<br>
24 Meinberg clocks primarily output pulse per second and a describing ASCII string. This string can be produced in two modes. either upon the reception of a question mark or every second. NTP uses the latter mechanism. The DCF77 variants have a pretty good relationship between RS232 time code and the PPS signal while the GPS receiver has no fixed timeing between the datagram and the pulse (you need to use PPS with GPS!) on DCF77 you might get away without the PPS signal.</p>
25 <p>The preferred tty setting for Meinberg is:</p>
27 CFLAG (B9600|CS7|PARENB|CREAD|HUPCL)
28 IFLAG (IGNBRK|IGNPAR|ISTRIP)
32 <p>The tty setting for Meinberg GPS 166/167 receivers is:</p>
34 CFLAG (B19200|CS8|PARENB|CREAD|HUPCL)
35 IFLAG (IGNBRK|IGNPAR|ISTRIP)
39 <p>The clock is run at datagram once per second. Stock dataformat is:</p>
41 <STX>D:<dd>.<mm>.<yy>;T:<w>;U:<hh>:<mm>:<ss>;<S><F><D><A><ETX>
42 pos: 0 00 00 0 00 0 11 111 1 111 12 2 22 2 22 2 2 2 3 3 3
43 1 23 45 6 78 9 01 234 5 678 90 1 23 4 56 7 8 9 0 1 2
45 <STX> = '\002' ASCII start of text
46 <ETX> = '\003' ASCII end of text
47 <dd>,<mm>,<yy> = day, month, year(2 digits!!)
48 <w> = day of week (sunday= 0)
49 <hh>,<mm>,<ss> = hour, minute, second
50 <S> = '#' if never synced since powerup else ' ' for DCF U/A 31
51 '#' if not PZF sychronisation available else ' ' for PZF 535
52 <F> = '*' if time comes from internal quartz else ' '
53 <D> = 'S' if daylight saving time is active else ' '
54 <D> = 'U' if UTC time code is deliverd else ' '
55 <A> = '!' during the hour preceeding an daylight saving time
57 <A> = 'A' if a leap second is announced
60 <STX><dd>.<mm>.<yy>; <w>; <hh>:<mm>:<ss>; <U><S><F><D><A><L><R><ETX>
61 pos: 0 00 0 00 0 00 11 1 11 11 1 11 2 22 22 2 2 2 2 2 3 3 3
62 1 23 4 56 7 89 01 2 34 56 7 89 0 12 34 5 6 7 8 9 0 1 2
63 <STX> = '\002' ASCII start of text
64 <ETX> = '\003' ASCII end of text
65 <dd>,<mm>,<yy> = day, month, year(2 digits!!)
66 <w> = day of week (sunday= 0)
67 <hh>,<mm>,<ss> = hour, minute, second
68 <U> = 'U' UTC time display
69 <S> = '#' if never synced since powerup else ' ' for DCF U/A 31
70 '#' if not PZF sychronisation available else ' ' for PZF 535
71 <F> = '*' if time comes from internal quartz else ' '
72 <D> = 'S' if daylight saving time is active else ' '
73 <A> = '!' during the hour preceeding an daylight saving time
75 <L> = 'A' LEAP second announcement
76 <R> = 'R' alternate antenna
78 <p>Meinberg GPS166 receiver<br>
79 You must get the Uni-Erlangen firmware for the GPS receiver support to work to full satisfaction !</p>
81 <STX><dd>.<mm>.<yy>; <w>; <hh>:<mm>:<ss>; <+/-><00:00>; <U><S><F><D><A><L><R><L>; <position...><ETX>
83 000000000111111111122222222223333333333444444444455555555556666666
84 123456789012345678901234567890123456789012345678901234567890123456
85 \x0209.07.93; 5; 08:48:26; +00:00; ; 49.5736N 11.0280E 373m\x03
88 <STX> = '\002' ASCII start of text
89 <ETX> = '\003' ASCII end of text
90 <dd>,<mm>,<yy> = day, month, year(2 digits!!)
91 <w> = day of week (sunday= 0)
92 <hh>,<mm>,<ss> = hour, minute, second
93 <+/->,<00:00> = offset to UTC
94 <S> = '#' if never synced since powerup else ' ' for DCF U/A 31
95 '#' if not PZF sychronisation available else ' ' for PZF 535
96 <U> = 'U' UTC time display
97 <F> = '*' if time comes from internal quartz else ' '
98 <D> = 'S' if daylight saving time is active else ' '
99 <A> = '!' during the hour preceeding an daylight saving time
101 <L> = 'A' LEAP second announcement
102 <R> = 'R' alternate antenna (reminiscent of PZF535) usually ' '
103 <L> = 'L' on 23:59:60
105 <p>For the Meinberg parse look into clock_meinberg.c</p>
106 <h4>Raw DCF77 Data via serial line</h4>
107 <p>RAWDCF: end=TIMEOUT>1.5s, sync each char (any char),generate psuedo time codes, fixed format</p>
108 <p>direct DCF77 code input</p>
109 <p>In Europe it is relatively easy/cheap the receive the german time code transmitter DCF77. The simplest version to process its signal is to feed the 100/200ms pulse of the demodulated AM signal via a level converter to an RS232 port at 50Baud. parse/clk_rawdcf.c holds all necessary decoding logic for the time code which is transmitted each minute for one minute. A bit of the time code is sent once a second.</p>
111 The preferred tty setting is:
112 CFLAG (B50|CS8|CREAD|CLOCAL)
117 <h4>DCF77 raw time code</h4>
118 <p>From "Zur Zeit", Physikalisch-Technische Bundesanstalt (PTB), Braunschweig und Berlin, M„rz 1989<br>
120 <p>Timecode transmission:</p>
124 time marks are send every second except for the second before the
126 time marks consist of a reduction of transmitter power to 25%
128 the falling edge is the time indication (on time)
129 time marks of a 100ms duration constitute a logical 0
130 time marks of a 200ms duration constitute a logical 1
132 <p>see the spec. (basically a (non-)inverted psuedo random phase shift) encoding:</p>
137 0 - 10 AM: free, FM: 0
139 15 R - alternate antenna
140 16 A1 - expect zone change (1 hour before)
141 17 - 18 Z1,Z2 - time zone
144 1 0 MESZ (MED, MET DST)
146 19 A2 - expect leap insertion/deletion (1 hour before)
147 20 S - start of time code (1)
148 21 - 24 M1 - BCD (lsb first) Minutes
149 25 - 27 M10 - BCD (lsb first) 10 Minutes
150 28 P1 - Minute Parity (even)
151 29 - 32 H1 - BCD (lsb first) Hours
152 33 - 34 H10 - BCD (lsb first) 10 Hours
153 35 P2 - Hour Parity (even)
154 36 - 39 D1 - BCD (lsb first) Days
155 40 - 41 D10 - BCD (lsb first) 10 Days
156 42 - 44 DW - BCD (lsb first) day of week (1: Monday -> 7: Sunday)
157 45 - 49 MO - BCD (lsb first) Month
159 51 - 53 Y1 - BCD (lsb first) Years
160 54 - 57 Y10 - BCD (lsb first) 10 Years
161 58 P3 - Date Parity (even)
162 59 - usually missing (minute indication), except for leap insertion
165 <h4>Schmid clock</h4>
166 <p>Schmid clock: needs poll, binary input, end='\xFC', sync start</p>
167 <p>The Schmid clock is a DCF77 receiver that sends a binary time code at the reception of a flag byte. The contents if the flag byte determined the time code format. The binary time code is delimited by the byte 0xFC.</p>
170 CFLAG (B1200|CS8|CREAD|CLOCAL)
176 <p>The command to Schmid's DCF77 clock is a single byte; each bit allows the user to select some part of the time string, as follows (the output for the lsb is sent first).</p>
178 Bit 0: time in MEZ, 4 bytes *binary, not BCD*; hh.mm.ss.tenths
179 Bit 1: date 3 bytes *binary, not BCD: dd.mm.yy
180 Bit 2: week day, 1 byte (unused here)
181 Bit 3: time zone, 1 byte, 0=MET, 1=MEST. (unused here)
182 Bit 4: clock status, 1 byte, 0=time invalid,
183 1=time from crystal backup,
185 Bit 5: transmitter status, 1 byte,
186 bit 0: backup antenna
187 bit 1: time zone change within 1h
188 bit 3,2: TZ 01=MEST, 10=MET
189 bit 4: leap second will be
190 added within one hour
192 Bit 6: time in backup mode, units of 5 minutes (unused here)
195 <h4>Trimble SV6 ASCII time code (TAIP)</h4>
196 <p>Trimble SV6: needs poll, ascii timecode, start='>', end='<', query='>QTM<', eol='<'</p>
197 <p>Trimble SV6 is a GPS receiver with PPS output. It needs to be polled. It also need a special tty mode setup (EOL='<').</p>
200 CFLAG (B4800|CS8|CREAD)
201 IFLAG (BRKINT|IGNPAR|ISTRIP|ICRNL|IXON)
205 <p>Special flags are:</p>
206 <pre> PARSE_F_PPSPPS - use CIOGETEV for PPS time stamping
207 PARSE_F_PPSONSECOND - the time code is not related to
208 the PPS pulse (so use the time code
209 only for the second epoch)
212 0000000000111111111122222222223333333 / char
213 0123456789012345678901234567890123456 \ posn
214 >RTMhhmmssdddDDMMYYYYoodnnvrrrrr;*xx< Actual
215 ----33445566600112222BB7__-_____--99- Parse
216 >RTM 1 ;* < Check
220 <p>ELV DCF7000: end='\r', pattern=" - - - - - - - \r"</p>
221 <p>The ELV DCF7000 is a cheap DCF77 receiver sending each second a time code (though not very precise!) delimited by '`r'</p>
224 YY-MM-DD-HH-MM-SS-FF\r
227 FF&0x2 - DST switch warning
228 FF&0x4 - unsynchronised
231 <h4>HOPF 6021 und Kompatible</h4>
232 <p>HOPF Funkuhr 6021 mit serieller Schnittstelle Created by F.Schnekenbuehl <frank@comsys.dofn.de> from clk_rcc8000.c Nortel DASA Network Systems GmbH, Department: ND250 A Joint venture of Daimler-Benz Aerospace and Nortel.</p>
237 "Sekundenvorlauf" ON
238 ETX zum Sekundenvorlauf ON
241 transmit with control characters
244 <p>Type 6021 Serial Output format</p>
246 000000000011111111 / char
247 012345678901234567 \ position
248 sABHHMMSSDDMMYYnre Actual
252 s = STX (0x02), e = ETX (0x03)
253 n = NL (0x0A), r = CR (0x0D)
255 A B - Status and weekday
260 x x x 0 - no announcement
261 x x x 1 - Summertime - wintertime - summertime announcement
264 0 0 x x - Time/Date invalid
265 0 1 x x - Internal clock used
266 1 0 x x - Radio clock
267 1 1 x x - Radio clock highprecision
281 <h4>Diem Computime Clock</h4>
282 <p>The Computime receiver sends a datagram in the following format every minute</p>
284 Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLF
285 Pos 0123456789012345678901 2 3
286 0000000000111111111122 2 2
287 Parse T: : : : : : : \r\n
289 T Startcharacter "T" specifies start of the timestamp
290 YY Year MM Month 1-12
300 <h4>WHARTON 400A Series Clock with a 404.2 Serial interface</h4>
301 <p>The WHARTON 400A Series clock is able to send date/time serial messages in 7 output formats. We use format 1 here because it is the shortest. We set up the clock to send a datagram every second. For use with this driver, the WHARTON 400A Series clock must be set-up as follows :</p>
303 Programmable Selected
305 BST or CET display 3 9 or 11
306 No external controller 7 0
307 Serial Output Format 1 9 1
308 Baud rate 9600 bps 10 96
309 Bit length 8 bits 11 8
312 <p>WHARTON 400A Series output format 1 is as follows :</p>
314 Timestamp STXssmmhhDDMMYYSETX
318 STX start transmission (ASCII 0x02)
319 ETX end transmission (ASCII 0x03)
320 ss Second expressed in reversed decimal (units then tens)
321 mm Minute expressed in reversed decimal
322 hh Hour expressed in reversed decimal
323 DD Day of month expressed in reversed decimal
324 MM Month expressed in reversed decimal (January is 1)
325 YY Year (without century) expressed in reversed decimal
326 S Status byte : 0x30 +
327 bit 0 0 = MSF source 1 = DCF source
328 bit 1 0 = Winter time 1 = Summer time
329 bit 2 0 = not synchronised 1 = synchronised
330 bit 3 0 = no early warning 1 = early warning
333 <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>