home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR31
/
BBCTIME.ZIP
/
BBC-READ.ME
next >
Wrap
Text File
|
1994-02-09
|
11KB
|
272 lines
-1-
BBCTIME: A Program to set accurate time on a PC
What it is:
BBCTIME is a program that uses a modem to dial up a source of accurate
time and set the real-time clock on a PC. It requires a V21-capable
(300 baud) Hayes compatible modem.
The program may be run from a batch file, or from the screen and
keyboard. In the latter case, the user may interrupt the action of the
program if desired.
To run the program:
Type BBCTIME followed by the telephone number and any program options.
The options are indicated by a slash ( / character), followed by an
option character and, if appropriate, by an option value.
Two telephone numbers are available: 0891 516880 gives Coordinated
Universal Time (UTC), and 0891 516888 gives UK Time-of-Day (TOD).
UTC is akin to Greenwich Mean Time: it does not vary when 'summer time'
and 'winter' time apply. (The only variation in UTC is an occasional
'leap second').
TOD is 'wall time', and follows summer and winter time in the UK.
The simplest way to run the program to acquire TOD is to type
BBCTIME 0891516888
with a space between the program name and the telephone number. Do not
use any other spaces.
Alternatively, put that line in your autoexec.bat file, or a batch file
which could be called by your autoexec.bat file.
If you are running the program from a batch file (rather than the
screen and keyboard), adding /S to the line will turn on 'shortform
mode' which reports only the main program actions to the screen.
See 'program options' below for more information.
Even in shortform mode the program writes some information to the
screen to provide a record of the principal actions undertaken by the
program. This can be discarded by typing
BBCTIME 0891516880 /S > nul
Alternatively, assuming you want to keep a record of what happened, you
can save the information to a file by typing
BBCTIME 0891516880 /S > timeset.dat
-2-
To avoid overwriting previous versions of the file, using the command
BBCTIME 0891516880 /S >> timeset.dat
will append the information to the end of the file.
The following is an example of program's output (in shortform mode):
BBCtime V1.0 - Copyright BBC Feb 09 1994 May be freely distributed
All queries to BBC Engineering Information 081 752 5040
Calls are charged at 36p/min. cheap rate, 48p/min. at all other times
PC Date is [09-02-1994]
PC time set to [14:34:49] Initial correction -00:00:51.843
Time precision ( 0.100) reached : Residual error is 0.059 secs. slow
Terminating - Call duration was approximately 24 seconds
How the Program Works:
The program has three stages.
In the first stage, the serial port is opened, the presence of the
modem is detected, and the number is dialled. If any unrecoverable
problem is detected during any of these stages, the program terminates.
The status of the time unit (at the other end of the modem line) is
checked, and the loop delay is estimated.
In the second phase the date and time are acquired from the time
dissemination unit. If the date requires setting, it is set to the
correct date. The time information is compared to the time on the
PC. If the PC time is within the desired degree of accuracy, the
program ends the connection and terminates. If not, the time is set,
and the third and final stage is entered.
In the final stage the program goes into a convergence loop (the 'main
loop'). The time from the dissemination unit and the time on the PC are
measured and compared. A correction value is computed via a feedback
loop in order to compensate for the time taken to actually set the time
on the PC. The loop is completed when the desired time accuracy is
achieved or when it times out of the loop. The connection is then ended
and the program terminates.
Detection of Success or Failure:
When the program is run automatically, the success status is returned
as an 'ERRORLEVEL' which can be used by a DOS batch file. Success
returns an ERRORLEVEL of 0, failure an ERRORLEVEL of 1.
Program Options:
Program options may be entered by using a slash ('/') followed by the
option, followed by a value if appropriate.
-3-
/S option:
Using this makes the program operate in 'shortform' mode. There is
less sign of activity on the screen than in normal mode, and the
user cannot easily terminate the program manually. Use this option
when running the program from a batch file
/P option:
This allows the user to alter the modem initialisation prefix. If
it is not used, the default prefix is 'ATV1E0Q0DT'. For example,
suppose you wanted to add the modem command 'AT&E0'to the default
string. Then use the command-line option /PATV1E0Q0&E0DT.
Remember to include the DT at the end. This may seem unduly
tedious, but it allows user to insert DP for pulse rather than
tone dialling if this is required.
/C option:
This allows the serial port to be set, if it is not COM1 (the
default). /Cn denotes COMn: n cannot exceed 4.
/+ and /- options:
These options (using the plus or minus sign) cater for callers in
different Time Zones from the UK and allow the time on the PC to
be advanced or retarded with respect to UTC. You can specify the
advance or retard to the nearest minute using the 'hh:mm' format.
No colon implies hours only. For example:
/+1:30 would advance by 1h,30m
/-2 (or /-2:00) would retard by 2h
/T option and /E options:
These options allow the convergence of the time setting algorithm
to be controlled. /T determines the maximum number of seconds the
program is allowed to stay in the main loop (see 'How the Program
Works' above), and /E determines the desired accuracy (in
milliseconds) to which the PC's real-time clock is to be set. If
the /T option is omitted, the default value for the timeout is 50
seconds.
If the /E option is omitted, the default value for the desired
accuracy is 500 mSec; this ensures that the PC clock is set
to the nearest second. Improved accuracy can be achieved by
including the /E option with a value. For example including /E30
on the command line will cause the program to stay in the main
loop until an accuracy of 30 msec has been attained. This may
necessitate a longer and more expensive call. Higher degrees of
accuracy can be achieved, but there seems little point in
attempting this in view of the relatively poor long term stability
of the standard PC clock.
-4-
/W and /A options:
In order to avoid any ambiguity in setting date and time in the
vicinity of midnight, the program enters a wait state (default
duration 15 secs) prior to midnight during which it makes no
attempt to set date or time. Midnight here means either midnight
UTC or midnight Local Time (i.e. UTC + or - an offset). The User
may increase this wait period by use of the /W command. For
example, /W30 will increase the wait state to 30 secs.
Alternatively, in order to avoid incurring call charges during the
wait state, the User can set the program to terminate or Abort
(instead of entering the wait state) by using the /A option.
Example:
BBCTIME 0891516880 /PATV1E1Q0&E0DT /T20 /E30 /S /W30 /A /+1:30 /C2
Billing:
It is expected that call duration will not exceed 25 seconds to achieve
the default accuracy of 500msec. Higher accuracy will require a
slightly longer call.
Callers will be charged in accordance with the prevailing tariff for
the British Telecom Callstream Service. Callstream is a Premium Rate
service and, at the date of issue, calls are charged at the national
rate of 48 pence per minute (peak/standard rate) and 36 pence per
minute (cheap rate) inclusive of VAT. Calls of less than 60 seconds
duration will be charged proportionately. It is understood that, as
from March 31 1994, these rates will increase to 49 and 39 pence per
minute respectively.
Modem Considerations:
In addition to data from the time dissemination unit, the program
recognises the following strings from the modem and responds as shown:
"CONNECT" ) program proceeds to request status of
"CONNECT 300" ) time dissemination unit
"1" )
"NO CARRIER" )
"3" )
"NO DIAL TONE" )
"NO DIALTONE" ) program terminates
"6" )
"NO ANSWER" )
"8" )
"BUSY" ) program redials twice after 30 second
"7" ) intervals before terminating
-5-
The modem should ignore other responses that it does not recognise, but
in the event of difficulty with the program, try reducing the range of
modem responses by using the ATX0 command prior to running BBCTIME.
Verbose responses tend to work more reliably than Numeric ones: use the
ATV1 command.
Further information:
Any queries arising from the operation of the Service should be
directed to:
BBC Engineering Information
White City
201 Wood Lane
London W12 7TS
Telephone: 0345 010 313 (charged at local call rate)
or: 081 752 5040
bbc-read.me 09/02/94