MotionBASIC
TM
Error Handler
Source Code Overview
11.
Each level of FOR/NEXT, WHILE/WEND and IF statements is indented
by 2 spaces.
12.
All modules are written without file line numbers.
14.
Block comments are prefixed with a "double tick" so that only the
subroutine name is downloaded to the controller. Full comments are
available in source listings and through the MBTOOLS.HYP Hypertext
help file.
15.
Wherever practical, modules are written to allow configuration changes
using DATA statements rather than changes to in-line code.
16.
All program lines are less than 75 characters long to avoid wrap around
on listings.
6.1 Faults vs Errors
MotionBASIC
TM
handles all exception conditions by generating an error. The
type of error is determined by checking the ERR function. Faults are a special
class of error caused by an asynchronous events which are usually hardware
related. Non-Fault errors are generally the result of a problem with the
MotionBASIC
TM
application program.
The ERR function reports the most recent error that interrupted execution of the
program. Therefore, only one error can exist at a time. If a second error
occurs before the first is cleared, MotionBASIC
TM
will reset the ERR function to
report only the most recent error. On the other hand, several faults can exist at
the same time and the FAULT@ variable will always report all faults that have
not been cleared.
Any attempt to clear an error will always succeed, unless the code executed in
clearing the error creates another error. Faults can only be cleared is the
hardware problem causing the fault has been corrected. For example, if the
encoder channel A wiring goes open circuit, the Fault Display will indicate the
following:
Controller Faults:
Axis Fault
- FAULT@ bit 7 asserted
Program Error:
Axis Fault
- ERR=1911
Axis Faults:
Open Wire ENCA
- AFAULT@=102
When you clear the faults without fixing the wiring, the Fault Display will report:
Controller Faults:
Axis Fault
- FAULT@ bit 7 asserted
Program Error:
No Program Errors
Axis Faults:
Open Wire ENCA
- AFAULT@=102
Once you fix the problem, clearing the faults will make all of the problem
messages go away.
NOTE......
Whenever a controller fault exists, the NO-FAULT relay contacts will be open.
These contacts should be wired into your E-STOP circuit.
page 20
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...