| |
Backward execution |
Backward execution
A program can be executed backwards one instruction at a time. The following general restrictions are valid for backward execution:
Backward handlers
Procedures may contain a backward handler that defines the backward execution of a procedure call.The backward handler is really a part of the procedure and the scope of any routine data also comprises the backward handler of the procedure.
Example: PROC MoveTo ()
MoveL p1,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
MoveL p4,v500,z10,tool1;
BACKWARD
MoveL p4,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
MoveL p1,v500,z10,tool1;
ENDPROC
When the procedure is called during forward execution, the following occurs:

PROC MoveTo ()
.. MoveL p1,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
.. MoveL p4,v500,z10,tool1;
BACKWARD
MoveL p4,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
MoveL p1,v500,z10,tool1;
ENDPROC
When the procedure is called during backwards execution, the following occurs:
Instructions in the backward or error handler of a routine may not be executed backwards. Backward execution cannot be nested, i.e. two instructions in a call chain may not simultaneously be executed backwards.A procedure with no backward handler cannot be executed backwards. A procedure with an empty backward handler is executed as "no operation".
Limitation of move instructions in the backward handler
The move instruction type and sequence in the backward handler must be a mirror of the move instruction type and sequence for forward execution in the same routine:

PROC MoveTo ()
.. MoveL p1,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
.. MoveL p4,v500,z10,tool1;
BACKWARD
MoveL p4,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
MoveL p1,v500,z10,tool1;
ENDPROC
Note that the order of CirPoint p2 and ToPoint p3 in the MoveC should be the same.By move instructions is meant all instructions that result in some movement of the robot or external axes such as MoveL, SearchC, TriggJ, ArcC, PaintL ...