home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR31 / BBCTIME.ZIP / BBC-READ.ME next >
Text File  |  1994-02-09  |  11KB  |  272 lines

  1.                                    -1-
  2.  
  3.         BBCTIME: A Program to set accurate time on a PC
  4.  
  5.  
  6. What it is:
  7.  
  8.      BBCTIME is a program that uses a modem to dial up a source of accurate
  9.      time and set the real-time clock on a PC. It requires a V21-capable
  10.      (300 baud) Hayes compatible modem.
  11.  
  12.      The program may be run from a batch file, or from the screen and
  13.      keyboard. In the latter case, the user may interrupt the action of the
  14.      program if desired.
  15.  
  16.  
  17. To run the program:
  18.  
  19.      Type BBCTIME followed by the telephone number and any program options.
  20.      The options are indicated by a slash ( / character), followed by an
  21.      option character and, if appropriate, by an option value.
  22.  
  23.  
  24.      Two telephone numbers are available: 0891 516880 gives Coordinated
  25.      Universal Time (UTC), and 0891 516888 gives UK Time-of-Day (TOD).
  26.  
  27.      UTC is akin to Greenwich Mean Time: it does not vary when 'summer time'
  28.      and 'winter' time apply. (The only variation in UTC is an occasional
  29.      'leap second').
  30.  
  31.      TOD is 'wall time', and follows summer and winter time in the UK.
  32.  
  33.      The simplest way to run the program to acquire TOD is to type 
  34.  
  35.                       BBCTIME 0891516888
  36.  
  37.      with a space between the program name and the telephone number. Do not
  38.      use any other spaces.
  39.  
  40.      Alternatively, put that line in your autoexec.bat file, or a batch file
  41.      which could be called by your autoexec.bat file.
  42.  
  43.      If you are running the program from a batch file (rather than the
  44.      screen and keyboard), adding /S to the line will turn on 'shortform
  45.      mode' which reports only the main program actions to the screen.      
  46.  
  47.      See 'program options' below for more information.
  48.  
  49.      Even in shortform mode the program writes some information to the
  50.      screen to provide a record of the principal actions undertaken by the
  51.      program. This can be discarded by typing
  52.  
  53.                  BBCTIME 0891516880 /S > nul
  54.  
  55.      Alternatively, assuming you want to keep a record of what happened, you
  56.      can save the information to a file by typing
  57.  
  58.               BBCTIME 0891516880 /S > timeset.dat
  59.  
  60.  
  61.                                    -2-
  62.  
  63.      To avoid overwriting previous versions of the file, using the command 
  64.  
  65.               BBCTIME 0891516880 /S >> timeset.dat
  66.  
  67.      will append the information to the end of the file.
  68.  
  69.      The following is an example of program's output (in shortform mode):
  70.  
  71.  
  72.  
  73.  BBCtime V1.0 - Copyright BBC Feb 09 1994       May be freely distributed 
  74.  All queries to BBC Engineering Information  081 752 5040 
  75.  Calls are charged at 36p/min. cheap rate, 48p/min. at all other times 
  76.  PC Date is [09-02-1994] 
  77.  PC time set to [14:34:49] Initial correction -00:00:51.843 
  78.  Time precision (   0.100) reached :  Residual error is     0.059 secs. slow 
  79.  
  80.  Terminating -  Call duration was approximately     24 seconds
  81.  
  82.  
  83.  
  84. How the Program Works:
  85.  
  86.      The program has three stages.
  87.  
  88.      In the first stage, the serial port is opened, the presence of the
  89.      modem is detected, and the number is dialled. If any unrecoverable
  90.      problem is detected during any of these stages, the program terminates.
  91.      The status of the time unit (at the other end of the modem line) is
  92.      checked, and the loop delay is estimated.
  93.  
  94.      In the second phase the date and time are acquired from the time
  95.      dissemination unit. If the date requires setting, it is set to the
  96.      correct date. The time information is compared to the time on the
  97.      PC. If the PC time is within the desired degree of accuracy, the
  98.      program ends the connection and terminates. If not, the time is set,
  99.      and the third and final stage is entered.
  100.  
  101.      In the final stage the program goes into a convergence loop (the 'main
  102.      loop'). The time from the dissemination unit and the time on the PC are
  103.      measured and compared. A correction value is computed via a feedback
  104.      loop in order to compensate for the time taken to actually set the time
  105.      on the PC. The loop is completed when the desired time accuracy is
  106.      achieved or when it times out of the loop. The connection is then ended
  107.      and the program terminates.
  108.  
  109.  
  110. Detection of Success or Failure:
  111.  
  112.      When the program is run automatically, the success status is returned
  113.      as an 'ERRORLEVEL' which can be used by a DOS batch file. Success
  114.      returns an ERRORLEVEL of 0, failure an ERRORLEVEL of 1.
  115.  
  116.  
  117. Program Options:
  118.  
  119.      Program options may be entered by using a slash ('/') followed by the
  120.      option, followed by a value if appropriate.
  121.                                    -3-
  122.  
  123.      /S option:
  124.  
  125.           Using this makes the program operate in 'shortform' mode. There is
  126.           less sign of activity on the screen than in normal mode, and the
  127.           user cannot easily terminate the program manually. Use this option
  128.           when running the program from a batch file
  129.  
  130.  
  131.      /P option:
  132.  
  133.           This allows the user to alter the modem initialisation prefix. If
  134.           it is not used, the default prefix is 'ATV1E0Q0DT'. For example,
  135.           suppose you wanted to add the modem command 'AT&E0'to the default
  136.           string. Then use the command-line option /PATV1E0Q0&E0DT.
  137.  
  138.           Remember to include the DT at the end. This may seem unduly
  139.           tedious, but it allows user to insert DP for pulse rather than
  140.           tone dialling if this is required.
  141.  
  142.  
  143.      /C option:
  144.  
  145.           This allows the serial port to be set, if it is not COM1 (the
  146.           default). /Cn denotes COMn: n cannot exceed 4.
  147.  
  148.  
  149.      /+ and /- options:
  150.  
  151.           These options (using the plus or minus sign) cater for callers in
  152.           different Time Zones from the UK and allow the time on the PC to
  153.           be advanced or retarded with respect to UTC. You can specify the
  154.           advance or retard to the nearest minute using the 'hh:mm' format.
  155.           No colon implies hours only. For example:
  156.  
  157.                /+1:30   would advance by 1h,30m 
  158.                /-2      (or /-2:00) would retard by 2h
  159.  
  160.  
  161.      /T option and /E options:
  162.  
  163.           These options allow the convergence of the time setting algorithm
  164.           to be controlled. /T determines the maximum number of seconds the
  165.           program is allowed to stay in the main loop (see 'How the Program
  166.           Works' above), and /E determines the desired accuracy (in
  167.           milliseconds) to which the PC's real-time clock is to be set. If
  168.           the /T option is omitted, the default value for the timeout is 50
  169.           seconds. 
  170.  
  171.           If the /E option is omitted, the default value for the desired
  172.           accuracy is 500 mSec; this ensures that the PC clock is set
  173.           to the nearest second. Improved accuracy can be achieved by
  174.           including the /E option with a value. For example including /E30
  175.           on the command line will cause the program to stay in the main
  176.           loop until an accuracy of 30 msec has been attained. This may
  177.           necessitate a longer and more expensive call. Higher degrees of
  178.           accuracy can be achieved, but there seems little point in
  179.           attempting this in view of the relatively poor long term stability
  180.           of the standard PC clock.
  181.  
  182.                                    -4-
  183.  
  184.      /W and /A options:
  185.  
  186.           In order to avoid any ambiguity in setting date and time in the
  187.           vicinity of midnight, the program enters a wait state (default
  188.           duration 15 secs) prior to midnight during which it makes no
  189.           attempt to set date or time. Midnight here means either midnight
  190.           UTC or midnight Local Time (i.e. UTC + or - an offset). The User
  191.           may increase this wait period by use of the /W command. For
  192.           example, /W30 will increase the wait state to 30 secs.
  193.           Alternatively, in order to avoid incurring call charges during the
  194.           wait state, the User can set the program to terminate or Abort
  195.           (instead of entering the wait state) by using the /A option. 
  196.  
  197.  
  198. Example:
  199.  
  200.      BBCTIME 0891516880 /PATV1E1Q0&E0DT /T20 /E30 /S /W30 /A /+1:30 /C2
  201.  
  202.  
  203. Billing:
  204.  
  205.      It is expected that call duration will not exceed 25 seconds to achieve
  206.      the default accuracy of 500msec. Higher accuracy will require a
  207.      slightly longer call.
  208.  
  209.      Callers will be charged in accordance with the prevailing tariff for 
  210.      the British Telecom Callstream Service. Callstream is a Premium Rate
  211.      service and, at the date of issue, calls are charged at the national
  212.      rate of 48 pence per minute (peak/standard rate) and 36 pence per
  213.      minute (cheap rate) inclusive of VAT. Calls of less than 60 seconds
  214.      duration will be charged proportionately. It is understood that, as
  215.      from March 31 1994, these rates will increase to  49 and 39 pence per
  216.      minute respectively.      
  217.  
  218.  
  219. Modem Considerations:
  220.  
  221.      In addition to data from the time dissemination unit, the program 
  222.      recognises the following strings from the modem and responds as shown:
  223.  
  224.           "CONNECT"      )    program proceeds to request status of
  225.           "CONNECT 300"  )    time dissemination unit
  226.           "1"            )
  227.  
  228.  
  229.           "NO CARRIER"   )
  230.           "3"            )
  231.           "NO DIAL TONE" )
  232.           "NO DIALTONE"  )    program terminates
  233.           "6"            )
  234.           "NO ANSWER"    )
  235.           "8"            )
  236.  
  237.           
  238.           "BUSY"         )    program redials twice after 30 second 
  239.           "7"            )    intervals before terminating
  240.  
  241.  
  242.                                    -5-
  243.  
  244.      The modem should ignore other responses that it does not recognise, but
  245.      in the event of difficulty with the program, try reducing the range of
  246.      modem responses by using the ATX0 command prior to running BBCTIME.
  247.  
  248.      Verbose responses tend to work more reliably than Numeric ones: use the
  249.      ATV1 command.
  250.  
  251.  
  252. Further information:
  253.  
  254.      Any queries arising from the operation of the Service should be
  255.      directed to: 
  256.  
  257.                BBC Engineering Information
  258.                White City
  259.                201 Wood Lane
  260.                London W12 7TS
  261.  
  262.                Telephone: 0345 010 313  (charged at local call rate)
  263.                       or: 081 752 5040
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. bbc-read.me 09/02/94
  272.