home *** CD-ROM | disk | FTP | other *** search
-
- NBSCOM
- Version 1.9a
- 01/12/91
- Copyright(c) Franklin Antonio, N6NKF
-
-
- NBSCOM is a program to allow you to accurately set the DOS date/time in your
- PC using the National Institute of Standards and Technology (NIST) Telephone
- Time Service. <These folks used to call themselves the National Bureau of
- Standards (NBS).>
-
- You simply run NBSCOM, and it dials up the NIST, reads the time, sets your
- DOS clock, and tells you how far your DOS clock needed to be advanced or
- retarded.
-
- Required equipment: Any PC and a modem.
-
- The NIST Time Service presently uses an ordinary phone number in the 303 area
- code. The only cost of using the service is the cost of a very quick long-
- distance call. NIST literature says they plan to switch to a 900-number
- sometime in the future.
-
-
-
- Instructions..
-
- Take care of two small configuration setup issues, (telling NBSCOM about
- your timezone, and your modem), then you just run the program. See
- "Configuration Issues" below.
-
-
-
- Running the program..
-
- Just type NBSCOM while at the DOS prompt.
-
- NBSCOM will tell your modem to dial, and all characters exchanged
- between the modem and computer will be displayed on the screen. The NIST
- sends one time-stamp every second. As soon as NBSCOM has correctly received
- two time stamps in a row, it will hangup the phone, and tell you the results.
- An example session follows. At any time during the modem dialog, you can type
- any key, and the program will hang up the phone and exit immediately.
-
-
- A sample session...
- --- Modem dialog follows --- Type any key to abort. ---
- ? = HELP
- National Institute of Standards and Technology
- Telephone Time Service
- D L D
- MJD YR MO DA H M S ST S UT1 msADV OTM
- 47511 88-12-16 06:03:44 00 0 -.1 045.0 UTC(NIST) *
- 47511 88-12-16 06:03:45 00 0 -.1 045.0 UTC(NIST) *
-
- --- Setting DOS Date & Time to local: 12/15/1988 22:03:44 ---
- --- Your DOS time was ahead of NIST by 5.22 seconds ---
- --- Info only: Your hardware realtime clock reads: 12/15/1988 22:04:44 ---
- --- Done --- Phone call duration was 20.4 seconds. ---
-
-
- The "Info only" line about your hardware realtime clock is only printed if you
- have an IBM AT, or a machine with an AT-compatible BIOS. NBSCOM reads the AT
- hardware clock (RTC), but does not, at this time, attempt to set it. It makes
- no attempt to read or write the large variety of different third-party
- aftermarket hardware clocks that are present in many IBM PC's and XT's.
-
- The average phone call duration is about 20 seconds. If there is phone line
- noise that garbles some of the characters, it will take a little longer.
- NIST has provided a timeout which hangs up the phone at their end at 55
- seconds. NBSCOM contains a timeout to prevent phone calls longer than a time
- limit you specify.
-
-
-
- Configuration Issues..
-
- You must set a DOS environment variable to tell NBSCOM what timezone you're in.
- The program needs this information so that it can convert the UTC (or GMT, or
- ZULU or whatever you like to call it) that NIST speaks to your local time.
-
- The environment variable is "TZ". (short for TimeZone) You should put the
- command to set it in your autoexec.bat file, so that you never forget.
- You must set TZ to your timezone by executing a DOS command like this...
-
- SET TZ=PST8PDT
-
- The first three letters (PST in this case) are the name of a timezone, followed
- by an optionally signed number indicating the number of hours difference
- between UTC and your timezone, followed by an optional three letter name of a
- daylight-savings-time timezone. If you live in an area where daylight-savings-
- time is not used, you should leave off the last three letters.
-
- Other examples.. SET TZ=EST5EDT or SET TZ=MST7MDT, etc.
-
- IF YOU DO NOT WANT AUTOMATIC DAYLIGHT SAVINGS TIME, then omit the last three
- letters.
-
- If you don't set TZ at all, it defaults to PST.
-
-
- This program comes with an initialization file, NBSCOM.INI, which specifies
- several parameters which may need to be customized for your computer system.
- Parameters in this file include...
- 1. Which COM port to use. (default COM1)
- 2. The command to dial your modem (default ATDT1-303-494-4774)
- 3. The command to hang up your modem (default ATH)
- 4. The maximum duration allowed for a phone call.
- 5. The COM port hardware i/o address and irq (only needed
- if you have a non-standard com port)
-
- The default parameters should work for more than 90% of all modems, however,
- you should modify the file if it doesn't work for your particular setup.
-
- It is also possible to set the baud rate in the .INI file, however, most users
- will not need to change the baud rate. The NIST time service only supports
- 1200 baud, and 1200 baud is the default used by NBSCOM.
-
- A very few users may have modems that want to communicate with the computer
- at some other speed (such as 2400). If you find yourself in this situation,
- you can change the baud rate parameter.
-
- A few users may have non-standard COM ports. (COM3 and COM4 are often
- non-standard). If you do want to use a non-standard COM port, then you
- will need to specify the hardware i/o address and irq number for the
- COM port in the NBSCOM.INI file.
-
-
- Copyright statement...
-
- This program is Copyright (c) 1988, 1991 Franklin Antonio,
- All Rights Reserved. They may be freely distributed and used for non-
- commercial purposes only. If you redistribute this package, you must
- distribute all the files (source, object, doc, ini), in their original,
- unmodified, form. You may, additionally, distribute modified versions with
- the unmodified versions, but the modified versions must be clearly identified
- as modified, with the original copyright statements intact, and the name and
- address of the modifier clearly shown.
-
-
-
- Why do you need accurate time?
-
- I don't know why *you* need accurate time. I can tell you why I want accurate
- time on my PC. I use my computer to point antennas at Earth-orbiting
- satellites. Low-Earth-Orbiting satellites move the fastest, and therefore
- require the most accurate time. Consider a satellite orbiting at 250 kilometer
- altitude. (The Russian MIR space station, and the US Space Shuttle orbit at
- about this altitude.) We can calculate how much error we'll have in our
- computed antenna pointing angles caused by a certain amount of time error.
- These angles change fastest when the satellite is directly overhead, so we'll
- compute that case. It comes out like this...
-
- Time Error Pointing Error
- 1 second 1.8 degrees
- 10 seconds 17. degrees
- 1 minute 61. degrees
-
-
-
- Technical Notes:
-
- One of the challenges when writing any program that attempts to dial and
- interact with a modem is the very large variety of different brands and
- models of modems in use. They all support a slightly different set of
- commands, and handle the various RS232 modem control signals in a slightly
- different way. Furthermore, there are an amazing variety of different ways
- that RS232 cables can be wired.
-
- Most commercial communications programs (Crosstalk, MIRROR, ProComm,...) solve
- this problem by providing a large number (as many as 20) different config-
- uration files which tell the program how to interact with each different kind
- of modem. These differences include the command set, handling of modem control
- signals (which are required, and which are provided by the modem), handshake
- timing, call progress indications, etc.
-
- I've taken a different approach.
-
- I've written serial i/o routines which are completely oblivious to the state
- of the RS232 modem-control signals. If your modem happens to not provide one
- of the modem-control signals, or use one of them in an unusual way, NBSCOM
- doesn't care. (The standard IBM BIOS, on the other hand, requires that the
- modem raise DSR and CTS.) For outgoing modem-control signals, NBSCOM raises
- DTR and RTS, which, hopefully will satisfy all modems that care. (The standard
- IBM BIOS raises DTR, but then toggles RTS, depending on whether you are reading
- or writing to the serial port.)
-
- I've also provided an .INI file where you can specify the exact character
- strings that should be sent to your modem to dial and hangup. The Hayes-type
- commands that i've included by default will probably work with 90% of all
- modems, but if you require something different, you can just change it.
-
- NBSCOM also raises DTR and RTS before dialing, and drops them after dialing.
- Some modems hang up the phone in response to a falling DTR instead of a
- command.
-
- Finally, while most commercial programs attempt to interact with the call
- progress indications (ie detection of dial-tone, busy signal, etc) provided
- by most modern modems, i have ignored them completely. I simply dial, then
- wait for characters from the modem that look like the NIST format. This has
- the disadvantage that if anything goes wrong during the call (say, for example,
- a busy signal) a program that listens for the call-progress info from a modem
- would know that that had happened immediately, and tell you. This program will
- instead simply wait 'til the timeout occurs. This simpleminded approach has
- the advantage that it is compatible with a wide variety of modems, and it has
- not yet been an inconvenience. I have yet to get a busy signal from NIST!
- You can, of course, immediately abort a call at any time manually, by typing
- any key on the keyboard.
-
-
-
- Disclaimer..
- I have no affiliation with NIST. Comments here do not represent my employer,
- or NIST, or anyone but me. This software is given away, not sold. I make no
- warranty that this software is suitable for any purpose whatsoever. I have
- tested it, and it seems to work for me. My friends Paul Williamson, KB5MU and
- Mike Brock, WB6HHV have tested it, and it seemed to work for them. Each of us
- has a different brand of computer and modem, so there is a good possibility
- that this software will work for you too. Please enjoy it.
-
-
-
- Edit History....
- Ver 1.0 -- 12/20/88 initial release
- Ver 1.1 -- 01/07/88 Bill Taylor & Steve Quigley asked for increased
- timeout to support pulse dialing & long access codes.
- "maxtime" now settable in the .ini file
- Ver 1.2 -- fix msg when call times out.
- Ver 1.3 -- allowed 0 value for maxtime to mean no timeout.
- maxtime=0 speeds up the main loop, so helps folks with
- really slow (slower than 4.77MHz 8088 PCs) machines.
- Ver 1.4 -- 04/04/89 fixed the daylight savings time bug!
- Ver 1.5 -- 06/26/89 added knowledge of COM3,COM4. changed \r\n at
- end of modem commands to \r. some modems couldn't eat the
- \n.
- Ver 1.6 -- 10/29/89 Fix DST again. When i fixed the DST bug in april,
- i got the 2am condition backwards on the two transition
- days. Worked ok except on these two days. Now should work
- every day.
- Ver 1.7 -- 01/12/90 Allow baud rates other than 1200 on computer-to-
- modem link even tho modem always talks to NIST at 1200.
- This helps some folks with modems with inflexible baud rate
- detection.
- Ver 1.8 -- oops. i accidentally identified 1.7 as ver 1.8 when i
- uploaded it to a few bbs's, so skip this version number.
- Ver 1.9 -- 01/05/91 Allow user to specify com port i/o address and
- irq, to allow non-standard ports. Set baud rate directly
- rather than thru BIOS, as some BIOS's can't talk to COM3
- & COM4.
- Ver 1.9a-- fix bug where i wrote divisor to wrong port
-
-
- Comments about this program can be sent to... (If you write, please enclose
- a self-addressed-stamped-envelope. I get lots of correspondence regarding
- programs I have written and given away. I try to respond to all of it, but
- your chances of getting a response are much better if you make it easy for
- me.)
-
- Franklin Antonio
- 2765 Cordoba Cove
- Del Mar, CA 92014
-
- Compuserve ID: 76337,1365
-
-
- Comments about the National Bureau of Standards Telephone Time Service may be
- sent to...
-
- NIST-ACTS
- Time and Frequency Division
- Mail Stop 52
- 325 Broadway
- Boulder, CO 80303
-
-
-