Subroutine 31 (SUB 31) is used specifically for error handling and is executed whenever an error occurs. If SUB 31 is not defined, the program will cease execution and go into an error state.

How errors are addressed can be coded in SUB 31.  Conditional statements that check for specific error conditions can execute additional operations, depending on the error conditions.  Typically, the code within subroutine 31 will contain the standalone command ECLEAR[axis] in order to clear the current error. Sections 5.4.7 Standalone Example Program 7 – Single Thread with error handling, 5.4.9 Standalone Example Program 9 – Multi-thread with subroutine, and 5.4.10 Standalone Example Program 10 – Multi-thread with subroutine contain examples of using subroutine 31 to perform error handling.

The return jump from subroutine 31 will be determined by the ASCII command SAP. Write a "0" to this setting to have the standalone program jump back to the last performed line. Write a "1" to this setting to have the standalone program jump back to the first line of the program.

Value

Description

0

Return to last excited line

1

Return to first line of program

SAP command


< Previous Section | Topic Home | Home |  Next Section  >