MotionBASIC
TM
Error Handler
Source Code Overview
ERR.FLTS Subroutine
ERR.FLTS displays the status of the Controller Faults. It uses MY.FAULT as
an alias for the FAULT@ variable, this allows it to be set to the current status
of the E-STOP OK input and Program Error status. MotionBASIC
TM
does not
allow the program to set FAULT@ to a non-zero value.
ERR.FLTS will print either "No Controller Faults" or will itemize the faults that
are present. Since more than up to nine faults can exist simultaneously,
ERR.FLTS prints active faults in three columns to conserve screen space.
ERR.CODES Subroutine
ERR.CODES prints information about program error codes based on the
MY.ERR (alias ERR) and ERL functions. It prints either "No Program Errors"
or a text description of the error and the line number at which it occurred.
Since the error messages differ in length, the subroutine lays down a
rectangular backdrop before printing the information. This avoids a "ragged
right" outline on the messages.
ERR.AXIS Subroutine
ERR.AXIS prints the axis fault status. First, it prints a backdrop which includes
a list of all possible axis faults. It then loops through all installed axes printing
the axis name and calling ERR.AFLT and ERR.APRN. Within the loop it tests
MY.FAULT to determine whether an axis fault was responsible for the initial
error. If it was, it compares the axis ID to the AXIS.FLT1@ variable which
indicates the first axis to fault. An arrow is printed to indicate which axis faulted
first.
ERR.AFLT Subroutine
This subroutine copies the fault status of an axis into the AFLT( ) array. This
action makes displaying the mixture of numerical and TRUE/FALSE information
simpler.
If the axis does not appear in AXIS.LIST@ then the program cannot check the
axis fault status. This indicates that the DSP module is either not installed or
has a hardware problem. In such cases, ERR.AFLT sets the value of the
AFLT(3) array element to one to indicate a DSP problem.
The OTL.FWD@ and OTL.REV@ flags are multiplied by -1. This converts a
TRUE (-1) indication to 1 but does not change a FALSE (0) indication. The
result is then used as the index for the FLAG$( ) array variable in ERR.APRN.
ERR.APRN Subroutine
ERR.APRN prints the axis fault data for one axis. It sets the screen colors
depending on whether the item indicates a problem or not. It then prints
GN3-ERRb
page 25
Summary of Contents for MotionBASIC
Page 3: ...ii...
Page 5: ...MotionBASICTM Error Handler Table of Contents A3 Complete Program Listings 31 iv...
Page 6: ...v...
Page 8: ...vii...
Page 10: ...MotionBASICTM Error Handler Welcome THIS PAGE INTENTIONALLY LEFT BLANK page 2 GN3 ERRb...
Page 37: ...MotionBASICTM Error Handler Appendix A1 GN3 ERRb page 29...
Page 38: ...MotionBASICTM Error Handler Appendix A1 THIS PAGE INTENTIONALLY LEFT BLANK page 30 GN3 ERRb...
Page 40: ...MotionBASICTM Error Handler Appendix A2 THIS PAGE INTENTIONALLY LEFT BLANK page 32 GN3 ERRb...