MotionBASIC
TM
Error Handler
Source Code Overview
The Error Handler then goes on to call the ERR.MENU subroutine which
displays the machine fault status and waits for the operator to initiate actions
through the keyboard.
6.3 Description Of Subroutines
ERR.INIT Subroutine
ERR.INIT is the initialization routine for the ERRMENU module. It must be
called before the Fault Display Menu can be displayed and before any faults or
errors can be handled. It checks a string variable called ERR.VER$ to
determine whether the modules has already been initialized. If this variable has
been set to the correct version number, ERR.INIT erases its variable arrays
before continuing. Failure to do this would result in a redimensioned array
error.
The modules is re-initialized every time the program is started to ensure that
ERR.INIT takes care of any changes to the ERR.DATA configuration since the
last RUN command.
ERR.INIT dimensions 5 array variables, these are:
FLAG$(1)
Stores the strings "ok" and "bad" for use in printing
axis fault status.
FAULT$(8)
Stores string messages that describe controller faults.
AXNAM$(8)
Stores user-defined names for each of the axes.
AFLT(7)
Used as temporary for the status eight possible axis
fault conditions.
BINARY&(8)
Stores the binary axis identification for each of the
axes.
ERR.INIT then reads a string that represents the set of axes that must be
installed and healthy for your application to run successfully. This is converted
to a long integer and stored in a variable called REQD.AXES&.
The initialization routine then goes on to read the user defined names for the
axes included in REQD.AXES&. In the process of reading these names, it
determines the length of the longest name for use in formatting the axes fault
display. It stores this length in ERR.LEN.
ERR.INIT then assigns values to the FLAG$( ) and FAULT$( ) string arrays.
Before leaving ERR.INIT, it sets ERR.VER$ to the current version number as a
flag to indicate the module has been initialized. This flag will be reset by a
LOAD, CLEAR or RUN command.
ERR.HDLR Routine
ERR.HDLR is called automatically whenever a fault or error occurs. It tests for
range errors resulting from INPUT @ data entry statements and if MENU.BAS
is present, calls the MENU.ERR subroutine. If the error is not an INPUT @
GN3-ERRb
page 23
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...