#ININT Input
Interrupt
STXW;AM Stop
Motion
#TEST;JP #TEST, @IN[1]=0
Test for Input 1 still low
JG 30000,,,6000
Restore Velocities
BGXW Begin
motion
RI0
Return from interrupt routine to Main Program and do not re-enable trippoints
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 trip point
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
IN "ENTER SPEED", SPEED
Prompt for speed
JG SPEED;BGX;
Begin motion
JP #BEGIN
Repeat
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
134
•
Chapter 7 Application Programming
DMC-1600