STE 58762
- -
2-1
CHAPTER 2
WRITING PROGRAMS IN ROBOT LANGUAGE
In Chapter 1, we got a rough idea of what a robot language is and how it works. Now, in Chapter
2, we will describe how to write a program in robot language.
2.1 PROGRAM CONFIGURATION
Below we present a general outline of program configuration with the SCOL language.
2.1.1 Files
In order to get the robot to perform a task, you need both a program written in robot language and
positional data for use by the program. That is, for each job you want the robot to do, you have to
have a matched set of a program (or programs) and data. This matched set is called a file.
Program editing, execution, saving and loading are all done in units of files.
2.1.2 Program
A program is an arrangement of words in robot language that tell the robot what you want it to do.
A program may "call" (use) other programs from inside of the original program. The original
program is referred to as the main program. These other programs are called subprograms since,
from the point of view of the main program, they are secondary. It is often convenient to make
sub- programs for sequences that are used often or for sequences that are more or less self-
contained. These subprograms can then be called when you need them. Subprograms save you
the trouble of having to write the same thing many times and, if used properly, can make your job a
lot easier.
You can include many programs in a single file. Unless you specify differently (in the command
lines at beginning of the file), the robot will assume that the first program in your file is the main
program. In order to call a subprogram, the subprogram must be in the same file as the main
program. Also, just because you may have several programs lined up in the file does not
necessarily mean that all the programs will be executed. As far as the robot is concerned, its job is
over when the main program is completed (i.e., when the robot reaches the final END statement of
the main program), and if the other programs have not been called by that time they will never be
called.
A plural number of programs can be executed at the same time, using the TASK command
(multitask execution). For details of the multitask execution, see Para. 2.8.