home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / c / cwk49.zip / CWK49.DOC < prev    next >
Text File  |  1993-01-04  |  23KB  |  390 lines

  1.            >> CLOCKWORK << version 4.9, January 1993
  2.  
  3.  
  4. Maintains a super accurate system clock without a modem and long distance
  5. calls and without any other costly hardware.
  6.  
  7. Copyright (c) 1992 by Pavel Otavsky
  8. 26 Barberry Hill, Woodstock, Vermont 05091-1269
  9.  
  10. CLOCKWORK consists of two files: CWK49.DOC and CWK.EXE.
  11.  
  12.                    PROGRAM FEATURES:
  13.    *** Automatic adjustment of the system clock with a very high degree of
  14. accuracy - one second per week is achievable!
  15.    *** System clock adjustment by entering the amount of correction.
  16.    *** Switch between Daylight, Standard, Universal and Local Meridian time
  17. as well as change of time zone while traveling across time zones and date
  18. line.
  19.    *** Display of Julian day and day of the week for any date.
  20.    *** Days between dates calculator. The values entered are preserved for
  21. editing or reuse.
  22.    *** A menu system for easy setup and use.
  23.    *** Time setting with accuracy of 1/18 second in spite of the "Real Time
  24. Clock" resolution of 1 second (type 2 systems).
  25.    *** Easy and accurate comparison of system time to a standard, easy
  26. generation of the adjustment value.
  27.    *** Selection of screen color for better readability on different
  28. displays.
  29.    *** On line help.
  30.    *** Conversion from unregistered to registered installation. Elimination
  31. of shareware messages and delays by entering a registration code.
  32.    *** Recording of system clock adjustment history, if desired.
  33.  
  34.                    UPGRADE TO VERSION 4.9
  35.    No special action is required if upgrading from 4.1 or higher. Just copy
  36. CWK.EXE and CWK49.DOC from the distribution disk to replace the old
  37. version, however it is recommended to start a new clock measurement cycle
  38. and elect to keep the old adjustment factor.
  39.  
  40.                    INTRODUCTION
  41.    Every clock's speed is different from the standard. If the clock speed
  42. is known and remains constant, it is possible to adjust it at any time and
  43. maintain a very high degree of accuracy. The clock speed can be determined
  44. quite accurately if the measurement is averaged over a long time.
  45.    On a personal computer it is possible to apply system clock corrections
  46. at convenient times and achieve accuracy that is much better than that of
  47. clocks normally provided. The CLOCKWORK utility performs a system clock
  48. adjustment automatically at startup if invoked by the AUTOEXEC.BAT or at
  49. any other time if run manually or called by some other program.
  50.  
  51.                    COMMAND LINE FORMAT
  52.    The command line format for CLOCKWORK is as follows:
  53. CWK {1|1a|2|2a} [filespec]
  54. {|} One of the four command line arguments must be always used.
  55.     CWK 1 will run the program for type 1 systems.
  56.     CWK 1A will perform the automatic clock adjustment.
  57.     CWK 2 will run the program for system type 2.
  58.     CWK 2A will do the automatic adjustment on type 2 systems.
  59. [ ] The optional filespec describes the auxiliary data file. It should be
  60.     used only to override the environment variable CWK (see below). It
  61.     can be drive, path and file name (e.g. a:\clockdir\clocdata.dat),
  62.     only path and file name or only file name. If no filespec is given
  63.     and CWK not defined, the default is CWK1DATA.DAT or CWK2DATA.DAT,
  64.     respectively, placed in the current directory.
  65. The command line is not case sensitive.
  66.                    TYPE 1 OR TYPE 2 SYSTEM CLOCK?
  67.    There are two types of system clocks commonly used: the first is an add-
  68. on (on an I/O board, or memory board) found usually on a PC/XT or
  69. compatible and requires a software utility both to set (e.g. SETCLOCK.COM)
  70. and to retrieve in order to provide time and date for the system when
  71. starting up (e.g. GETCLOCK.COM). With CLOCKWORK you never have to use the
  72. SETCLOCK.COM or its equivalent - even after you change the battery!
  73.    The second type, called Real Time Clock, usually found on the PC/AT, 286
  74. and higher or compatibles, is simply read or set by the DOS commands
  75. directly. If you are not quite sure which one you have, you may want to
  76. perform this test: Change the DATE using the DOS routine. Reboot the system
  77. and note whether the date change is still in effect. If the change is
  78. permanent, the system is type 2.
  79.  
  80.                    A TRIAL RUN OF CLOCKWORK
  81.    It can be run from the floppy disk. Write protection of the floppy will
  82. cause an error and abort the program. If that happens, remove the write
  83. protection and restart. Start CLOCKWORK by typing either cwk 1 or cwk 2, at
  84. this point it does not matter which. Then you can try out any of the
  85. functions and features and set your system clock. The menu items have long
  86. titles in order to describe what they do.
  87.  
  88.                    SUGGESTED SETUP
  89.    Step 1: Create a new directory on the c: drive, called CWK (md c:\cwk).
  90.    Step 2: Copy all cwk*.* files from the distribution disk to this
  91. directory (copy a:cwk*.* c:\cwk).
  92.    Step 3: Edit the AUTOEXEC.BAT file. Place these lines after any system
  93. setup and memory management commands but before any shell or Windows
  94. startup:
  95. ...
  96. set cwk=c:\cwk
  97. c:\cwk\cwk ?a
  98. ...
  99. For type 1 system substitute 1 for ?.
  100. For type 2 system substitute 2 for ?.
  101.    Step 4: Change to the directory CWK (cd \cwk) and start the program (cwk
  102. 1 or cwk 2) Change to the menu Mode and select <d> if Daylight saving time
  103. is in effect. Only for type 1 systems: Proceed to menu Setup and press <c>.
  104. When prompted enter the command that was used to set your DOS clock from
  105. the battery clock (e.g. c:\utility\getclock). Exit the program, or continue
  106. with the advanced setup.
  107.  
  108.                    ADVANCED SETUP
  109.    This enables you to take advantage of additional features:
  110.    Step 5: Restart the program or if you did not exit, move to the menu
  111. Setup and select item <z> to enter your time zone of residence.
  112.    Step 6: If you are interested in knowing the local time at the
  113. geographic longitude of your residence, or at any longitude on the globe,
  114. select item <l> and enter the longitude of interest.
  115.    Step 7: Select item <s> in order to change the appearance of the screen,
  116. by entering the color code from the screen sampler.
  117.    Step 8: Select <h> in order to enable recording all system clock
  118. adjustments in the HISTORY.CWK file.
  119.    Step 9: If you have your user code, select <r> to convert the
  120. installation to a registered one.
  121.  
  122.                    PROGRAM SCREEN DESCRIPTION
  123.    The first line on the screen shows the version of CLOCKWORK running,
  124. type 1 or type 2, and the location and name of the data file. The top
  125. border of the display box, above the running clock, has the indication of
  126. system time mode (Standard, Daylight, Universal or Local). Next line shows
  127. the system date and time and is normally running. Below that is the
  128. adjustment indicator line that shows the difference between system time and
  129. adjusted display time in days or seconds. The adjusted display line is also
  130. normally running and is identical to system time. Above the adjusted
  131. display is a block that indicates which date/time element is selected. The
  132. lower box frame will have the indication of adjusted display time mode if a
  133. specific time mode is selected from menu Display.
  134.    Below the display box is the menu selection box and instructions for
  135. moving between the menus and selecting menu items.
  136.  
  137.             CLOCK SPEED MEASUREMENT AND ADJUSTMENTS
  138.    To determine the clock speed, you must correct it twice, best with
  139. several days between corrections. The first time is the beginning of the
  140. clock measurement cycle (F5), the second time is when the clock adjustment
  141. factor is calculated (F8).
  142.    Adjusting the computer clock using CLOCKWORK is done in two steps in
  143. order to make it easier and more accurate. The first step is to adjust the
  144. "ADJUSTED DISPLAY". The second step is to apply the adjustment to the
  145. system clock.
  146.    Freeze the display on the time signal using the space bar and then make
  147. the adjusted display exactly what it should have been. While the display is
  148. frozen, select time or date elements using the horizontal arrow keys and
  149. change them with the vertical keys. Or press the <e> key and enter the
  150. amount of adjustment directly in seconds.
  151.    If your response to the time signal did not seem right, unfreeze the
  152. display and repeat this on the next time signal. The system clock is not
  153. affected by manipulating the adjusted display.
  154.    After the lower display is correctly adjusted, you can adjust the system
  155. clock and start measuring its accuracy: Select menu Clock and use F5 to
  156. adjust the system and indicate the start of a new measurement cycle. You
  157. are given an option to input the adjustment factor. See General Notes below
  158. for adjustment factor definition. (If you determine and enter a value of AF
  159. now, automatic adjustments other than zero will be made when you reboot.)
  160. Then select the Quit menu and exit the program. <Esc> always selects menu
  161. Quit.
  162.    Some time later adjust the display again according to your time signal
  163. and complete the process with F8. The clock speed will have been measured
  164. and the new AF calculated. Subsequent automatic clock adjustments will be
  165. using the latest value of adjustment factor.
  166.    The clock adjustment and accuracy measurement (display adjustment and
  167. F8) should be repeated at a later date to improve the accuracy of the
  168. adjustment factor by averaging over a greater length of time. If an
  169. incorrect adjustment was made, simply adjust the clock again - the program
  170. accumulates repeated adjustments.
  171.    F2 and F4 perform only system clock adjustments. F2 causes the
  172. adjustment to be accumulated and figured into the clock speed measurement
  173. but does not cause immediate recalculation of the adjustment factor. F4
  174. acts as a sort of time zone change and has no effect on adjustment factor
  175. calculation.
  176.  
  177.               IN BRIEF, STEP BY STEP:
  178. First time:
  179.    1. Listen to time signal, freeze the display, remember the time.
  180.    2. While frozen, make the lower display show the time you remember.
  181.    3. Move to Menu Clock, press F5.
  182.    4. Exit program.
  183. Second time, several days later:
  184.    1. Freeze the display, remember the time.
  185.    2. Make the display show the time you remember.
  186.    3. Move to Menu Clock and use F8.
  187.    4. Exit program.
  188. Third and subsequent times: Same steps as second time.
  189.  
  190.                    OTHER UTILITIES AND FUNCTIONS
  191.    HELP TEXT:
  192.    This file can be viewed by pressing F1 key at any time while the main
  193. screen is active.
  194.    DISPLAY MENU:
  195.    The adjusted display can show any of the four time modes after the time
  196. zone and local meridian are filled in under Setup. The appropriate
  197. difference in time is shown. Also the display can be used as a perpetual
  198. calendar and as a calendar calculator. After pressing the <e> key the
  199. adjustment value can be entered in various units, and then changed using
  200. the arrow keys.
  201.    UTILITIES MENU:
  202.    The <a> key performs automatic system clock adjustment on demand. It
  203. performs exactly the same function as CWK 1A or CWK 2A would if entered on
  204. the command line.
  205.    The <d> key selects a days between dates calculator. The entries in this
  206. calculator must be as shown, either a three field date, or a one field
  207. number. Months must be from 1 to 12, days from 1 to 31. Extra days added by
  208. mistake to shorter months are regarded as days of the following month. When
  209. using the calculator again during the same session, the previously used
  210. values are presented for reuse or can be changed.
  211.    The <h> key starts a scan of the clock adjustment history file. Each
  212. line in this file shows the date, time, adjustment in seconds and the
  213. Adjustment Factor in effect up to that time. (The AF is recalculated AFTER
  214. the function F8 was used).
  215.    The <t> key allows for entering the number of time zone lines or date
  216. line crossed if traveling. There is no need to remember whether to add or
  217. subtract hours, just enter the number of time zone lines crossed and
  218. observe the sign of the number and direction of travel convention. The
  219. system clock is adjusted and all data corrected for the new time zone of
  220. residence.
  221.    The <v> key shows some of the contents of the data file, each item
  222. provided with a description. This is very useful when you want to see how
  223. much correction the clock needed, when it was last updated or want to
  224. follow the progress of the averaging process. When the program is first
  225. installed, the initial value of any date is Julian day 0, i.e. -4713/11/24,
  226. time 0:0:0, AF is 1x10^300 and adjustments are zero (1d+300 is a double
  227. precision exponential notation).
  228.    MODE MENU:
  229.    The Mode menu selections adjust the clock and all stored data. The
  230. system clock can run in any one of these modes: Standard (winter) and
  231. Daylight (summer) are obvious. Universal Time Coordinated (UTC) formerly
  232. called Greenwich Mean Time, is the time for time zone centered on the
  233. Greenwich meridian. Universal time is useful for following shortwave
  234. broadcasts, astronomical events, etc. Local Meridian Time is useful in
  235. astronomy. Rise, transit and set of celestial bodies happen on Local
  236. Meridian Time. These phenomena happen "on time" only in the middle of time
  237. zones and when standard time is in use.
  238.    SETUP MENU:
  239.    The default values in a fresh data file make Universal and Local
  240. identical to Standard time until the values for time zone of residence and
  241. longitude of residence or location of interest are entered using Setup menu
  242. keys <l> and <z>.
  243.    The <h> key allows you to enable or disable recording of the adjustment
  244. history. This is recorded in the file named HISTORY.CWK which is placed in
  245. the directory defined by the environment variable cwk. Even if selected,
  246. the recording takes place only when the variable cwk is defined.
  247.    The <s> key shows display combinations of foreground and background
  248. given by the default palette. You can select from these the best
  249. combination for your monitor.
  250.    The <r> key enables entry of user registration code. This code will
  251. change your installation to a registered installation. The program will
  252. then skip the introductory screen, pause, delays and registration reminders
  253. and it will show the registered user's name.
  254.  
  255.                    GENERAL NOTES
  256.    There are no special system requirements. The program can be installed
  257. on the hard drive or a startup diskette. It can be invoked by a batch file
  258. that is run occasionally. It can be used every day or once a month. There
  259. is no limit on the amount of clock adjustment. After a long time it will
  260. simply apply a larger correction. Ambient temperature and computer case
  261. temperature effects will be averaged over a long time.
  262.    This program is not a TSR (Terminate and Stay Resident). It only
  263. corrects the clock when you want it. It does not use any memory or
  264. processor time when not being used.
  265.    Once you begin using this utility, do not set the clock by using the DOS
  266. commands TIME and DATE or any other utility or shell programs. Those
  267. adjustments would not be accounted for! Also, for the same reason, do not
  268. adjust the battery clock by the clock setting utility on type 1 systems. No
  269. matter how far off the battery clock is, CLOCKWORK will adjust the system
  270. clock correctly. (Read more under Troubleshooting.)
  271.    Every automatic system clock adjustment is followed by an announcement
  272. of the amount in seconds. On type 2 systems this number is proportional to
  273. time elapsed since the previous adjustment. On type 1 there are two
  274. numbers, one is proportional to time elapsed since the clock measurement
  275. was started (F5) and the other is a constant offset, the amount of
  276. adjustment made when clock measurement started (F5). The actual amount of
  277. adjustment of the DOS clock during automatic (cwk 1a) adjustment is the sum
  278. of the two. That is the number recorded in the history file.
  279.    CWK 2 tests whether the BIOS (Real Time) Clock is present and
  280. automatically performs different clock setting operations.
  281.    The Real Time Clock on the CMOS chip (BIOS) has one second resolution -
  282. it returns only whole seconds and can be only set to whole seconds.
  283. Measuring any time interval with such a device gives an uncertainty of up
  284. to 2 seconds! DOS is a better timekeeper with 18.2 "ticks" per second.
  285. CLOCKWORK uses the DOS clock resolution in setting the system clock by
  286. using a special technique that prevents the granularity of the BIOS clock
  287. on the CMOS chip from causing errors upon startup and after setting the
  288. time. CLOCKWORK provides information about the relationship between the DOS
  289. and BIOS clocks in the file viewing utility.
  290.    The adjustment factor (AF) is a number of seconds after which one second
  291. correction is required. AF=7000 means that after 7000 seconds one second
  292. must be added. AF=-15000 means that after 15000 seconds one second must be
  293. subtracted. AF=-1 would cause the computer to boot up always with the same
  294. system time!
  295.    It should be noted that both system types, 1 and 2, have two clocks. The
  296. primary one is the Real Time Clock on the CMOS chip on the ATs or the add
  297. on clock on the PCs and XTs. The secondary one is the DOS clock that runs
  298. from the CPU oscillator only when the machine is on and must be always set
  299. when booting up, manually or automatically. The clocks can be quite
  300. different in speed and it leads to interesting interactions. Example: One
  301. of the users has an AT with a slow Real Time Clock (on the CMOS chip), -8
  302. seconds per day, and a very fast DOS clock, 30 seconds per day,
  303. approximately. CLOCKWORK adjusts the Real Time Clock by setting it ahead by
  304. the amount corresponding to 8 seconds per day, but observing the DOS clock
  305. by showing time in the prompt ($t) leads to a different conclusion! The
  306. program aligns the DOS clock to the BIOS clock when it starts, (cwk 2 or
  307. cwk 2a). That always sets his DOS clock back, but any automatic
  308. (proportional) adjustment sets the BIOS clock forward and aligns them
  309. again. As mentioned above, the two clocks are aligned and exact only after
  310. the automatic adjustment was made, by cwk 2a or from the program menu.
  311.    For best results make sure that the system clock adjustment is quite
  312. close to your reference when starting the clock speed measurement (F5). The
  313. adjustment that is done using function F8 is less critical because a small
  314. error can be corrected when repeating F8 later. Long term averaging yields
  315. a very accurate AF.
  316.    It is recommended to avoid adjusting the system clock while the date
  317. change is expected. Do not perform clock adjustments so close to midnight
  318. that the change of date would occur during the process. A few minutes
  319. before or after midnight should be O.K.
  320.    Following are some of the ways of obtaining a time signal. Shortwave
  321. radio WWV or WWVH on 2.5, 5, 10, 15, 20 MHz or CHU on 3.33, 7.335, 14.67
  322. MHz. Many short wave radio stations give time signal on the hour (e.g. BBC
  323. World Service). WWV or WWVH can be also heard by telephone: (303) 499-7111
  324. or (808) 335-4363, respectively. The U.S. Naval Observatory, Washington,
  325. D.C. time signal number is (202) 653-1800, or (900) 410-8463. Many areas
  326. have local telephone numbers that give time, but the accuracy may not be
  327. always guaranteed. Many AM and FM radio stations and TV stations come on
  328. air with amazing accuracy and could be used as a time signal of sorts. Some
  329. of them even give exact time explicitly. Of all these, the U.S. Naval
  330. Observatory time service has the best format for use with CLOCKWORK, with
  331. voice announcements every five or ten seconds, a beep every second and
  332. different tone for every fifth second.
  333.  
  334.                    TROUBLESHOOTING
  335. Problem: The computer appears to show correct time, but the date is off, it
  336. lost one or more days.
  337. Correction: The IBM and some compatible BIOS chips do not change the Real
  338. Time Clock properly when rolling over midnight. This happens when the
  339. machine is on, inactive but sitting in an application that does not make
  340. time of day requests occasionally. It is not a problem with CLOCKWORK. Make
  341. an exception to the general rules mentioned above and set the correct date
  342. using the DOS command DATE. CLOCKWORK will adjust the system correctly
  343. after that.
  344.    If you have this problem and the above solution is not acceptable, try
  345. to use one of the running clock displays that show in the corner of the
  346. screen. These are TSR programs that should not take more than 2kBytes of
  347. RAM. Some are in the public domain, some are shareware. Look for one that
  348. allows turning off the display so it does not interfere with your program
  349. screens and does not override your screen blanker, but keeps running in the
  350. background.
  351.  
  352. Problem: CLOCKWORK makes reasonable corrections daily but an error remains
  353. and correcting it keeps changing the adjustment factor gradually.
  354. Correction: Replace the battery.
  355.  
  356.               CLOCKWORK REGISTRATION AND UPGRADE POLICY
  357.    The idea of shareware is based on a balance of benefits maintained
  358. voluntarily by the users and authors. The user can "try before buy" by
  359. buying the distribution disks or downloading (paying for the telephone
  360. connection).
  361.    To buy the program proper means sending the user/registration fee to the
  362. author. The registration fee is a fraction of prices paid for equivalent
  363. commercial products and there may not even be any equivalent in the
  364. commercial domain.
  365.    Using unregistered shareware programs beyond the trial period is not
  366. right. Having purchased the software that you keep using gives you more
  367. than just peace of mind. There are certain tangible benefits to being a
  368. registered user of this program, as described below.
  369.    CLOCKWORK user/registration fee of $15.- provides the registered user
  370. with these benefits:
  371. 1. Right to use the program beyond the trial period of one month. This is
  372. very important, since CLOCKWORK is not public domain software or
  373. "freeware".
  374. 2. User registration code. You receive your name - code combination when
  375. you register or buy an upgrade. After entering this code under menu Setup,
  376. the program will skip the introduction screen, pause, delays and reminders.
  377. It will show your name as a registered user.
  378. 3. Technical assistance in installation and use. In recognition that any
  379. user is a potential registered user, support is extended to all that
  380. inquire. I can be reached by mail or by phone at 802-457-2654 between 7 and
  381. 9 p.m. weekdays and daytime weekends, Eastern Time.
  382. 4. Information about updates and upgrades. This information is mailed out
  383. immediately upon release of a new revision, which is usually long before
  384. the latest revision is incorporated in the shareware distribution catalogs.
  385. 5. Availability of the latest version directly from the author. Cost of
  386. upgrade is $5.- + $5.- for postage and handling.
  387.    Use the Registration Form that you can print out while running the
  388. program to register as a new user. This form allows for user feedback and
  389. input which is appreciated, but is not a condition for registration.
  390.