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
Содержание DMC-42 0 Series
Страница 85: ...Chapter 6 Programming Motion 81 DMC 42x0 User Manual Figure 6 14 ECAM cycle with Z axis as master...
Страница 195: ...ICM 2900 PCB Layout Appendices 191 DMC 42x0 User Manual...
Страница 205: ...CB 50 100 Drawings Appendices 201 DMC 42x0 User Manual...
Страница 206: ...Appendices 202 DMC 42x0 User Manual...
Страница 207: ...Appendices 203 DMC 42x0 User Manual...
Страница 208: ...Appendices 204 DMC 42x0 User Manual...
Страница 209: ...Appendices 205 DMC 42x0 User Manual...
Страница 210: ...Appendices 206 DMC 42x0 User Manual...
Страница 211: ...Appendices 207 DMC 42x0 User Manual...
Страница 214: ...CB 50 80 Drawing Appendices 210 DMC 42x0 User Manual...
Страница 215: ...Appendices 211 DMC 42x0 User Manual...