background image

MotionBASIC

TM

Error Handler

Modifying Your Program

Figure 4, Application Specific Error Handling

’’

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.

’’

APPL.ERR.TRAP:

IF MANUAL.MODE=TRUE AND (ERR=1608 OR ERR=1609) THEN

DIO@(OTL.FLT)=ON

’turn on the overtravel fault light

RESUME.FLAG=TRUE

ENDIF

RETURN

Your application specific error trapping routine can handle as many different
errors as you want, however the following rules must be observed.

1.

The machine will not be shut down until the program RETURNs from
APPL.ERR.TRAP with RESUME.FLAG=FALSE. The program should
not dwell in the subroutine unless you have eliminated the possibility of
a fault for which the machine should be shut down.

2.

Always leave the subroutine with a RETURN statement.

5.5 Application Specific 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 subroutine should include whatever sequencing is
needed.

NOTE......

The APPL.ESTOP subroutine is always called if the error is not handled as a
non-critical error by your APPL.ERR.TRAP routine. If your application does not
require any special shutdown sequencing, you must include a dummy
APPL.ESTOP subroutine as shown below.

APPL.ESTOP: :RETURN

When the program RETURNs from your APPL.ESTOP subroutine, it will
execute a HALT on all axes, wait for 500 user time units and then disable all
the servos.

CAUTION......

If your APPL.ESTOP subroutine does not perform a complete shutdown of the
machine, the Error Handler module will not stop the motors and disable the
servos until AFTER the program RETURNs from APPL.ESTOP.

5.6 Restart After Fault Procedures

After the operator has cleared any faults, the Error Handler module will execute
a GOTO APPL.RESTART statement. You must write an APPL.RESTART

page 16

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...

Отзывы: