Galil COMMAND REFRENNCE DMC-1400 Manual De Usuario

Descargar
Página de 235
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: 
Tell Error Code 
Last program line with an error 
End routine 
EXAMPLES: 
#BEGIN
                   ;
'Begin main program 
  
IN
 “ENTER SPEED”,Speed ;
'Prompt for speed 
  
JG
 Speed  
  
BG
X
                    ;
'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 
  
ZS
1                    ;
'Adjust stack 
  
JP
 
#BEGIN
              ;
'Return to main program 
  
#DONE
                  ;
'End program if other  
 
        
 
error 
  
ZS
0                    ;
'Zero stack 
EN
1                      ;
'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.