Do you have a question about the MotionBASIC and is the answer not in the manual?
Questions and answers
Summary of Contents for Ormec MotionBASIC
Page 1
MotionBASIC MotionBASIC Tools Tools MotionBASIC Tools Error Handler Software Module Software Manual GN3-ERRb Copyright (c) 1990 Ormec Systems Corporation All Rights Reserved 19 Linden Park Rochester, NY 14625 (716) 385-3520 September 7th, 1990...
Page 2
ORMEC. WARRANTY ORMEC extends no warranty with respect to the merchantability or fitness for any particular purpose for this software. It is the customer’s responsibility to determine whether it is suitable for the specific application and whether it meets performance, reliability, and safety requirements when used in that application.
Page 4
MotionBASIC Error Handler Table of Contents TABLE OF CONTENTS 1. Welcome ........... .
Page 5
MotionBASIC Error Handler Table of Contents A3. Complete Program Listings ........31...
MotionBASIC Error Handler List of Figures LIST OF FIGURES Figure 1, Fault Menu Screen ........
Page 9
Welcome 1. Welcome This manual tells you about ORMEC’s standard Error Handler Software Module for the Generation III controller. It tells you what it does, how it works and how to incorporate it in your application program. The information it contains relates to version 1.1a of the software.
Page 10
MotionBASIC Error Handler Welcome THIS PAGE INTENTIONALLY LEFT BLANK page 2 GN3-ERRb...
Page 11
Error Handler Description Chapter 2 Description 2. Description ORMEC’s standard Error Handler Module is a MotionBASIC program called ERRMENU.BAS. It is an example of an Error Handler routine that can be used in MotionBASIC programs written for ORMEC’s Generation III motion controllers.
MotionBASIC Error Handler Description Figure 1, Fault Menu Screen The area above the double line shows the functions available to the operator. In this case there is only one, Clear Faults. The area below the double line shows the status of the controller faults, program errors and axis faults.
Page 13
MotionBASIC Error Handler Configuring The Module Chapter 3 Configuring The Module 3. Configuring The Module There are three steps to adding the Error Handler Module to your program: First, you must configure the module using MotionPRO’s off-line editor. Second, you merge ERRMENU.BAS, and any other MBTools you want to use, into the controller’s Setup Area.
MotionBASIC Error Handler Configuring The Module ’ ERRMENU.BAS ’ Routine name: ERR.DATA ’ ’’ Abstract: Contains data used to configure ERRMENU.BAS ’’ ’’ Entry: Called by ERR.INIT: ’’ ’’ Data Format: DATA "{1,2,...,32}" ’set of required axes, quotes ’’ ’are required ’’...
Page 15
MotionBASIC Error Handler Configuring The Module 55 / 3 = 18.33 Round DOWN to the nearest whole number = 18 18 - 2 = 16 The first name in the list will refer to the first axis in the required axes set, the second the next in the set and so on.
Page 16
MotionBASIC Error Handler Configuring The Module THIS PAGE INTENTIONALLY LEFT BLANK page 8 GN3-ERRb...
MotionBASIC Error Handler Loading The Module Chapter 4 Loading The Module 4. Loading The Module There are three steps to adding the Error Handler Module to your program: First, you must configure the module using MotionPRO’s off-line editor. Chapter 1 described this step.
Page 18
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 versions before 1.0b is limited to lines 60000 to 65535. 4.2 Merging MBTools...
Page 19
MotionBASIC Error Handler Loading The Module Once you have created your "include" file as described above, you are ready to merge the modules into your controller. Use MotionPRO’s <F8> function key to enable the program’s Setup Area. Use the MotionPRO Setup pull-down menu to turn file line numbers off.
Page 20
MotionBASIC Error Handler Loading The Module THIS PAGE INTENTIONALLY LEFT BLANK page 12 GN3-ERRb...
Page 21
MotionBASIC Error Handler Modifying Your Program Chapter 5 Modifying Your Program 5. Modifying Your Program There are three steps to adding the Error Handler Module to your program: First, you must configure the module using MotionPRO’s off-line editor. Chapter 1 described this step.
Page 22
MotionBASIC Error Handler Modifying Your Program 5.2 Resolving Conflicts Appendices A1 and A2 provide a list of variables and program labels used by ERRMENU.BAS. Review these lists and compare them with your program. Resolve any conflicts by renaming the variable or changing the label in your program.
Page 23
MotionBASIC Error Handler Modifying Your Program Will disarm the MBTools error handler ON ERROR GOTO YOUR.LABEL and arm a new error handler routine identified by the label "YOUR.LABEL". Will disable error handling completely. ON ERROR GOTO 0 Any subsequent faults or errors will stop the program.
MotionBASIC Error Handler Modifying Your Program ’’ APPLICATION.BAS ’ Routine: APPL.ERR.TRAP ’ ’’ Abstract: Checks for and handles software overtravel limit ’’ fault in MANUAL mode. ’’ ’’ Notes: manual mode must check DIO@(OTL.FLT) and handle ’’ resetting the fault.
MotionBASIC Error Handler Modifying Your Program routine that will put the machine back into a condition in which it can be safely restarted. APPL.RESTART can be a special routine or simply a label in your normal program power-up initialization code.
Page 26
MotionBASIC Error Handler Modifying Your Program THIS PAGE INTENTIONALLY LEFT BLANK page 18 GN3-ERRb...
Page 27
Chapter 6 Source Code Overview 6. Source Code Overview The source code for all MBTools Modules is written to conform with ORMEC standards for MotionBASIC software, these standards are: All labels within a modules start with a character sequence identifying the module to which they belong, i.e.
Page 28
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 will reset the ERR function to report only the most recent error.
MotionBASIC Error Handler Source Code Overview 6.2 Response to Faults You will need to evaluate the way ERRMENU responds to faults and errors so you can decide what modifications might be necessary to make ERRMENU behave appropriately and safely in your application.
Page 30
MotionBASIC Error Handler Source Code Overview When an error occurs, the program branches to the ERR.HDLR subroutine. If the error is a range error from an INPUT @ data input statement (ERR = 1218 or 1219) and MENU.BAS is present (MENU.VER$ <> ""), it calls MENU.ERR to handle the fault.
Page 31
MotionBASIC 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.
Page 32
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 error code. MY.ERR is used as an alias for ERR since MotionBASIC will not allow the program to reset ERR to zero.
Page 33
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 does not allow the program to set FAULT@ to a non-zero value.
Page 34
MotionBASIC Error Handler Source Code Overview numeric status values for the first three items and OK/BAD message for the rest. ERR.MENUBAR Subroutine ERR.MENUBAR prints text which describes the available operator actions. page 26 GN3-ERRb...
Page 35
MotionBASIC Error Handler Source Code Overview THIS PAGE INTENTIONALLY LEFT BLANK GN3-ERRb page 27...
MotionBASIC Error Handler Appendix A2 Appendix A2 Program Labels Used A2. Program Labels Used APPL.ERR.TRAP ERR.DATA ERR.REARM APPL.ESTOP ERR.ESTOP MISC.CLR5 APPL.RESTART ERR.FLTS MISC.COLORS ERR.AFLT ERR.HDLR MISC.KEYS ERR.APRN ERR.INIT MISC.TITLE ERR.AXIS ERR.MENU ERR.CODES ERR.MENUBAR Figure 8, Program Labels Used Program Labels beginning "MISC" are part of the MISC.BAS MBTools Module.
Page 40
MotionBASIC Error Handler Appendix A2 THIS PAGE INTENTIONALLY LEFT BLANK page 32 GN3-ERRb...
Page 41
MotionBASIC Error Handler Appendix A3 Appendix A3 Complete Program Listings A3. Complete Program Listings GN3-ERRb page 33...
Need help?
Do you have a question about the MotionBASIC and is the answer not in the manual?
Questions and answers