MotionBASIC
TM
Error Handler
Loading The Module
The file should contain the information shown in Figure 3. The ’!INCLUDE is a
MotionPRO
TM
directive which tells MotionPRO
TM
to "include" the specified file
when loading or merging the program. The INCLUDE directive contains a
filename which specifies the file to be "included" and the directory where
MotionPRO
TM
can find it. It also contains an optional line number range.
1.
The first number is where to start loading the file. If you don’t specify a
starting line number, it will use the current line number.
2.
The second number is the increment between line numbers. If you
don’t specify an increment, it will use whatever increment was last set
in the controller.
3.
The third number sets the highest line number that you want the file to
use before warning you that the module may be running into line
numbers used by other parts of your program. If you do not specify a
maximum line number, MotionPRO
TM
will not test for one.
In the above example, the include file tells MotionPRO
TM
to load IOMENU.BAS
starting at line number 40000 and using line number increments of 1. It checks
to make sure that the module does not go beyond line number 40999 which
would "crash" into the area used by the next module.
The example then goes on to load ERRMENU.BAS at line 41000 using the
same line number increment and checking for a maximum line number of
41999. Similarly, MENU.BAS and MISC.BAS are loaded at lines 42000 and
43000 respectively, each checking that the module does not exceed number
999 lines in length.
If any module tries to exceeds its maximum line number, MotionPRO
TM
will give
you a warning, which tells you that you are about to overrun the specified range
of line numbers, then aborts the merge.
The value of the !INCLUDE directive is that it allows you to set up separate
"include" files for modules within your overall program. Then, if you edit any
module using the off-line editor, you can merge just that module into the
controller using MERGE "include file name". The maximum line number check
avoids the risk, as a module grows in size, that it might overrun the next
module. This eliminates the need to re-download the whole program every
time you edit a single module.
Your MBTOOLS.BAS "include" file should include just those tools that you want
to use. However, MISC.BAS must be included for the Error Handler to operate
properly. You may wish to adjust the starting and maximum line numbers to
allow for any of your own modules that you want loaded in the controller’s
Setup Area (lines 40000-65535).
NOTE......
The Setup Area in MotionBASIC
TM
versions before 1.0b is limited to lines 60000
to 65535.
4.2 Merging MBTools
page 10
GN3-ERRb
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...