background image

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

Страница 1: ...MotionBASICTM TM TM Tools Tools 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 3...

Страница 2: ...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 s...

Страница 3: ...ii...

Страница 4: ...3 Initializing The Module 14 5 4 Application Specific Error Traps 15 5 5 Application Specific Shutdown Procedures 16 5 6 Restart After Fault Procedures 16 5 7 Invoking The Fault Menu 17 5 8 Invoking...

Страница 5: ...MotionBASICTM Error Handler Table of Contents A3 Complete Program Listings 31 iv...

Страница 6: ...v...

Страница 7: ...t Menu Screen 4 Figure 2 ERR DATA Configuration Data 6 Figure 3 MBTOOLS BAS Include File 9 Figure 4 Application Specific Error Handling 16 Figure 5 Recomended Power Up Sequence 17 Figure 6 Response to...

Страница 8: ...vii...

Страница 9: ...r 2 Description tells you what the Error Handler Software Module does and how to operate it Chapter 3 Configuring the Module tells you how to configure the Error Handler for your application Chapter 4...

Страница 10: ...MotionBASICTM Error Handler Welcome THIS PAGE INTENTIONALLY LEFT BLANK page 2 GN3 ERRb...

Страница 11: ...that you can easily modify it to form part of a larger application program It requires approximately 6 000 bytes of program memory The configuration information for ERRMENU is contained in a single b...

Страница 12: ...no controller faults program errors or axis faults If the faults cannot be cleared the screen will show those faults errors etc that remain 2 3 Restarting The Machine When you press the ESCAPE key th...

Страница 13: ...th the Error Handler Module This chapter describes how to do step one 3 1 The Configuration Process There are two things that need to be configured for the Error Handler You need to tell the Error Han...

Страница 14: ...u can set the required axes to any combination of eight axes using axis numbers from 1 to 32 NOTE Both the quotation marks and the curly braces are required The remaining DATA statements set the names...

Страница 15: ...le amount of memory If you need to refer to the information that is in the comment load the MBTOOLS HYP file into the Hypertext On Line Help system The information will be displayed if you press ALT w...

Страница 16: ...MotionBASICTM Error Handler Configuring The Module THIS PAGE INTENTIONALLY LEFT BLANK page 8 GN3 ERRb...

Страница 17: ...s Setup Area 3 Third you modify your program to work with the Error Handler Module This chapter describes how to do step two 4 1 Include Files The best way to merge MBTools modules with your program i...

Страница 18: ...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 li...

Страница 19: ...menu to turn file line numbers off Then type MERGE MBTOOLS BAS After the modules have been merged into your program you should use the F8 function key to disable the Setup Area and proceed to the nex...

Страница 20: ...MotionBASICTM Error Handler Loading The Module THIS PAGE INTENTIONALLY LEFT BLANK page 12 GN3 ERRb...

Страница 21: ...e Error Handler Module This chapter describes how to do step three 5 1 Steps Required To Modify Your Program Modifying your program is a four step process 1 You must check for and resolve conflicts in...

Страница 22: ...hat must be executed before the module is first invoked For ERRMENU BAS these subroutines set up the screen color variables set up logical names for testing keys pressed by the operator initialize the...

Страница 23: ...he APPL ERR TRAP subroutine whenever a fault or error occurs If your application does not need any application specific error trapping you must add the following line to your program APPL ERR TRAP RET...

Страница 24: ...fic Shutdown Procedures Your application may have to follow a specific sequence to safely execute an emergency stop To include such a sequence you must add a subroutine using the label APPL ESTOP This...

Страница 25: ...n code GOSUB MISC COLORS GOSUB ERR INIT other MBTools initialization subroutine calls ON ERROR GOTO ERR HDLR APPL RESTART GOSUB MAIN END The APPL RESTART label is located immediately after the ON ERRO...

Страница 26: ...MotionBASICTM Error Handler Modifying Your Program THIS PAGE INTENTIONALLY LEFT BLANK page 18 GN3 ERRb...

Страница 27: ...onal GOSUB statement is always included for example GOSUB ERR CODES rather than just ERR CODES 4 The same names are not used for variables and program labels 5 The default variable type integer is use...

Страница 28: ...execution of the program Therefore only one error can exist at a time If a second error occurs before the first is cleared MotionBASICTM will reset the ERR function to report only the most recent err...

Страница 29: ...ROR OCCURS ERR HLDR ERR ESTOP SUBROUTINE ROUTINE APPL ESTOP DISPLAY CHECK DATA RANGE LIMITS ENTRY RANGE APPLICATION THEN RESUME ERRORS SPECIFIC ESTOP SEQUENCE NOT A DATA ENTRY ERROR RESUME ERROR APPL...

Страница 30: ...n in process will be stopped however the NO FAULT relay contacts may remain closed and the servo drives may remain enabled Controller Faults regardless of when they happen will always open the NO FAUL...

Страница 31: ...res 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...

Страница 32: ...is the Fault Display Screen It is called by ERR ESTOP or directly by the application program It prints the initial backdrop for the Fault Display Screen and then enters a WHILE WEND loop which loops...

Страница 33: ...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 wheth...

Страница 34: ...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 actio...

Страница 35: ...MotionBASICTM Error Handler Source Code Overview THIS PAGE INTENTIONALLY LEFT BLANK GN3 ERRb page 27...

Страница 36: ...WN RESUME FLAG A LEFT ENTER RIGHT A RIGHT ERR LEN SCRN TYPE A UP ESC SELECT ACTIVE FAULT SELECT BG ACTIVE BG FLAG SELECTED AFLT FLT TMP SELECTED BG ALARM INACTIVE TITLE MSG ALARM BG LEFT TMP AXES MY E...

Страница 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...

Страница 39: ...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 CO...

Страница 40: ...MotionBASICTM Error Handler Appendix A2 THIS PAGE INTENTIONALLY LEFT BLANK page 32 GN3 ERRb...

Страница 41: ...MotionBASICTM Error Handler Appendix A3 Appendix A3 Complete Program Listings A3 Complete Program Listings GN3 ERRb page 33...

Отзывы: