home *** CD-ROM | disk | FTP | other *** search
/ World of Ham Radio 1997 / WOHR97_AmSoft_(1997-02-01).iso / misc / calltime / amsoft.iii next >
Text File  |  1997-02-01  |  39KB  |  635 lines

  1. Name: NBSTIME
  2.  
  3. Usage: NBSTIME [ -d ]
  4.  
  5.      This program is used to set or check the date and time on an IBM personal 
  6. computer (or equivalent) using data obtained by dialing the NBS using a Hayes 
  7. compatible modem connected to the computer via one of the COM ports. It can 
  8. also be used to provide an output pulse on the line-printer port once per 
  9. second to synchronize other devices.
  10.      The different operating modes are selected by means of a configuration 
  11. file.  A separate program called MAKCFG (described in more detail below) can be 
  12. used to make this file based on your answers to a series of questions. You may 
  13. also generate or modify this file using any text editor.  Once the 
  14. configuration file is prepared, you start the program by typing the command  
  15. NBSTIME <return> in response to the system prompt.
  16.     The switch -d on the command line is optional.  If present, it specifies 
  17. debug mode, and causes various intermediate parameters to be written to the 
  18. screen.  The default is no debug mode.  The brackets enclosing the -d are meant 
  19. to signify that the switch is optional.  They are never entered on the command 
  20. line.
  21.      See the section below on operating instructions for more information.
  22.  
  23.                                        The Configuration File
  24.  
  25.     The name of the configuration file is nbstime.cfg.  It must be located in 
  26. the same directory from which the program will be run.  The configuration file 
  27. may be prepared with a text editor such as EDLIN.  Alternatively, it may be
  28. generated using program MAKCFG, described below.
  29.      The file contains 5 lines in the following format:
  30.  
  31.      Line 1: Dialing mode and telephone number.  The first character on line 1
  32. must be P, T or M.  P means that the modem will dial the telephone number
  33. using pulse mode (which emulates a rotary dial mechanism), T is for tone mode
  34. (which emulates push-button telephones) and M is for manual dialing (which
  35. means that the telephone connection will be completed manually outside of the
  36. program).  In pulse mode or tone mode, the remaining characters on the line
  37. are the digits 0 - 9, a space or a comma.  (Some modems will also accept the *
  38. and # symbols as part of the telephone number in tone mode and will dial them
  39. as well).  The telephone number is not modified by the program and the entire
  40. string is passed to the modem.  This line must contain the complete telephone
  41. number including long-distance access and area code (if necessary) and any
  42. other accounting digits as needed.  A comma signifies a pause for 2 seconds to
  43. wait for another dial tone, and spaces may be inserted to improve legibility.
  44. For example:  T 9, 987 6 5 4 3 means dial 9, wait 2 seconds and then dial the
  45. remaining digits.  All digits are dialed in tone mode.  The telephone number
  46. must be less than 30 characters long including embedded blanks.  If the first
  47. character is M, then manual dialing is specified and the remainder of the line
  48. is ignored.  The program will prompt you to dial the telephone manually and
  49. will wait until you indicate that the connection is completed.
  50.  
  51.      Line 2: The first character must be 1 or 2 to specify communication via
  52. COM1 port or COM2 port, respectively.  This character must be set to match the
  53. port to be used.
  54.      The second character on the line may be B (or b) or E (or e).  This
  55. character specifies whether the program is to expect responses to various
  56. dialing commands from the modem.  E specifies echo mode:  the program expects
  57. that characters sent to the modem in command mode will be echoed and that the
  58. modem will respond OK to a command; B specifies blind operation.  Some modems
  59. can be configured either way either by a switch or the Q command.  (A modem
  60. configured by the Q command will revert to the switch default upon reset.)  If
  61. the second character on the line is neither B nor E, then E is set by default.
  62. Note that when the program is configured for echo mode (by specifying E
  63. explicitly or by default) then it will insist on responses and will abort if
  64. they are not received.
  65.     The third character on the line specifies the communication speed (and,
  66. implicitly, the communication protocol).  If the third character is h (or H),
  67. then 1200-bits/s high-speed communication is selected using the 212A-type
  68. protocol.  If l (or L) is used, then 300-bits/s low-speed service is selected
  69. using 103-type protocol.  Many modems are capable of operating at either
  70. protocol (such dual-speed modems are often identified as "300-1200" type) and
  71. will switch to the correct speed and protocol automatically when then are
  72. activated.  Triple-speed modems of the "300-1200-2400" type may also be used
  73. at either 300 or 1200 bits/s.
  74.      Different messages are transmitted depending on the speed selected.  The
  75. message transmitted at 1200-bits/s contains the full date and time, including
  76. the Daylight-Savings Time flag and other information.  This service is
  77. intended for users who want to set or check the time of the computer clock
  78. with an uncertainty on the order of 10 - 20 milliseconds limited by the
  79. resolution and accuracy of the internal computer clock.  See the discussion
  80. below for more information.
  81.      The message transmitted at 300-bits/s is shorter because of the slower
  82. transmission speed, and contains only the time and the estimated line delay in
  83. milliseconds.  Therefore, it is not possible to set the computer clock since
  84. neither the date nor the correction for Daylight Savings Time are transmitted
  85. (the conversion to local time in the United States, for example, will change
  86. the date about 30% of the time, and the correction for Daylight Savings Time
  87. is necessary about 50% of the time.  It would be possible to assume that the
  88. computer date is correct, but the program does not do so.).  This service is
  89. intended for users who are more interested in the timing pulse capability (to
  90. be described below) or who design special-purpose systems that can make use of
  91. the full capability of the transmissons.
  92.      The fourth character on this line selects a timing-pulse capability. If
  93. this character is y (or Y), then a negative-going pulse (from +5 v to 0 v) is
  94. sent to the strobe line of the line-printer port (LPT1) every second upon
  95. receipt of the on-time marker (the * or # symbol at the end of each
  96. transmitted line) from NBS.  The pulse is sent to pin 1 of the DB25 female
  97. connector used for the standard line-printer interface.  Pin 25 of the same
  98. connector is at ground potential.  The leading-edge of the pulse is delayed
  99. from receipt of the on-time marker by a time on the order of micro-seconds,
  100. depending on the speed of the computer.  The pulse is approximately 20 micro-
  101. seconds wide.  This pulse is normally used by the printer interface software
  102. to transfer a character from the computer to the line printer (-strobe), so
  103. that the printer should be disconnected if this capability is enabled.
  104.      There are three types of commonly used line-printer interfaces.  One of
  105. them is part of a combined monochrome display and printer adapter.  The second
  106. is just a printer adapter and the third is a combined serial/parallel adapter
  107. that is normally found only on AT-type machines.  The command register address
  108. for the first type is 3be (hex), while the second types both use 37a (hex).
  109. If the strobe capability is enabled, the program tries to decide which type of
  110. adapter is present by pulsing both addresses and finding the one that
  111. responds.  If both are present, 37a will be used.  If neither responds as
  112. expected, the program will print a diagnostic message to that effect, the
  113. pulsing capability will be disabled and the program continues.
  114.      The fifth character on the line determines whether or not the received
  115. data will be used to set the computer clocks or merely to check them.  If this
  116. character is s (or S), then the clocks are set and then verified by comparing
  117. the time read from the internal clocks with the next line received from the
  118. NBS (both the received time and the internal clocks will have advanced by one
  119. second between the time they were set and when they were checked).  This mode
  120. does not preserve the time of the clocks before they were set and does not
  121. provide any information on the performance of the clocks.  If this character
  122. is d (or D) then the clocks are only compared.  The NBS time, the computer
  123. time and their difference are typed on the screen.  This mode preserves the
  124. time of the clock (since it is not set), and can also be used to give an
  125. estimate of the rate error (how much the computer clock is gaining or losing
  126. with respect to NBS).  The rate error (expressed in seconds per day, for
  127. example) is simply the time difference in seconds reported by the program
  128. divided by the number of days since the clock was last set.  This mode of
  129. operation is intended for users who want to characterize the performance of
  130. their clocks by observing their accuracy over extended periods of time.
  131.     The effect of this switch also depends on the the AT switch (described
  132. below).  An IBM AT-type machine has two clocks -- one whose time is stored in
  133. the volatile memory and which is updated by the ROM BIOS only when the
  134. computer is turned on and one which is powered by a battery and which runs
  135. continuously.  Other models (such as the XT-class machines) do not have a
  136. battery clock.  This switch enables or disables the setting of BOTH clocks for
  137. an AT-class machine and only the memory-based clock for other models.  That
  138. is, both clocks are either set and verified or just compared.
  139.      The sixth character on the line is used to enable storing time-difference
  140. measurements in a file for subsequent more detailed analysis.  If this
  141. character is a (or A), the time difference between the computer clocks and the
  142. NBS is stored in a file named NBSTIME.DIF.  The program writes the current
  143. time difference to the end of the file (if it currently exists) or creates a
  144. new file if it does not.  The time difference is written in the form: year,
  145. month, day, hour, minute, second, difference of volatile memory clock and
  146. difference of battery clock (if it exists).  The year, month, etc. are taken
  147. from the NBS transmission and the difference is a signed number which is
  148. positive if the computer clock is fast and negative if it is slow.  The
  149. difference is followed by a single letter giving the units: d, h, m, s for
  150. days, hours, minutes and seconds respectively.  This computation is separate
  151. from the setting or checking modes described above.  It is performed when the
  152. fifth line is received from NBS, so that the difference will be written to the
  153. file BEFORE the clocks are set (if that option is specified).  Although the
  154. action of this switch is independent of whether the clocks are set, the
  155. interpretation of the data is not.  If the fifth character specifies that the
  156. clocks shall always be set, then the difference written to the file by this
  157. operation is the time error that has accumulated since the last NBS access,
  158. since the clocks were corrected at that time.  If the fifth character
  159. specifies that the clocks are not to be set, however, then the time error is
  160. the cumulative error since the clocks were last set, and the error since the
  161. last NBS access is the difference between the current and previous values for
  162. the differences.  If this character is n, then the time difference is not
  163. stored in the archive file.
  164.      The remainder of this line is ignored and may contain any characters.
  165.  
  166.      Line 3:  This line specifies the time zone of the user.  This parameter
  167. is used to convert the time transmitted by the NBS from universal time to
  168. local time.  The parameter represents the value of local time minus Universal
  169. time in hours.  Locations West of Greenwich are negative, while those East are
  170. positive.  If specified by value, the value should not exceed 12 hours, but
  171. this is not checked.  The zone may be specified by name or numerically as
  172. follows:
  173.  
  174. First character on line      Action            Offset in hours
  175.  
  176. P or p                       U. S. Pacific Time    -8
  177.  
  178. M or m                       U. S. Mountain Time   -7
  179.  
  180. C or c                       U. S. Central Time    -6
  181.  
  182. E or e                       U. S. Eastern Time    -5
  183.  
  184. Z or z                       Greenwich Time         0
  185.  
  186. + or - or digits             Number read            defined by number
  187.  
  188. In all cases, the remainder of the line is ignored.  Thus the following lines
  189. are equivalent:
  190.  
  191. Mountain Standard Time
  192. m
  193. -7     The Rocky Mountains are here
  194.  
  195. The program does not support conversion to local time in half-hour zones (i.e.
  196. zones where the time difference between local time and Universal time is not
  197. an integral number of hours).
  198.  
  199.      Line 4.  If the first character is 1, then the user observes Daylight
  200. Savings Time, and the local time will be adjusted accordingly if necessary,
  201. based on the Daylight Savings Time flag transmitted by NBS.  If the first
  202. character is 0, the Daylight Savings Time flag is ignored and no such
  203. adjustment will be made.  No other characters are permitted on this line.
  204. If you use a 1 here, then the time will be advanced by one hour if the NBS
  205. transmission indicates that Daylight Savings Time is currently in effect.
  206. You will need to use 0 if you live in an area that does not observe Daylight
  207. Savings Time at all (such as Arizona), or if you change to Daylight Time on a
  208. different day from the national standard.
  209.  
  210.      Line 5.  This is called the AT-flag.  If the first character is 1, the
  211. user has an AT-type machine with a CMOS battery clock, and the program will
  212. set or check it (in addition to the clock that is stored in memory).  If the
  213. first character is 0, the CMOS clock is neither set nor checked.  Zero is
  214. appropriate for users who do not have a CMOS battery clock or who have this
  215. type of equipment but do not want it to be used. Note that the time stored in
  216. the volatile memory clock is lost when the power is removed, so that you
  217. should probably set and check the battery clock if you have it.
  218.  
  219.                               Hardware Requirements
  220.  
  221.      The program will run on an IBM computer or equivalent.  The computer must
  222. contain at least one serial port configured as a standard COM port with an
  223. external modem compatible with the Bell System 212A standard (1200 bits/s) or
  224. the 103 standard (300 bits/s) and capable of responding to the Hayes dialing
  225. commands.  Internal modems and multiple speed modems that emulate these
  226. configuration are acceptable.
  227.  
  228.      If the output pulse capability is selected, the computer must have a
  229. parallel output port for a line-printer that is configured as LPT1.  The
  230. address of the port can be either 37a (hex) or 3be (hex).  The former is used
  231. by the printer adapter and the combined serial/parallel adapter, while the
  232. latter is used for the printer portion of the combined monochrome
  233. display/printer adapter.  If this capability is enabled, the printer should be
  234. turned off or disconnected from the computer before the program is started.
  235.  
  236.                               Software Requirements
  237.  
  238.      The program uses calls to the Standard IBM DOS and BIOS routines except
  239. for the output pulse option that directly accesses the parallel output port. 
  240. It was written entirely in Borland Turbo C under DOS 3.2, but is likely to
  241. work under earlier versions of DOS back to 2.0.  It contains no assembly code.
  242.  
  243.                                Transmission Format
  244.  
  245.      When the telephone connection to the NBS time service is completed, the
  246. NBS hardware sends timing information at either 300 bits/s or 1200 bits/s
  247. using standard ASCII characters.  A line of information is sent every second,
  248. and the transmission continues for a predetermined number of seconds after
  249. which the connection is automatically broken.  The two transmission speeds use
  250. different formats.
  251.       In the high-speed (1200 bits/s) service, each line begins with a five-
  252. digit integer giving the Modified Julian Day Number (which advances by 1 every
  253. day and is about 47000 in 1988), and the year, month, day, hour, minute and
  254. second in Universal (Greenwich) Time.  This time will be correct upon receipt
  255. of the terminating character (* or #) to be described below.
  256.      The next parameter is the Daylight Savings Time flag.  Values from 50 to
  257. 1 indicate the Daylight Savings Time is currently in effect; other values (99
  258. to 51 and 0) indicate that Standard Time is currently in effect.  Values other
  259. than 50 or 0 indicate both the current time and the number of days left before
  260. a transition to the other time is needed.
  261.      Next is the leap-second flag.  Zero is the normal case.  A value of 1
  262. indicates that an extra second will be added following 23:59:59 (Universal
  263. Time) on the last day of the current month.  This second will be called
  264. 23:59:60, and the second after it will be 00:00:00.  A value of 2 indicates
  265. that a second is to be dropped on the last day of the current month.  The
  266. second following 23:59:58 will be 00:00:00.  Leap seconds are usually required
  267. about every 18 months and are most commonly added at the end of June or
  268. December.  It is unlikely that the dropping of a second will be necessary in
  269. the near future. Note that the leap second transition is linked to Universal
  270. TIme, unlike the Daylight Savings transition which is linked to local time.
  271.      The next number is the estimated offset between UT1 (a time scale derived
  272. from the rotation of the earth) and UTC (a time scale derived from frequency
  273. standards).  The units are in seconds in steps of 0.1 second. 
  274.      The next parameter is the estimated telephone-line time delay in
  275. milliseconds as determined by the NBS hardware.  It is estimated as one-half
  276. of the average time it takes the terminating character to be sent to the user
  277. and returned. (Any user who intends to make use of this delay must echo the
  278. terminating character back using either hardware or software methods.  If the
  279. terminator is not echoed back to NBS, a nominal delay is assumed.)   The
  280. remaining characters on the line are UTC(NBS) and the terminating character.  
  281.     The terminating character will be a * if the delay has not yet been
  282. measured or is not stable, and will change to a # if 4 consecutive
  283. measurements yield consistent values.  The NBS hardware uses the time delay
  284. estimated in this way to transmit the subsequent terminating character so that
  285. it will arrive on time at the user.  If the user does not echo the terminator
  286. back to NBS, then a nominal delay is assumed and the terminator is sent using
  287. this nominal value.  This nominal value is unlikely to be in error by more
  288. than 0.1 second unless the circuit is transmitted via satellite.
  289.  
  290.                              Operating Instructions
  291.  
  292.      The program may be run from any directory on any disk.  If necessary,
  293. copy the two files nbstime.exe and nbstime.cfg to the appropriate directory. 
  294. If you will use program makcfg, then copy makcfg.exe to the same directory. 
  295. Make that directory the default using the cd command.  Edit the configuration
  296. file nbstime.cfg if necessary (or run program MAKCFG).  Any text editor, such
  297. as EDLIN may be used for this purpose.  (Word processing programs can also be
  298. used to edit the file provided that the output file is in standard DOS format. 
  299. Note that this is not the default output format for most word processors.)
  300.      When the files are ready, connect the modem to the telephone line and to
  301. the computer and execute the program.  If the program is to be run from
  302. directory blah on disk c, for example:
  303.  
  304. copy nbstime.*    c:\blah                copy the files.
  305. copy makcgf.exe  c:\blah
  306.  
  307. c:                                      change to c disk if necessary
  308.  
  309. cd \blah                                set directory if necessary
  310.  
  311. type nbstime.cfg                        type the configuration file on the
  312.                                           screen to see if it needs to be       
  313.                                           modified.  If it does, you may do     
  314.                                           so using an editor such as edlin,     
  315.                                           as shown below.  Or, you may run      
  316.                                           program MAKCFG, described below       
  317.                                           to produce a new nbstime.cfg file.    
  318.  
  319. edlin nbstime.cfg
  320.    .
  321.    .
  322.    .                                     edit configuration file if necessary
  323.  
  324. ex                                       exit from the editor
  325.  
  326. nbstime                                  run program
  327.  
  328.                                Operating Sequence
  329.  
  330.      This is what happens when the program is run:
  331.  
  332. 1. The command line is examined to see if it contains -d.  If it does, then
  333. set the debug mode to 1 (turn it on); otherwise leave debug at 0.  This
  334. parameter is used for testing the program and should not normally be
  335. specified.
  336.  
  337. 2.  Read the configuration file nbstime.cfg and set the various parameters. 
  338. If an error is detected in reading the file, print a message and stop.  If the
  339. configuration file does not exist in the default directory, then use a default
  340. configuration which is identical to the sample configuration file.
  341.  
  342. 3.  Initialize the com port to 300 or 1200 bits/s, no parity, 1 stop bit.  If
  343. output pulses are requested, determine the address of the parallel printer
  344. port.  If the address cannot be determined then print a diagnostic message and
  345. disable the output pulse selection.
  346.  
  347. 4.  Dial the number if necessary.  If remote modem answers print connect
  348. message and proceed.  If no answer or busy then print message and stop.  If
  349. manual dialing was specified, print a message for manual dialing and wait for
  350. connection.
  351.  
  352. 5.  Read the first 6 lines and echo the terminating character back to NBS for
  353. measuring the transmission line delay.  Send an output pulse when each
  354. terminating character is received if that capability was specified in the
  355. configuration file.  Print these lines on the screen.  The terminating
  356. character will be * initially and will change to # if the NBS hardware
  357. measures a stable transmission delay.  If 300-bits/s service was specified,
  358. continue reading lines in this manner until the NBS breaks the connection;
  359. then hangup the local modem and exit.
  360.  
  361. 6.  If 1200 bits/s service and archive mode is specified, the time difference
  362. between the computer clocks and the NBS transmission is computed when the
  363. fifth line is received and stored in file NBSTIME.DIF.
  364.  
  365. 7.  If 1200-bits/s service is specified, then use the time of the 7th line to
  366. set the computer clock (if setting was enabled).  If the AT flag is on, then
  367. both the memory clock and the CMOS battery clock are set.  Adjust the time to
  368. local time and for daylight savings time as specified in the configuration
  369. file.  Echo the terminator of this line back to NBS and send an output pulse
  370. if pulse selection is enabled.
  371.  
  372. 8.  Read the time of the next line received from NBS and compare the time with
  373. the current values of the computer clocks.  (All of the clocks should have
  374. advanced by 1 second.)  Print both the times and the time difference values on
  375. the screen.  If the AT flag in the configuration file is set, then compare
  376. both clocks with the time received from NBS and print both sets of times and
  377. time differences on the screen.  The memory-based clock "ticks" 18.2 times per
  378. second, while the CMOS battery clock in an AT-type computer "ticks" once per
  379. second.  It is not possible to read or set either clock to better than one of
  380. its ticks, so that differences of one tick or less are not significant. (This
  381. is discussed in more detail below.)
  382.  
  383. 9.  If output pulses are not enabled, then hang up the modem and exit.  If
  384. automatic dialing was selected, a % character is sent to NBS and the Hayes
  385. hang-up sequence is sent to the local modem.  If manual dialing was selected,
  386. then the local modem is presumed to not understand the Hayes commands and the
  387. Hayes hang-up sequence is not sent.  If output pulses are enabled then do not
  388. hang-up the telephone, but continue receiving lines as in paragraph 5 above
  389. until the NBS disconnects the call.
  390.  
  391.                                  Timing Accuracy
  392.  
  393.      The volatile memory clock in personal computers of this type (IBM-pc or
  394. equivalent) ticks approximately 18.2 times/second (about every 56
  395. milliseconds), and the time is kept as the number of ticks past midnight.  It
  396. is not possible to alter the tick fraction using calls to either DOS or the
  397. ROM BIOS.  This has two significant consequences:
  398.  
  399. 1. Since there are not an integral number of ticks/second, not all times can
  400. exist.  For example, 00:00:01.00 is not an integral number of ticks after
  401. midnight and therefore can not be set and will never be read.  The nearest
  402. times are 00:00:00.98 and 00:00:01.04.  The average offset between any given
  403. time and the nearest time that can be set is 0.5 ticks or about 28
  404. milliseconds.
  405.  
  406. 2. Time intervals are also uncertain by up to 1 tick since the tick fraction
  407. when the time is read cannot be known to the program.  Again, the average
  408. offset is 0.5 ticks (28 milliseconds).
  409.  
  410.     The CMOS clock in AT computers cannot be set to better than a second since
  411. it does not store fractions of a second.  The seconds fraction must therefore
  412. be truncated or rounded when the CMOS clock is addressed.  This will further
  413. limit the accuracy of the time following a re-boot of the system (since the
  414. CMOS clock is copied into the system RAM clock at that time).  
  415.  
  416.      In addition to these errors in setting and reading the clock in this type
  417. of computer, there is a possible error in the computation of the telephone
  418. line delay.  This delay is measured at the NBS as one-half of the time it
  419. takes the terminating character (* or #) to be sent from NBS to the distant
  420. computer and return to the NBS hardware.  This method depends on the
  421. assumption that the transit time is reciprocal, i.e. that the time from NBS to
  422. the computer is the same as from the computer to NBS.  This may not be true if
  423. the two paths are different;  many 1200 bits/s modems also have delays that
  424. are not reciprocal.  Modem delays vary from brand to brand and are on the
  425. order of tens of milliseconds.   
  426.  
  427.      The accuracy of the computer clocks after they have been set is
  428. determined by the accuracy of the rate of the internal crystal-controlled
  429. oscillators.  These rates are usually sensitive to temperature and other
  430. factors and are unlikely to be stable to better than about 1 part-per-million
  431. (about 0.1 seconds/day), so that errors in the time of this order are likely
  432. even if the time is set exactly initially.
  433.  
  434.     There may also be a problem with the date if the machine is run
  435. continuously, since the date in some computers is not advanced when the time
  436. passes through midnight.  (This comment applies to the clock stored in memory
  437. only.  The CMOS clock in AT-type machines advances the date properly, but this
  438. clock is only used to set the time initially when the computer is started.) 
  439. This is a "feature" of the BIOS routines that manage the memory-based clock.
  440.  
  441.      The accuracy of the output pulse is limited primarily by the stability of
  442. the telephone line delay, since the delays within the computer are likely to
  443. be very small by comparison.  Many modems contain equalizing circuits that
  444. attempt to measure the characteristics of the telephone line to which they are
  445. connected.  The operation of these circuits may adversely affect the stability
  446. of the measured time delay.  Although the measured delay may be quite stable
  447. from second to second (with fluctuations of less than 50 micro-seconds), it
  448. often changes significantly every few seconds (as much as 500 micro-seconds)
  449. as the equalizing circuits operate.  The equalizing circuits are usually more
  450. important at the higher speeds so that this effect is likely to be smaller at
  451. 300 bits/s.
  452.  
  453.                                  Fixing Problems
  454.  
  455.      If the program does not work, the following suggestions may be helpful.  
  456.  
  457. 1.  First check the hardware configuration to be sure that it is connected, is
  458. in working order and is an IBM personal computer or functional equivalent. 
  459. Likewise be sure that the modem is connected to the computer and to the
  460. telephone line and that it responds to the Hayes protocol.
  461.  
  462. 2.  Many modems have a small loudspeaker that is connected to the telephone
  463. line until the connection is made.  Some modems also have lights to show the
  464. status of the call.  The modem should start dialing within a few seconds after
  465. the program is initiated.  If a loudspeaker is present, the dial tone should
  466. be heard followed by the dialing sequence.  If lights are present, OH (off-
  467. hook) should light and SD and RD (send-data and receive data) should flash. 
  468. If none of these things happens, be sure that the hardware is properly
  469. configured and that the configuration file specifies the correct port (COM 1
  470. or COM 2).  The IBM BIOS checks for various status indicators from the modem
  471. and will not initiate a transmission to the modem unless these status
  472. indicators are correct.  In particular, DSR (Data Set Ready) must be true.  In
  473. some modems this line follows DCD (Data Carrier Detect) and therefore will not
  474. be true until the telephone connection has been completed (this is logical for
  475. a modem used to answer incoming calls, but not for modems that can originate
  476. calls since they should be "ready" to accept a dialing command before the call
  477. is established).  In this case, the modem will never be sent dialing
  478. instructions, since it will appear not ready at the start of the program. 
  479. This may usually be changed by a switch in the modem.  When set appropriately,
  480. this switch forces DSR and DCD to be true continuously.  This adjustment is
  481. described in the instruction manual for the modem.  It is often implemented as
  482. switch number 6.  Note that changing the setting of this switch may change the
  483. operation of other programs, especially some terminal emulators that access
  484. the COM ports directly and not via the BIOS commands.  In particular, Data
  485. Carrier Detect is normally used to indicate that the modem is receiving a
  486. signal from a distant modem over the telephone connection, and if this signal
  487. is forced to be continuously true, some terminal emulators may refuse to dial
  488. the modem, assuming that the connection is already established.  
  489.  
  490. 3.  The error message, "No response from modem." means that the modem did not
  491. respond to the dialing sequence as expected.  The message is followed by a
  492. number indicating how far into the sequence the error was sensed.  Number 1
  493. signifies no response to the initial command to reset the modem (ATZ).  If
  494. this message is received, be sure that the hardware is okay and that the modem
  495. is connected to the COM port specified in the configuration file.  Numbers 2
  496. through 4 indicate no response to various parts of the set-up sequence.  If
  497. this occurs, be sure that the echo/blind parameter on the second line of the
  498. configuration file is set appropriately and edit the configuration file (or
  499. rerun program MAKCFG) if necessary.  A response of 5 is probably a telephone
  500. line problem -- since modem problems are likely to have resulted in a failure
  501. at an earlier stage in the process.  These problems can usually be diagnosed
  502. by listening to the progress of the call on the built-in loudspeaker, if
  503. possible.  Be sure that the telephone number is correct and that any long-
  504. distance codes have been entered correctly. If a pause for a second dial-tone
  505. has been inserted, be sure that it is long enough, and add extra pause
  506. commands (,) if necessary.
  507.  
  508. 4.  If the connection is established, but the time is not set correctly,
  509. verify that the lines printed on the screen show the correct date and time. 
  510. If 1200-bits/s service is selected, the first number on each line is the
  511. Modified Julian Day (MJD) Number, which advances by 1 every day and is about
  512. 47000 in 1988.  It is not used by the program.  The next numbers are year,
  513. month, day, hour, minute and second in order, where the hour is in Universal
  514. Time (UTC), followed by the Daylight Savings flag, which is an integer from 0
  515. to 99.  The remainder of the line is not used by the program.   If 300-bits/s
  516. service is selected, each line contains the time, the estimated line delay in
  517. milliseconds and the terminating character that is used for synchronization. 
  518. As discussed above, the time is not set in this mode, so that only the
  519. presence of the terminating character is significant.  If the lines are
  520. partially garbled then either the telephone line or the modem should be
  521. suspected.  If the lines are totally garbled, it is likely that the modem
  522. cannot communicate at the selected speed or does not conform to the
  523. corresponding standard.  It is also possible that there is a problem with the
  524. receive portion of the COM port, although this is less likely since the
  525. dialing commands use the same hardware.
  526.  
  527. 5.  If only the CMOS clock is not set correctly (using 1200 bits/s service),
  528. verify that it conforms to the IBM standard and that the configuration file is
  529. set correctly.
  530.  
  531.                                  Error Handling
  532.  
  533.      The program deals with only certain types of errors:  Syntax errors in
  534. the configuration file are likely to be detected, although the program does
  535. not place any limits on the telephone number, and an error in specifying it is
  536. unlikely to be sensed until the modem responds erratically.  Hardware problems
  537. or inconsistencies between the hardware and the configuration file will also
  538. be sensed since they will most likely result in no response from the modem or
  539. in a protocol error.
  540.  
  541.      The most likely source of error in a nominally healthy and properly
  542. configured system is a transmission error.  We can distinguish several
  543. different types of problem depending on where the error occurs.
  544.  
  545.      1.  The line terminating character (* or #) is garbled or lost.  The
  546. program will not detect the end of the line and will concatenate the line with
  547. the following one.  If output pulses are enabled, no pulse will be sent.  If
  548. the line in error is the line that is used either for setting the clock or
  549. checking it, then an error of 1 second will occur either in setting the clock
  550. or in comparing it.  If this is not either of those lines then the program
  551. will simply continue with no error (the other lines are displayed but are not
  552. used in any other way).  Since the length of the line is known, this error
  553. could be detected in principle, but the current version of the program does
  554. not do so.
  555.  
  556.      2.  Another character on the line is converted to the terminator (* or
  557. #).  The program will detect a premature end-of-line and synchronization with
  558. the NBS will likely be affected.  If output pulses are enabled, a pulse will
  559. be sent at the wrong time.  The error introduced in setting the clock depends
  560. on which line this occurs in just as in 1 above.  Note that this error is
  561. rather unlikely since there are 128 characters that an error might produce,
  562. but only 2 of them are legal terminators.  This error could also be detected
  563. in principle by a line-length check as above, but the current version of the
  564. program does not do so.
  565.  
  566.      3.  A digit of the time is transformed into another character that is not
  567. a digit.  This could be detected in principle by carefully checking each
  568. character on the line, but the current version of the program does not do so. 
  569. If this is the line that is used either to set the clock or check it, then the
  570. discrepancy between the local time and the NBS time is likely to be large,
  571. since the error is unlikely to occur in the same position in both the line
  572. used to set the time and the line used to check it.  If output pulses are
  573. enabled, this type of error has no effect on them since they are governed only
  574. by the receipt of the terminating character.
  575.  
  576.      4.  A digit of the time is transformed into another legal digit.  This
  577. error cannot be detected by examining the line.  The probability is rather
  578. small, however, since there are only 10 legal digits out of 128 possibilities. 
  579. As with 3 above, if this is the line that is used either to set the clock or
  580. to check it, then the discrepancy between the local time and the NBS time is
  581. likely to be large since the transmission error is unlikely to occur in the
  582. same position in the two lines.  As in 3 above, there is no degradation of the
  583. output pulse timing.
  584.  
  585.      Errors 3 and 4 could also be dealt with by assuming some previous
  586. knowledge of the time or date and rejecting values that deviated from this
  587. assumed date and time by too great an amount.  Illegal month and day
  588. combinations could also be detected in this way.
  589. Name: MAKCFG
  590.  
  591. Usage: MAKCFG
  592.  
  593.     This program constructs a file named NBSTIME.CFG based on the answers to a
  594. series of questions.  The program may be run from any directory of any disk,
  595. but is most conveniently run from the same directory in which program NBSTIME
  596. is located.
  597.  
  598.      The number of each question refers to the line of the output file that is
  599. being assembled.  Thus questions 1a, 1b, ... are used to assemble the various
  600. parameters for the first line.  The contents of each line are described in the
  601. description for the NBSTIME program.
  602.  
  603.      All of the acceptable responses for each question are listed as part of
  604. question.  Alphabetic answers may be given in upper or lower case.  All
  605. answers must be terminated with a carriage return (or enter), and this fact is
  606. denoted by the symbol <return> in the description for each response.  If you
  607. respond to any question with ? <return>, additional information will be
  608. printed out and the question will be repeated.  If your response is not one of
  609. the expected responses, the message, "I don't understand ..." is printed and
  610. the question is repeated.  
  611.  
  612.      Your response is not passed to the program until the <return> key is
  613. pressed, so that errors may be erased using the delete key as usual and the
  614. corrected response may then be entered.  If the expected response is a single
  615. letter or digit, then all characters after the first one on the line are
  616. ignored.  Thus if when
  617.  
  618.           y <return>
  619.  
  620. is expected, you enter instead,
  621.  
  622.           yes, we have no bananas <return>,
  623.  
  624. the two responses will be treated identically since only the first character
  625. is parsed and the remainder of the line is discarded.
  626.  
  627.      This program checks to see if a configuration file already exists in your
  628. directory.  If it finds the file, it will print a message and give you the
  629. choice of renaming the old file, over-writing the old file or stopping to
  630. think about it.  If you choose to rename the file, the existing file will be
  631. renamed config.old.  This process will fail if a file of THAT name already
  632. exists, and the program will give up if that happens.  You must then erase one
  633. of the configuration files or copy them to another directory or sub-directory
  634. so that the program won't find them.
  635.