Cover Page Prev Page Next Page About

KAutoRun - Station Automation


WinOrbit provides the capability to automatically execute any Windows or DOS program at a predetermined time before or after AOS for the satellite in any Map Window. A limited capability to send commands to the programs is provided also. To enable this feature, you need to do two things: turn on AutoRun in the Map Window Options Menu; and set up a .SKD file (e.g. AO-13.SKD) specifying the actions to be taken. Setup of the .SKD file is covered below. Unfortunately, due to the enormous variety of possibilities, this setup is not nearly as intuitive as the rest of WinOrbit. Read this discussion carefully, and examine the sample files carefully, before starting. Please note: this is a new feature which has not been tested extensively. If it doesn't work for you after trying various possibilities, send me the details and I'll see if I can figure out why and how to fix it. K8CG Nov 1995.


What does it do ?


The AutoRun feature recognizes four events, which may or may not be distinct. These are:
* Start of program. This occurs on the first calculation interval, during which the feature is enabled, after AOS +/- a specified time. This might be AOS - 10 minutes, for example.
* AOS. This occurs immediately after the start of program, and also at the corresponding time on subsequent passes, if the program is not terminated after the first pass (see below).
* LOS. This occurs at LOS +/- specified time.
* Exit of program. This occurs immediately after the LOS event, if the ExitAfterLOS flag is True. Otherwise it never happens.
For each of these events, you can specify a Windows command string and/or a DOS command string. The strings can be blank if no command is needed for that event.


Information You Will Need


Before setting up the file, you will want to decide exactly what actions should be taken for each event. Run the program manually, and determine the following information. If you aren't sure about some of the items, you may be able to find out more by looking at the Windows Program Manager item for this program, and choose "File:Properties" to see the default directory, command line, and so on.. The examples here assume you will run the "Dove Telemetry Decoder v2.0" by Bruce Forsberg, WB61ZG, or the Windows 3.1 "Terminal" program:
* Default directory (usually the directory where your program is located). This is where your program may look for data files, configuration files, etc. For example: C:; or C:.
* Command line (usually the program file name). May contain optional parameters, such as a data file name to load. For our examples, this would be "DOVE.EXE" (no parameters) or "TERMINAL PK232.TRM" (specifies the terminal definition file to use). Note that .EXE, .PIF, and .BAT files can all be run in this way.
* Time to start the program, relative to AOS for this satellite. If you're going to turn on radios, move antennas, etc., you may need extra time. Even if you're just collecting telemetry or picture data, you might want to start a minute or two before the predicted pass. Times before AOS are negative. Times are in minutes in the .SKD file.
* Keystrokes to be executed when your program starts, at (subsequent) AOS events, at LOS events, and when (if) the program exits. Write down exactly what you want "typed" - for example: alt-space, X, alt-F, l,myfile.log,return to start a log file in DOVE, or alt-c, t, to record all information in Terminal. DOS program keystrokes must go on a separate line, as indicated in the example.
* The taskname of your program when it is running. You can find this out by looking at the Program Manager's Task List (double-click on the Windows desktop, or click the "Control Box" in the upper left corner of a window and choose "Switch To...") while the program is running. Note that this often contains a file name or other information that may change while the program runs. If this is the case, you may not be able to send keystrokes or terminate the program, since WinOrbit will look for the exact task name you give it.
* Exit status - What to do with the program after LOS. The choices are: keep it running indefinitely; or Exit (via specified keystrokes) a specified number of minutes after LOS.
* Priority for this satellite. If the same program is called by a second satellite, after being started by a first, a conflict will occur. The second request will be ignored unless it has a higher priority number than the first request. In the latter case (second call has higher priority), the LOS keystrokes will be sent immediately to the first instance of the program, after which it will be terminated, and then AutoRun for the second satellite will be initiated.
* Special resources, such as a COM port, which cannot be shared with other programs. The priority conflict resolution will be applied when two programs with the same resource are called.


Creating the .SKD file


Once you have all of this information, you are ready to enter it into the file. You can copy and rename one of the sample files that came with the program, and edit it using Windows NotePad (This process is conveniently started from the Map Window Edit Menu or Satellite Information Window Edit Menu. The .SKD file is in the same format as a Windows .INI file. Comments begin with a semicolon (;) and are ignored. The sample files have all of the fields filled in, but one or more can be omitted if not needed, or simply left blank. Do not use quotes (", or ') around the text strings.


Notes


The only field that needs explanation beyond the comments in the sample file is the Keystrokes entry. The format here follows the Visual Basic "SendKeys" prescription. Any keyboard key is represented by its normal character. Keys with "alt", "control" or "shift" are preceded with "%","^", or "+", respectively. Special keys (function keys, tab, return) are surrounded by curly braces ({, }). So for example to put the date in and save a file in NotePad, you need F5,alt-F,A,myfilnam.txt,<enter>. This translates to {F5}%FAmyfilnam.txt{ENTER}. Sometimes it is necessary to have a filename that changes dynamically, for example a separate log file for each orbital pass. This can be accomplished by using the special code {FILNAM} : for example, {FILNAM}.LOG in the keystrokes entry for DO-17.SKD will cause filenames DO-17450.LOG to be created on orbit 30450, DO-17451.LOG on orbit 30451, and so on (note use of the last few digits of the orbit number, and the user-supplied extension).


Testing AutoRun


After setting up and saving the .SKD file, choose AutoRun Test in the Options Menu of the relevant Map Window. This will re-read the .SKD file and execute the procedure immediately, and help you to debug your setup by seeing the results without waiting for the next pass.


Converted by Winhelp to Web