Documentation for PC-RELAY Kit 74, DOS based utilities October 1995. There are three DOS-based utilities that accompany the PC-RELAY kit: 1. RELAY used to output a hex byte to the designated parallel port 2. DELAY used to wait for a user defined number of seconds 3. WAITFOR used to wait until a specified time (HH:MM) Batch files using these programs can be written to control the operation of any of the eight relays on the PC-RELAY board. The programs were written using Borland Turbo C/C++ 3.0. The original C source code is also provided. RELAY.EXE Syntax: RELAY or RELAY/1 or RELAY/2 Output the to the specified parallel port. The value of can be in the range 00h to FFh. The parallel port can be specified following the command name (see command syntax). If none is given then LPT1 is used by default. Example: RELAY 5A Outputs the hex value 5A (binary 0101 1010) to LPT1, causing relays RL7, RL5, RL4 and RL2 to operate. DELAY.EXE Syntax: DELAY Waits for the number of before exiting. The maximum number of seconds allowed is 32,767. The program does not test for values greater than 32,767 or less than 0. During operation, the remaining number of seconds is displayed. The program can be terminated at any time by pressing the "ESCAPE" key. Exiting via the "ESCAPE" key causes the program to return an exit code of "1". This condition can be detected within batch files using the "IF ERRORLEVEL ..." command. Example: DELAY 100 Causes the program to wait until 100 seconds has elapsed before exiting. WAITFOR.EXE Syntax: WAITFOR Waits until the specified time is reached before exiting. A 24 hour clock is used to specify the time. The program does not test for invalid time settings eg. 25:00 or 12:75, etc. During operation, the current time in HH:MM:SS is displayed and updated every second. The program can be terminated prematurely by pressing the "ESCAPE" key. Exiting via the "ESCAPE" key causes the program to return an exit code of "1". This condition can be detected within batch files using the "IF ERRORLEVEL ..." command. Example: WAITFOR 18:30 Causes the program to wait until 6:30pm before exiting. The following short batch file illustrates the use of the three utilities. The batch file waits until the time is 11:00am and then sequentially operates each relay in turn for 5 seconds. Pressing the "ESCAPE" key during operation causes the batch program to terminate immediately. All relays are released upon exit. waitfor 11:00 @if errorlevel 1 goto end relay 01 delay 5 @if errorlevel 1 goto end relay 02 delay 5 @if errorlevel 1 goto end relay 04 delay 5 @if errorlevel 1 goto end relay 08 delay 5 @if errorlevel 1 goto end relay 10 delay 5 @if errorlevel 1 goto end relay 20 delay 5 @if errorlevel 1 goto end relay 40 delay 5 @if errorlevel 1 goto end relay 80 delay 5 :end relay 00 --------------------------------------------------------------------