![Galil Motion Control DMC-42 0 Series User Manual Download Page 119](http://html1.mh-extra.com/html/galil-motion-control/dmc-42-0-series/dmc-42-0-series_user-manual_3267467119.webp)
Example - Motion Complete Timeout
#BEGIN
Begin main program
TW 1000
Set the time out to 1000 ms
PA 10000
Position Absolute command
BGX
Begin motion
MCX
Motion Complete trippoint
EN
End main program
#MCTIME
Motion Complete Subroutine
MG “X fell short”
Send out a message
EN
End subroutine
This simple program will issue the message “X fell short” if the X axis does not reach the commanded position
within 1 second of the end of the profiled move.
Example - Command Error
#BEGIN
Begin main program
speed = 2000
Set variable for speed
JG speed;BGX;
Begin motion
#LOOP
JG speed;WT100
Update Jog speed based upon speed variable
JP #LOOP
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
EN
End program
The above program prompts the operator to enter a jog speed. If the operator enters a number out of range
(greater than 8 million), the #CMDERR routine will be executed prompting the operator to enter a new number.
In multitasking applications, there is an alternate method for handling command errors from different threads.
Using the XQ command along with the special operands described below allows the controller to either skip or
retry invalid commands.
OPERAND
FUNCTION
_ED1
Returns the number of the thread that generated an error
_ED2
Retry failed command (operand contains the location of the failed command)
_ED3
Skip failed command (operand contains the location of the command after the failed
command)
The operands are used with the XQ command in the following format:
XQ _ED2 (or _ED3),_ED1,1
Where the “,1” at the end of the command line indicates a restart; therefore, the existing program stack will not be
removed when the above format executes.
The following example shows an error correction routine which uses the operands.
Chapter 7 Application Programming ▫ 115
DMC-42x0 User Manual
Summary of Contents for DMC-42 0 Series
Page 195: ...ICM 2900 PCB Layout Appendices 191 DMC 42x0 User Manual...
Page 205: ...CB 50 100 Drawings Appendices 201 DMC 42x0 User Manual...
Page 206: ...Appendices 202 DMC 42x0 User Manual...
Page 207: ...Appendices 203 DMC 42x0 User Manual...
Page 208: ...Appendices 204 DMC 42x0 User Manual...
Page 209: ...Appendices 205 DMC 42x0 User Manual...
Page 210: ...Appendices 206 DMC 42x0 User Manual...
Page 211: ...Appendices 207 DMC 42x0 User Manual...
Page 214: ...CB 50 80 Drawing Appendices 210 DMC 42x0 User Manual...