AtomClock V.1.0 by Art Steinmetz Compuserve ID: 76044,3204 or FidoNet Amiga Echos INTRODUCTION AtomClock will dial the U.S. Naval Observatory in Washington D.C., read the 1200 BAUD time signal their atomic clock puts out and set the Amiga system clock accordingly. It runs from Workbench or CLI. The default configuration will work with a Hayes-type modem but parameters can be adjusted for just about any modem. Written in Benchmark Modula 2. Good example of serial port access and reading icon TOOLTYPES. QUICKSTART (absolute minimum docs) If you have a Hayes-Type Modem and live on Eastern Standard Time you are ready to go. Click on the icon and sit back. If it is Daylight Savings or you live in a different zone you must change this parameter. Use INFO from the Workbench menu and change the TimeZone TOOLTYPE from EST to your zone (e.g. PDT, MST, etc). Alternatively you can use the "z" argument from CLI. ATOMCLOCK Z/EDT will run AtomClock and set your Amiga for Eastern Daylight Time. That's it. It is your responsibility to set the hardware clock or the Amiga will forget the newly set time when you turn it off. There are so many hardware clocks out there I opted against including that feature in the program. If you have an Amiga 2000 or A500/A501 open a CLI and type SETCLOCK OPT SAVE after you run ATOMCLOCK or click on the HARDSET icon included. HARDSET will do the job from Workbench. AtomClock recognizes those time zones between Eastern and Pacific, daylight or standard. It also knows GMT or UTC. If you live outside read on. If you have an uncommon modem read on. INSTRUCTIONS Every possible parameter of ATOMCLOCK can be set by command line arguments and/or TOOLTYPES in the INFO record from Workbench. To change any parameter from Workbench select the AtomClk icon and choose INFO from the Workbench menu. The TOOLTYPES field has up and down arrows you can click on to scroll through the parameter list. Find the one you want to change and click on the text. Change only the text to the RIGHT of the equals sign. For instance, in April, you would want to adjust AtomClk for daylight savings time so you would change TimeZone=EST to TimeZone=EDT. When you are done hit the Return key and click on SAVE. If you use the CLI you change parameters when you run AtomClk with command line parameters. Each arg. is represented by a single letter followed by a slash followed by the parameter. For example if you currently are living on Central Standard Time you will invoke AtomClk by typing: ATOMCLK z/CST Arguments can be in any order. Unlike the Workbench INFO method, parameter changes are not saved so you have to use the same argument each time. For this reason a batch file is recommended if you have a lot of parameter changes. The various parameters are below. 99% of you will only have to change the time zone parameter...ever (I hope). TOOLTYPE CLI FUNCTION DEFAULT -------- --- ---------------------------- ----------- TimeZone z Time zone (i.e. EST, PDT). EST Use GMT with "o" flag below if zone is not range EDT..PST. Offset o Hours offset from GMT. Ignore -5 if you live in a supported time zone. BAUD b BAUD rate. 1200 PhoneNumber n Phone number 1-202-653-0351 Prefix p Modem dial prefix ATDT Reset r Modem reset string ATZ^M Calls c Max call attempts 3 Tries t Try to read X lines before 20 giving up (avoids reading line noise forever). Suffix s Modem dial suffix ^M (Enter) Busy b Modem 'busy' message. BUSY NoAnswer w Modem 'no answer' message. NO CARRIER Typing ATOMCLOCK without any arguments is equivalent to typing ATOMCLOCK z/EST o/-5 b/1200 n/1-202-653-0351 p/ATDT r/ATZ^M c/3 t/20 s/^M b/BUSY w/NO CARRIER A word about time zones for those of you not living between New York and L.A. You have to calculate how many zones you are from Greenwich, England yourself. Suppose you hang out in Paris, one zone west (I suppose) from Greenwich Mean Time. You would make the TimeZone GMT (or UTC) and make the Offset 1. From CLI: ATOMCLK z/GMT o/1. Nothing to it. DISTRIBUTION ARCHIVE NOTES I've tried to make this as "Workbenchable" as possible. Aside from the program being runnable from Workbench, an icon for the docs. Likewise IXECUTE is provided only to run the HARDSET batch file from WB. It can only be called from a PROJECT. If you double click on the IXECUTE icon you'll be sorry. If you want to keep IXECUTE and you move 'em to a different directory, say C:, change the DEFAULT TOOL for ATOMDOC and HARDSET to, say, C:IXECUTE, respectively. PROGRAMMING NOTES This was an exercise in the, well, modularity of Modula 2. This was a fairly simple project because I didn't do a lot of the work. I took off the shelf modules written by other folks and just linked 'em in. They do the low level work of the program while I just designed and wrote the front end. The readability of Modula makes this a snap to do with even sparsely commented code. Authors of the routines used here are equal (if unknowing) partners in the venture. Mark Olbert provided the date and string routines. Steve Faiwiszewski provided the rather tricky (read "way over my head") serial port routines. Thanks also to Steve for help with support for generic modems. Any remaining bugs are, of course, my fault but your tough luck (Hey, the source is free). All of my code is placed in the public domain. Enjoy. Steve and Mark have appropriate notices in their code. Everything in this distribution archive is freely redistributable. -- Art Steinmetz 9/24/88