A programming device for making a program for returning a robot to its
waiting position when the robot is stopped by an error. A robot control
device is connected to the programming device via a network line. When
the robot during operation is stopped by the error, information including
data of a position where the robot is stopped is transferred to the
programming device. The programming device makes the returning program,
based on layout data, the received information and data including
teaching positions and attribute data of the positions, by which the
robot may be returned from the stop position to the waiting position
without interfering with peripheral devices. The returning program is
executed by using an offline simulation function of the programming
device. The program is transferred to the robot control device after it
is judged that interference will not occur. The robot may be safely
returned to the waiting position by executing the returning program.