6K Troubleshooting - How do I Know what Error Started the Error Program
The ERRORP and ERROR commands allow the 6000 or 6K program to goto an error program when an error occurs. The ERROR command enables which errors you will be monitoring and which ones will cause it to run the error program. The ERRORP command defines which program will run when the error occurs(be sure to use set the ERRORP command before the ERROR command). You can enable several errors to cause it to run the ERRORP program, but you can only define one ERRORP program. To determine what error caused the ERRORP program to run, you can capture the error into a binary variable. The command would be VARB1=ER. Please refer to the example below.
DEL MAIN ;Deletes previous MAIN program
DEF MAIN ;Defines new MAIN program
ERRORP FAULT ;Defines FAULT as the ERROR program
ERROR111111111111111111 ;enable all errors to run to ERRORP
END
DEL FAULT ;Deletes previous FAULT program
DEF FAULT ;Defines new FAULT program
VARB1=ER ;Places ER bits into VARB1
ERROR000000000000000000 ;Disable error checking. This is
;so the FAULT program will not
;continuously run because of the
;original error
VARB1 ;Prints VARB1 to terminal screen
JUMP MAIN ;Jump back to MAIN program
END