home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / btron11.zip / NBSCOM.DOC < prev    next >
Text File  |  1991-01-12  |  12KB  |  276 lines

  1.  
  2.                        NBSCOM
  3.                     Version 1.9a
  4.                  01/12/91
  5.             Copyright(c) Franklin Antonio, N6NKF
  6.  
  7.  
  8. NBSCOM is a program to allow you to accurately set the DOS date/time in your
  9. PC using the National Institute of Standards and Technology (NIST) Telephone
  10. Time Service.  <These folks used to call themselves the National Bureau of
  11. Standards (NBS).>
  12.  
  13. You simply run NBSCOM, and it dials up the NIST, reads the time, sets your
  14. DOS clock, and tells you how far your DOS clock needed to be advanced or 
  15. retarded.  
  16.  
  17. Required equipment:  Any PC and a modem.  
  18.  
  19. The NIST Time Service presently uses an ordinary phone number in the 303 area
  20. code.  The only cost of using the service is the cost of a very quick long-
  21. distance call.  NIST literature says they plan to switch to a 900-number 
  22. sometime in the future.
  23.  
  24.  
  25.  
  26. Instructions..
  27.  
  28. Take care of two small configuration setup issues, (telling NBSCOM about
  29. your timezone, and your modem), then you just run the program.  See 
  30. "Configuration Issues" below.
  31.  
  32.  
  33.  
  34. Running the program..
  35.  
  36. Just type NBSCOM while at the DOS prompt.  
  37.  
  38. NBSCOM will tell your modem to dial, and all characters exchanged
  39. between the modem and computer will be displayed on the screen.  The NIST 
  40. sends one time-stamp every second.  As soon as NBSCOM has correctly received 
  41. two time stamps in a row, it will hangup the phone, and tell you the results. 
  42. An example session follows.  At any time during the modem dialog, you can type
  43. any key, and the program will hang up the phone and exit immediately.
  44.  
  45.  
  46. A sample session...
  47.     --- Modem dialog follows --- Type any key to abort. ---
  48.     ? = HELP
  49.     National Institute of Standards and Technology
  50.     Telephone Time Service
  51.                             D  L D
  52.      MJD  YR MO DA  H  M  S ST S UT1 msADV         OTM
  53.     47511 88-12-16 06:03:44 00 0 -.1 045.0 UTC(NIST) *
  54.     47511 88-12-16 06:03:45 00 0 -.1 045.0 UTC(NIST) *
  55.  
  56.     --- Setting DOS Date & Time to local: 12/15/1988 22:03:44 ---
  57.     --- Your DOS time was ahead of NIST by 5.22 seconds ---
  58.     --- Info only: Your hardware realtime clock reads: 12/15/1988 22:04:44 ---
  59.     --- Done --- Phone call duration was 20.4 seconds. ---
  60.  
  61.  
  62. The "Info only" line about your hardware realtime clock is only printed if you
  63. have an IBM AT, or a machine with an AT-compatible BIOS.  NBSCOM reads the AT
  64. hardware clock (RTC), but does not, at this time, attempt to set it.  It makes
  65. no attempt to read or write the large variety of different third-party 
  66. aftermarket hardware clocks that are present in many IBM PC's and XT's.  
  67.  
  68. The average phone call duration is about 20 seconds.  If there is phone line 
  69. noise that garbles some of the characters, it will take a little longer.  
  70. NIST has provided a timeout which hangs up the phone at their end at 55 
  71. seconds.  NBSCOM contains a timeout to prevent phone calls longer than a time
  72. limit you specify.  
  73.  
  74.  
  75.  
  76. Configuration Issues..
  77.  
  78. You must set a DOS environment variable to tell NBSCOM what timezone you're in.
  79. The program needs this information so that it can convert the UTC (or GMT, or 
  80. ZULU or whatever you like to call it) that NIST speaks to your local time.
  81.  
  82. The environment variable is "TZ".  (short for TimeZone)  You should put the
  83. command to set it in your autoexec.bat file, so that you never forget.
  84. You must set TZ to your timezone by executing a DOS command like this...
  85.  
  86.     SET TZ=PST8PDT
  87.  
  88. The first three letters (PST in this case) are the name of a timezone, followed
  89. by an optionally signed number indicating the number of hours difference 
  90. between UTC and your timezone, followed by an optional three letter name of a
  91. daylight-savings-time timezone.  If you live in an area where daylight-savings-
  92. time is not used, you should leave off the last three letters.
  93.  
  94. Other examples..  SET TZ=EST5EDT  or SET TZ=MST7MDT, etc.
  95.  
  96. IF YOU DO NOT WANT AUTOMATIC DAYLIGHT SAVINGS TIME, then omit the last three
  97. letters.
  98.  
  99. If you don't set TZ at all, it defaults to PST.
  100.  
  101.  
  102. This program comes with an initialization file, NBSCOM.INI, which specifies
  103. several parameters which may need to be customized for your computer system.
  104. Parameters in this file include...
  105.     1.  Which COM port to use.  (default COM1)
  106.     2.  The command to dial your modem (default ATDT1-303-494-4774)
  107.     3.  The command to hang up your modem (default ATH)
  108.     4.  The maximum duration allowed for a phone call.
  109.     5.  The COM port hardware i/o address and irq (only needed
  110.           if you have a non-standard com port)
  111.  
  112. The default parameters should work for more than 90% of all modems, however,
  113. you should modify the file if it doesn't work for your particular setup.
  114.  
  115. It is also possible to set the baud rate in the .INI file, however, most users
  116. will not need to change the baud rate.  The NIST time service only supports
  117. 1200 baud, and 1200 baud is the default used by NBSCOM.  
  118.  
  119. A very few users may have modems that want to communicate with the computer
  120. at some other speed (such as 2400).  If you find yourself in this situation,
  121. you can change the baud rate parameter.
  122.  
  123. A few users may have non-standard COM ports.  (COM3 and COM4 are often
  124. non-standard).  If you do want to use a non-standard COM port, then you
  125. will need to specify the hardware i/o address and irq number for the
  126. COM port in the NBSCOM.INI file.
  127.  
  128.  
  129. Copyright statement...
  130.  
  131. This program is Copyright (c) 1988, 1991 Franklin Antonio, 
  132. All Rights Reserved.  They may be freely distributed and used for non-
  133. commercial purposes only.  If you redistribute this package, you must 
  134. distribute all the files (source, object, doc, ini), in their original, 
  135. unmodified, form.  You may, additionally, distribute modified versions with 
  136. the unmodified versions, but the modified versions must be clearly identified 
  137. as modified, with the original copyright statements intact, and the name and 
  138. address of the modifier clearly shown.  
  139.  
  140.  
  141.  
  142. Why do you need accurate time?
  143.  
  144. I don't know why *you* need accurate time.  I can tell you why I want accurate
  145. time on my PC.  I use my computer to point antennas at Earth-orbiting 
  146. satellites.  Low-Earth-Orbiting satellites move the fastest, and therefore
  147. require the most accurate time.  Consider a satellite orbiting at 250 kilometer
  148. altitude.  (The Russian MIR space station, and the US Space Shuttle orbit at
  149. about this altitude.)  We can calculate how much error we'll have in our 
  150. computed antenna pointing angles caused by a certain amount of time error.  
  151. These angles change fastest when the satellite is directly overhead, so we'll 
  152. compute that case.  It comes out like this...
  153.  
  154.         Time Error    Pointing Error
  155.          1 second          1.8 degrees
  156.         10 seconds        17.  degrees
  157.          1 minute         61.  degrees
  158.  
  159.  
  160.  
  161. Technical Notes:
  162.  
  163. One of the challenges when writing any program that attempts to dial and 
  164. interact with a modem is the very large variety of different brands and
  165. models of modems in use.  They all support a slightly different set of 
  166. commands, and handle the various RS232 modem control signals in a slightly
  167. different way.  Furthermore, there are an amazing variety of different ways
  168. that RS232 cables can be wired.
  169.  
  170. Most commercial communications programs (Crosstalk, MIRROR, ProComm,...) solve
  171. this problem by providing a large number (as many as 20) different config-
  172. uration files which tell the program how to interact with each different kind
  173. of modem.  These differences include the command set, handling of modem control
  174. signals (which are required, and which are provided by the modem), handshake
  175. timing, call progress indications, etc.
  176.  
  177. I've taken a different approach.  
  178.  
  179. I've written serial i/o routines which are completely oblivious to the state 
  180. of the RS232 modem-control signals.  If your modem happens to not provide one 
  181. of the modem-control signals, or use one of them in an unusual way, NBSCOM 
  182. doesn't care.  (The standard IBM BIOS, on the other hand, requires that the 
  183. modem raise DSR and CTS.)  For outgoing modem-control signals, NBSCOM raises 
  184. DTR and RTS, which, hopefully will satisfy all modems that care.  (The standard
  185. IBM BIOS raises DTR, but then toggles RTS, depending on whether you are reading
  186. or writing to the serial port.)  
  187.  
  188. I've also provided an .INI file where you can specify the exact character
  189. strings that should be sent to your modem to dial and hangup.  The Hayes-type
  190. commands that i've included by default will probably work with 90% of all 
  191. modems, but if you require something different, you can just change it.
  192.  
  193. NBSCOM also raises DTR and RTS before dialing, and drops them after dialing.
  194. Some modems hang up the phone in response to a falling DTR instead of a
  195. command.
  196.  
  197. Finally, while most commercial programs attempt to interact with the call
  198. progress indications (ie detection of dial-tone, busy signal, etc) provided
  199. by most modern modems, i have ignored them completely.  I simply dial, then
  200. wait for characters from the modem that look like the NIST format.  This has
  201. the disadvantage that if anything goes wrong during the call (say, for example,
  202. a busy signal) a program that listens for the call-progress info from a modem
  203. would know that that had happened immediately, and tell you.  This program will
  204. instead simply wait 'til the timeout occurs.  This simpleminded approach has 
  205. the advantage that it is compatible with a wide variety of modems, and it has
  206. not yet been an inconvenience.  I have yet to get a busy signal from NIST!
  207. You can, of course, immediately abort a call at any time manually, by typing 
  208. any key on the keyboard.  
  209.  
  210.  
  211.  
  212. Disclaimer..
  213. I have no affiliation with NIST.  Comments here do not represent my employer,
  214. or NIST, or anyone but me.  This software is given away, not sold.  I make no
  215. warranty that this software is suitable for any purpose whatsoever.  I have
  216. tested it, and it seems to work for me.  My friends Paul Williamson, KB5MU and
  217. Mike Brock, WB6HHV have tested it, and it seemed to work for them.  Each of us
  218. has a different brand of computer and modem, so there is a good possibility
  219. that this software will work for you too.  Please enjoy it.
  220.  
  221.  
  222.  
  223. Edit History....
  224.     Ver 1.0 -- 12/20/88 initial release
  225.     Ver 1.1 -- 01/07/88 Bill Taylor & Steve Quigley asked for increased 
  226.            timeout to support pulse dialing & long access codes.  
  227.            "maxtime" now settable in the .ini file
  228.     Ver 1.2 -- fix msg when call times out.
  229.     Ver 1.3 -- allowed 0 value for maxtime to mean no timeout.
  230.            maxtime=0 speeds up the main loop, so helps folks with
  231.            really slow (slower than 4.77MHz 8088 PCs) machines.
  232.     Ver 1.4 -- 04/04/89 fixed the daylight savings time bug!
  233.     Ver 1.5 -- 06/26/89 added knowledge of COM3,COM4.  changed \r\n at 
  234.            end of modem commands to \r.  some modems couldn't eat the
  235.            \n.
  236.     Ver 1.6 -- 10/29/89 Fix DST again.  When i fixed the DST bug in april,
  237.            i got the 2am condition backwards on the two transition
  238.            days.  Worked ok except on these two days.  Now should work
  239.            every day.  
  240.     Ver 1.7 -- 01/12/90 Allow baud rates other than 1200 on computer-to-
  241.            modem link even tho modem always talks to NIST at 1200.  
  242.            This helps some folks with modems with inflexible baud rate
  243.            detection.
  244.     Ver 1.8 -- oops.  i accidentally identified 1.7 as ver 1.8 when i 
  245.            uploaded it to a few bbs's, so skip this version number.
  246.     Ver 1.9 -- 01/05/91 Allow user to specify com port i/o address and
  247.            irq, to allow non-standard ports.  Set baud rate directly
  248.            rather than thru BIOS, as some BIOS's can't talk to COM3
  249.            & COM4.
  250.     Ver 1.9a-- fix bug where i wrote divisor to wrong port
  251.  
  252.  
  253. Comments about this program can be sent to... (If you write, please enclose
  254. a self-addressed-stamped-envelope.  I get lots of correspondence regarding
  255. programs I have written and given away.  I try to respond to all of it, but
  256. your chances of getting a response are much better if you make it easy for
  257. me.)
  258.  
  259.     Franklin Antonio
  260.     2765 Cordoba Cove
  261.     Del Mar, CA  92014
  262.  
  263.     Compuserve ID: 76337,1365
  264.  
  265.  
  266. Comments about the National Bureau of Standards Telephone Time Service may be
  267. sent to...
  268.  
  269.     NIST-ACTS
  270.     Time and Frequency Division
  271.     Mail Stop 52
  272.     325 Broadway
  273.     Boulder, CO  80303
  274.  
  275.  
  276.