MotionBASIC
TM
Error Handler
Source Code Overview
range error, it calls APPL.ERR.TRAP to trap other application specific
recoverable errors. Finally, if the error is not recoverable, ERR.HDLR executes
a GOTO ERR.ESTOP to shut the machine down.
ERR.ESTOP Routine
ERR.ESTOP shuts the machine down after a non-recoverable fault or error.
First, it calls APPL.ESTOP which is an application specific subroutine to provide
an appropriate E-STOP sequence. It then HALTs all motion, WAITs 500 user
time units and then disables all the servo axes.
After stopping the machine, ERR.ESTOP re-arms the Error Handler so that it
can respond to subsequent faults. MY.ERR is set equal to ERR which returns
the MotionBASIC
TM
error code. MY.ERR is used as an alias for ERR since
MotionBASIC
TM
will not allow the program to reset ERR to zero. It then calls
the ERR.MENU subroutine which displays the faults and waits for operator
actions.
When the program RETURNs from ERR.MENU, ERR.ESTOP executes a
GOTO APPL.RESTART which is an application specific routine to bring the
machine back into normal operation.
ERR.MENU Subroutine
ERR.MENU is the Fault Display Screen. It is called by ERR.ESTOP or directly
by the application program. It prints the initial backdrop for the Fault Display
Screen and then enters a WHILE/WEND loop which loops until the ESCAPE
key is pressed. This loop is the first (outer) of two loops in ERR.MENU.
The outer loop calls ERR.FLTS, ERR.CODES and ERR.AXIS which print the
Controller Fault status, Program Error Code status and Axis Fault status
respectively. It then enters the second (inner) WHILE/WEND loop which loops
until either the ESCAPE or ENTER key is pressed.
The first statement within the inner loop is an INPUT @ statement which will
wait for the operator to press a valid exit key. If the ENTER keys is pressed,
AFAULT@, FAULT@ and MY.ERR are set to zero in an attempt to clear the
faults. If the cause of the fault has not been rectified, the attempt to reset
AFAULT@ and FAULT@ will fail and the variables will indicate whatever faults
remain. MY.ERR is always successfully reset.
The lower portion of the screen is then cleared by calling MISC.CLR5 and the
program exits the inner loop. It then re-executes the outer loop which re-prints
the fault/error status using the new states.
If the ESCAPE key is pressed within the inner loop, the program will exit both
loops and return to the calling routine.
page 24
GN3-ERRb
Содержание MotionBASIC
Страница 3: ...ii...
Страница 5: ...MotionBASICTM Error Handler Table of Contents A3 Complete Program Listings 31 iv...
Страница 6: ...v...
Страница 8: ...vii...
Страница 10: ...MotionBASICTM Error Handler Welcome THIS PAGE INTENTIONALLY LEFT BLANK page 2 GN3 ERRb...
Страница 16: ...MotionBASICTM Error Handler Configuring The Module THIS PAGE INTENTIONALLY LEFT BLANK page 8 GN3 ERRb...
Страница 20: ...MotionBASICTM Error Handler Loading The Module THIS PAGE INTENTIONALLY LEFT BLANK page 12 GN3 ERRb...
Страница 26: ...MotionBASICTM Error Handler Modifying Your Program THIS PAGE INTENTIONALLY LEFT BLANK page 18 GN3 ERRb...
Страница 35: ...MotionBASICTM Error Handler Source Code Overview THIS PAGE INTENTIONALLY LEFT BLANK GN3 ERRb page 27...
Страница 37: ...MotionBASICTM Error Handler Appendix A1 GN3 ERRb page 29...
Страница 38: ...MotionBASICTM Error Handler Appendix A1 THIS PAGE INTENTIONALLY LEFT BLANK page 30 GN3 ERRb...
Страница 40: ...MotionBASICTM Error Handler Appendix A2 THIS PAGE INTENTIONALLY LEFT BLANK page 32 GN3 ERRb...