DMC-1400 Series Command Reference #CMDERR 55
#CMDERR
FUNCTION: Command error automatic subroutine
DESCRIPTION:
Without #CMDERR defined, if an error (see TC command) occurs in an application program
running on the Galil controller, the program (all threads) will stop. #CMDERR allows
the programmer to handle the error by running code instead of stopping the program.
USAGE:
While Moving Yes
In a Program Yes
Command Line No
Controller Usage ALL
RELATED COMMANDS:
TC Tell Error Code
_ED Last program line with an error
EN End routine
EXAMPLES:
#BEGIN ;'Begin main program
IN “ENTER SPEED”,Speed ;'Prompt for speed
JG Speed
BGX ;'Begin motion
EN ;'End main program
#CMDERR ;'Command error utility
JP#DONE,_ED<>2 ;'Check if error on line 2
JP#DONE,_TC<>6 ;'Check if out of range
MG "SPEED TOO HIGH" ;'Send message
MG "TRY AGAIN" ;'Send message
ZS1 ;'Adjust stack
JP #BEGIN ;'Return to main program
#DONE ;'End program if other
error
ZS0 ;'Zero stack
EN1 ;'End routine
NOTE: An application program must be executing for the automatic subroutine to function, which
runs in thread 0.

NOTE: Use EN to end the routine.