A robot controller capable of automatically preparing a job program for a
workpiece configured of a plurality of job elements is disclosed. A
plurality of teaching programs for teaching the job for each job element
making up the workpiece are stored in advance. Each teaching program has
registered therein attribute information including the item number
(identification information) and the sequence of application of the
teaching program to each workpiece. The robot controller retrieves
teaching programs having registered therein, as attribute information,
the same item number as the input item number of the workpiece and
prepares a main program such that the retrieved teaching programs are
called sequentially as subprograms in accordance with the application
sequence specified by the attribute information. Further, commands for
moving to the job starting position and the job end position are added
before and after the main program thereby to complete the main program.
Based on the main program thus prepared, the robot controller controls
the robot operation.