Digital Electronics: How to Create a Command Script in Kit 74 DOS
Kit 74 DOS software, used to control your electronic projects through a parallel port, consists of three commands — RELAY, DELAY, and WAITFOR. You can easily create command scripts that can execute a series of RELAY commands in sequence.
Just use Notepad (the simple text editor that comes free with all versions of Windows) to enter a series of RELAY commands, one on each line. Save the file to the C:\k74_dos folder, using the file extension .bat. Then you can run your script by typing the name of your script file (without the .bat extension) in the MS-DOS command window.
Notice that this script contains two identical RELAY commands because of the bug in the RELAY command that requires you to run the command twice to get it to work.
On an older Windows XP computer (the kind that’s likely to have a parallel port to play with), you’ll find Notepad in the Start menu under Accessories.
Besides the RELAY command (and the DELAY and WAITFOR commands), you often use two special MS-DOS commands in command scripts. The first command is called a label; it lets you give a name to a line in your script. Labels are indicated by a colon followed by a short word. :LOOP is a typical label.
The second command, called GOTO, creates a program loop by telling the script to jump to a label. Labels and GOTO commands are always used together, like this:
:LOOP RELAY FF RELAY FF GOTO LOOP
This sequence of commands causes the two RELAY commands to be executed. Then the GOTO command sends the script back to the :LOOP label command, which executes the RELAY commands again. The commands between the GOTO command and the label will be executed again and again until you stop the script by pressing Ctrl+C or closing the command window.
Here is a simple script that quickly flashes the LEDs in sequence, beginning with LED1. When the script gets to LED8, it reverses the direction and then flashes the LEDs back to LED1. Then a GOTO command sends the script back to the :LOOP label to repeat the flashing. The resulting effect is that the LEDs sweep back and forth indefinitely.
This script is named CYLON.BAT because it resembles the flashing eyes of the evil Cylons from the classic science-fiction TV series Battlestar Galactica.
:LOOP RELAY 01 RELAY 01 RELAY 02 RELAY 02 RELAY 04 RELAY 04 RELAY 08 RELAY 08 RELAY 10 RELAY 10 RELAY 20 RELAY 20 RELAY 40 RELAY 40 RELAY 80 RELAY 80 RELAY 40 RELAY 40 RELAY 20 RELAY 20 RELAY 10 RELAY 10 RELAY 08 RELAY 08 RELAY 04 RELAY 04 RELAY 02 RELAY 02 RELAY 01 RELAY 01 GOTO LOOP