home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / dcf77r06.zip / DCF77R.DOC next >
Text File  |  1997-05-04  |  9KB  |  224 lines

  1.  
  2.  
  3.                                DCF77R/2
  4.  
  5.                              version 0.6
  6.  
  7.                (c) CopyRight 1997 by Rob Hamerling
  8.  
  9.  
  10.  
  11. DCF77R for OS/2 reads a DCF77 clock module and synchronizes the system clock.
  12.  
  13.  
  14. What is all about?
  15. -----------------
  16. DCF77R/2 is designed for CONRAD's DCF-module "WT 100 serial", order number
  17. 64 19 60-44 (numbers from the Dutch Catalog 1997!) and is supposed to be
  18. attached to an RS232 communications port with CONRAD's "Software Set", order
  19. number 64 19 79-44. However the delivered software is for DOS, and seems not
  20. to run reliable in a DOS-session under OS/2. DCF77R/2 for OS/2 Warp
  21. compensates for this omision!
  22.  
  23.  
  24. Command line syntax
  25. -------------------
  26.  
  27.    DCR77R <port> [<timezone-correction>]
  28.  
  29.    <port> is a required parameter and designates the COM-port to which your
  30.           DCF77 clock is connected. You may choose from the following
  31.           methods:
  32.  
  33.           1. Specification of the port NUMBER (allowed range: 1..4).
  34.  
  35.              Example:   DCF77R  3    (COM3 on standard address)
  36.  
  37.              In this case DCF77R selects respectively address: [1] 3F8,
  38.              [2] 2F8, [3] 3E8 or [4] 2E8.
  39.              You cannot use this method if your COM-port has not one of
  40.              these base addresses.
  41.  
  42.           2. Explicit specification of the base ADDRESS of the COM-port.
  43.  
  44.              Examples:  DCF77R 3F8   (COM1 on standard address)
  45.                         DCF77R 02F8  (COM4 on non-standard address)
  46.                         DCF77R 3220  (COM3 on a PS/2).
  47.  
  48.           WARNING: Specification of wrong port information may cause system
  49.                    problems, which is your own responsibility!
  50.  
  51.    <timezone-correction> is an optional parameter which should specify the
  52.           difference in seconds between local time and DCF77 time.
  53.           Value should be in the range -86400 .. +86400
  54.  
  55.           Example for UK:  -3600
  56.  
  57.  
  58.    Without any parameters or in case of an invalid specification the program
  59.    will remind you of the syntax.
  60.  
  61.  
  62. Conditions
  63. ----------
  64. DCF77R will synchronize the system time only if ALL of the following
  65. conditions are satisfied:
  66.  - physical read of the clock data completed within 2.5 seconds
  67.  - data indicates "last reception was OK"
  68.  - no battery low condition is signalled
  69.  - either summertime or wintertime is indicated
  70.  - a valid time is received (in the range 00:00:00 .. 23:59:59)
  71.  - when difference between old and new time is not larger than 12 hours and
  72.    both times are not on different sides of midnight (to avoid faulty date).
  73.  
  74.  
  75. Internals
  76. ---------
  77. Synchronization of system time is done at the next whole second (one second
  78. later than the obtained DCF77 time). The DCF77R program has been dimensioned
  79. such that the reading process including the documented DCF77 module delays
  80. takes slightly less than 1 second (the DCF77 module is triggered with a half
  81. cycle period of about 10 msecs). Generally the deviation will be less than
  82. a few tenths of a second with 'real' time.
  83. To avoid date-change errors:
  84.  - Synchronization of system time is delayed 1 second when local time is
  85.    00:00:00 (after applying timezone correction).
  86.  - Synchronization is canceled when the absolute value of the difference
  87.    between DCF77 time and current system time is more than 12 hours. This
  88.    covers the situation that these times are on different sides of midnight.
  89.  
  90.  
  91. Installation
  92. ------------
  93. If you have the "Software Set" with attachment material, then follow its
  94. directions. If no, a wiring diagram is given later in this document.
  95. If you don't have a free COM-port, you may very well share the port with a
  96. serial mouse like suggested in the documentation by Conrad, but mouse
  97. activity during read of the clock module may disrupt DCF77 data.
  98. DCF77R/2 does not use interrupts, but its activity may trigger activities by
  99. other devices on the same COM-port or software that uses the port. Therefore
  100. it is recommended to NOT share the clock-port with a modem. However it may
  101. still work, most likely when there is no communications program currently
  102. using the port.
  103.  
  104. Returncodes
  105. -----------
  106.  0 - System time synchronized
  107.  1 - Command syntax error
  108.  2 - System time was not updated, reason given with error message
  109.  
  110.  
  111. Output of DCF77R
  112. ----------------
  113. DCF77R sends some progress messages to the screen (stdout). For the reader
  114. of this doc-file none of these needs further explanation!
  115.  
  116. You may redirect the output to a logfile as follows (for append):
  117.  
  118.   DCF77R  3  >>Binkley.Log
  119.  
  120. If you want to manipulate the output of DCF77R, the sample REXX procedure
  121. below may give a suggestion. The example does not much more than the
  122. redirection command. It skips the first three output lines and adds the
  123. system date and origin of the messages to those appended to the log file.
  124. It needs some fantasy and a little bit of REXX skills to extend this example.
  125.  
  126.   /* DCF77LOG.CMD  -  read DCF77 and write output to dataset */
  127.   logfile = 'f:\c\dcf77r\dcf77r.log'   /* specify destination of output */
  128.   '@DCF77R 3 | rxqueue'                /* output to REXX queue */
  129.   do i=1 while queued() > 0            /* all queued lines */
  130.     parse pull qline                   /* read next line from queue */
  131.     if i>3 then                        /* skip first three messages */
  132.       call lineout logfile, date() 'DCF77R' qline   /* append log */
  133.   end
  134.   call stream logfile, 'c', 'close'    /* release logfile */
  135.   /* end of DCF77LOG */
  136.  
  137.  
  138. System requirements
  139. -------------------
  140.  - OS/2 2.0 or higher
  141.  - IOPL=YES in CONFIG.SYS
  142.  
  143.  
  144. Freeware/Cardware/Shareware
  145. ---------------------------
  146. Use of this program is free and distribution is encouraged, but you must
  147. pass the whole package unchanged and may not charge the recipient anything.
  148. The author would appreciate to receive from the users of DCF77R a postcard
  149. with a picture of a typical sight of their city as a message 'thank you for
  150. DCF77R/2'. Alternatively you may send an envelope with a banknote of your
  151. country (valid, any value is welcome!) to the address:
  152.  
  153.  R. Hamerling
  154.  Hogelandseweg 67
  155.  4132 CV  Vianen
  156.  The Netherlands
  157.  
  158.  
  159. Evaluation
  160. ----------
  161. Comments and suggestions are welcome, preferred method electronically to:
  162.  
  163.  FidoNet: 2:281/732 (phone 31-347-322423)
  164.  E-mail:  rob.hamerling@f732.n281.z2.elcom.org
  165.  
  166.  
  167. Have fun! Rob.
  168.  
  169.  
  170. =============================================================================
  171.  
  172. Summary of changes
  173. ------------------
  174.  
  175. version 0.1 - not released, needed a dedicated COM-port
  176. version 0.2 - first version released to the public
  177.             - may share COM-port with serial mouse
  178. version 0.3 - added compensation for the time needed to read the DCF module,
  179.               and system time now displayed in hundredths of seconds
  180.             - improved reliability of read process
  181.             - extended documentation
  182. version 0.4 - added optional parameter for correction of timezone
  183.             - more validity checks on received data
  184.             - now fully 32-bits code
  185. version 0.5 - time not updated if difference between current and DCF77 time
  186.               is larger than 12 hours, or on different sides of midnight
  187. version 0.6 - doc-file extended with explanation of returncodes (errorlvl)
  188.               and suggestions for an alternative output destination
  189.             - task priority set to Timecritical during reading
  190.  
  191.  
  192. Wiring diagram
  193. --------------
  194. If you don't want the DOS software of Conrads wiring package, you may save
  195. some money by making your own attachment. The required 'T'-cable consists of
  196. a short (20 cm) 9-wire cable 'straight over' with a female sub D-connector
  197. on one side, a male sub D-connector on the other side, and a 4-wire branch
  198. (150 cm) to the DCF77 module. It may be slightly difficult to obtain the
  199. required plug on the side of the DCF77 module!
  200.  
  201. The following diagram shows how the DCF77 clock should be connected.
  202.  
  203.  
  204.                          ┌─────────┐
  205.                          │ ■ ■ ■ ■ │  DCF77 module connector
  206.                          │┌│─│─│─│┐│
  207.                          └┘│ │ │ │└┘
  208.       female               │ │ │ │
  209.  COM-port connector        │ │ │ │
  210.   25-pin    9-pin          │ │ │ │
  211.                            │ │ │ │
  212.    8  [DCD]  1 ────────────│─│─┴─│────────────
  213.    3  [RxD]  2 ────────────│─│───│────────────
  214.    2  [TxD]  3 ────────────│─│───┴────────────      male
  215.   20  [DTR]  4 ────────────┴─│────────────────      connector
  216.    7  [GND]  5 ──────────────│────────────────      for mouse
  217.    6  [DSR]  6 ──────────────│────────────────
  218.    4  [RTS]  7 ──────────────┴────────────────
  219.    5  [CTS]  8 ───────────────────────────────
  220.   22   [RI]  9 ───────────────────────────────
  221.  
  222.  
  223.  
  224.