home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
dcf77r06.zip
/
DCF77R.DOC
next >
Wrap
Text File
|
1997-05-04
|
9KB
|
224 lines
DCF77R/2
version 0.6
(c) CopyRight 1997 by Rob Hamerling
DCF77R for OS/2 reads a DCF77 clock module and synchronizes the system clock.
What is all about?
-----------------
DCF77R/2 is designed for CONRAD's DCF-module "WT 100 serial", order number
64 19 60-44 (numbers from the Dutch Catalog 1997!) and is supposed to be
attached to an RS232 communications port with CONRAD's "Software Set", order
number 64 19 79-44. However the delivered software is for DOS, and seems not
to run reliable in a DOS-session under OS/2. DCF77R/2 for OS/2 Warp
compensates for this omision!
Command line syntax
-------------------
DCR77R <port> [<timezone-correction>]
<port> is a required parameter and designates the COM-port to which your
DCF77 clock is connected. You may choose from the following
methods:
1. Specification of the port NUMBER (allowed range: 1..4).
Example: DCF77R 3 (COM3 on standard address)
In this case DCF77R selects respectively address: [1] 3F8,
[2] 2F8, [3] 3E8 or [4] 2E8.
You cannot use this method if your COM-port has not one of
these base addresses.
2. Explicit specification of the base ADDRESS of the COM-port.
Examples: DCF77R 3F8 (COM1 on standard address)
DCF77R 02F8 (COM4 on non-standard address)
DCF77R 3220 (COM3 on a PS/2).
WARNING: Specification of wrong port information may cause system
problems, which is your own responsibility!
<timezone-correction> is an optional parameter which should specify the
difference in seconds between local time and DCF77 time.
Value should be in the range -86400 .. +86400
Example for UK: -3600
Without any parameters or in case of an invalid specification the program
will remind you of the syntax.
Conditions
----------
DCF77R will synchronize the system time only if ALL of the following
conditions are satisfied:
- physical read of the clock data completed within 2.5 seconds
- data indicates "last reception was OK"
- no battery low condition is signalled
- either summertime or wintertime is indicated
- a valid time is received (in the range 00:00:00 .. 23:59:59)
- when difference between old and new time is not larger than 12 hours and
both times are not on different sides of midnight (to avoid faulty date).
Internals
---------
Synchronization of system time is done at the next whole second (one second
later than the obtained DCF77 time). The DCF77R program has been dimensioned
such that the reading process including the documented DCF77 module delays
takes slightly less than 1 second (the DCF77 module is triggered with a half
cycle period of about 10 msecs). Generally the deviation will be less than
a few tenths of a second with 'real' time.
To avoid date-change errors:
- Synchronization of system time is delayed 1 second when local time is
00:00:00 (after applying timezone correction).
- Synchronization is canceled when the absolute value of the difference
between DCF77 time and current system time is more than 12 hours. This
covers the situation that these times are on different sides of midnight.
Installation
------------
If you have the "Software Set" with attachment material, then follow its
directions. If no, a wiring diagram is given later in this document.
If you don't have a free COM-port, you may very well share the port with a
serial mouse like suggested in the documentation by Conrad, but mouse
activity during read of the clock module may disrupt DCF77 data.
DCF77R/2 does not use interrupts, but its activity may trigger activities by
other devices on the same COM-port or software that uses the port. Therefore
it is recommended to NOT share the clock-port with a modem. However it may
still work, most likely when there is no communications program currently
using the port.
Returncodes
-----------
0 - System time synchronized
1 - Command syntax error
2 - System time was not updated, reason given with error message
Output of DCF77R
----------------
DCF77R sends some progress messages to the screen (stdout). For the reader
of this doc-file none of these needs further explanation!
You may redirect the output to a logfile as follows (for append):
DCF77R 3 >>Binkley.Log
If you want to manipulate the output of DCF77R, the sample REXX procedure
below may give a suggestion. The example does not much more than the
redirection command. It skips the first three output lines and adds the
system date and origin of the messages to those appended to the log file.
It needs some fantasy and a little bit of REXX skills to extend this example.
/* DCF77LOG.CMD - read DCF77 and write output to dataset */
logfile = 'f:\c\dcf77r\dcf77r.log' /* specify destination of output */
'@DCF77R 3 | rxqueue' /* output to REXX queue */
do i=1 while queued() > 0 /* all queued lines */
parse pull qline /* read next line from queue */
if i>3 then /* skip first three messages */
call lineout logfile, date() 'DCF77R' qline /* append log */
end
call stream logfile, 'c', 'close' /* release logfile */
/* end of DCF77LOG */
System requirements
-------------------
- OS/2 2.0 or higher
- IOPL=YES in CONFIG.SYS
Freeware/Cardware/Shareware
---------------------------
Use of this program is free and distribution is encouraged, but you must
pass the whole package unchanged and may not charge the recipient anything.
The author would appreciate to receive from the users of DCF77R a postcard
with a picture of a typical sight of their city as a message 'thank you for
DCF77R/2'. Alternatively you may send an envelope with a banknote of your
country (valid, any value is welcome!) to the address:
R. Hamerling
Hogelandseweg 67
4132 CV Vianen
The Netherlands
Evaluation
----------
Comments and suggestions are welcome, preferred method electronically to:
FidoNet: 2:281/732 (phone 31-347-322423)
E-mail: rob.hamerling@f732.n281.z2.elcom.org
Have fun! Rob.
=============================================================================
Summary of changes
------------------
version 0.1 - not released, needed a dedicated COM-port
version 0.2 - first version released to the public
- may share COM-port with serial mouse
version 0.3 - added compensation for the time needed to read the DCF module,
and system time now displayed in hundredths of seconds
- improved reliability of read process
- extended documentation
version 0.4 - added optional parameter for correction of timezone
- more validity checks on received data
- now fully 32-bits code
version 0.5 - time not updated if difference between current and DCF77 time
is larger than 12 hours, or on different sides of midnight
version 0.6 - doc-file extended with explanation of returncodes (errorlvl)
and suggestions for an alternative output destination
- task priority set to Timecritical during reading
Wiring diagram
--------------
If you don't want the DOS software of Conrads wiring package, you may save
some money by making your own attachment. The required 'T'-cable consists of
a short (20 cm) 9-wire cable 'straight over' with a female sub D-connector
on one side, a male sub D-connector on the other side, and a 4-wire branch
(150 cm) to the DCF77 module. It may be slightly difficult to obtain the
required plug on the side of the DCF77 module!
The following diagram shows how the DCF77 clock should be connected.
┌─────────┐
│ ■ ■ ■ ■ │ DCF77 module connector
│┌│─│─│─│┐│
└┘│ │ │ │└┘
female │ │ │ │
COM-port connector │ │ │ │
25-pin 9-pin │ │ │ │
│ │ │ │
8 [DCD] 1 ────────────│─│─┴─│────────────
3 [RxD] 2 ────────────│─│───│────────────
2 [TxD] 3 ────────────│─│───┴──────────── male
20 [DTR] 4 ────────────┴─│──────────────── connector
7 [GND] 5 ──────────────│──────────────── for mouse
6 [DSR] 6 ──────────────│────────────────
4 [RTS] 7 ──────────────┴────────────────
5 [CTS] 8 ───────────────────────────────
22 [RI] 9 ───────────────────────────────