Ormec MotionBASIC Mounting instructions

MotionBASIC
MotionBASICMotionBASICTM
TMTM Tools
ToolsTools
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

COPYRIGHT NOTICE
Copyright 1990 by Ormec Systems Corporation. All rights reserved. This manual and
the software it describes, remain the exclusive property of Ormec Systems
Corporation. No part of either may be reproduced in any form without the prior written
permission of 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.
TERMS AND CONDITIONS OF SALE
All software sold or otherwise provided by ORMEC is made available subject to
ORMEC’s published Standard Terms And Conditions Of Sale.
i

ii

MotionBASIC
TM
Error Handler Table of Contents
TABLE OF CONTENTS
1. Welcome .................................................... 1
2. Description .................................................. 3
2.1 Operating The Error Handler (3)
2.2 Clearing The Faults (4)
2.3 Restarting The Machine (4)
3. Configuring The Module ........................................ 5
3.1 The Configuration Process (5)
4. Loading The Module ........................................... 9
4.1 Include Files (9)
4.2 Merging MBTools (10)
5. Modifying Your Program ........................................ 13
5.1 Steps Required To Modify Your Program (13)
5.2 Resolving Conflicts (14)
5.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 From MENU.BAS (17)
6. Source Code Overview ......................................... 19
6.1 Faults vs Errors (20)
6.2 Response to Faults (20)
6.3 Description Of Subroutines (23)
ERR.INIT Subroutine (23)
ERR.HDLR Routine (23)
ERR.ESTOP Routine (23)
ERR.MENU Subroutine (24)
ERR.FLTS Subroutine (24)
ERR.CODES Subroutine (24)
ERR.AXIS Subroutine (25)
ERR.AFLT Subroutine (25)
ERR.APRN Subroutine (25)
ERR.MENUBAR Subroutine (25)
A1. Variables Used .............................................. 27
A2. Program Labels Used ......................................... 29
iii

MotionBASIC
TM
Error Handler Table of Contents
A3. Complete Program Listings .................................... 31
iv

v

MotionBASIC
TM
Error Handler List of Figures
LIST OF FIGURES
Figure 1, Fault 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 Faults
....................................... 21
Figure 7, Variables Used
.......................................... 27
Figure 8, Program Labels Used
...................................... 29
vi

vii

MotionBASIC
TM
Error Handler Welcome
Chapter 1
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.
The manual is divided into the following chapters:
Chapter 1 Welcome introduces you to this manual and how it is
organized.
Chapter 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 Loading the Module tells you how to merge the Error Handler
into your program.
Chapter 5 Modifying Your Program tells you what changes you may
have to make to your program to make it work with this module.
Chapter 6 Source Code Overview gives you a overview of the module’s
source code and how it works.
Appendix The appendix contains some useful information such as a list of
the variable names and program labels used in the Error
Handler Module.
GN3-ERRb page 1

MotionBASIC
TM
Error Handler Welcome
THIS PAGE INTENTIONALLY LEFT BLANK
page 2 GN3-ERRb

MotionBASIC
TM
Error Handler Description
Chapter 2
Description
2. Description
ORMEC’s standard Error Handler Module is a MotionBASICTM program called
ERRMENU.BAS. It is an example of an Error Handler routine that can be used
in MotionBASICTM programs written for ORMEC’s Generation III motion
controllers. It is compatible with MotionBASICTM version 1.0b or higher.
The Error Handler Module traps and process run-time errors and system faults.
It provides for application specific error trapping and safe shutdown procedures.
The Fault Display portion of the module provides a display of the current fault
status of the controller and its servo axes. It provides an operator function to
clear the faults and attempt to restart the machine.
The module has been written so 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 block of
DATA statements, making it very easy to adapt it to your particular application.
The entire module, and the configuration data block, is located in the
MotionBASICTM Setup Area. This allows you to configure it and load it, along
with other MotionBASICTM Tools, and then protect the Setup Area using the
PW@ password. With the Setup Area protected, you can use the NEW, LOAD,
MERGE, RENUM and EDIT commands without fear of affecting the ERRMENU
module.
2.1 Operating The Error Handler
Figure 1 shows the Fault Menu Screen. This screen is displayed automatically
whenever a fault or error occurs, it can also be displayed manually through an
operator input. The top right hand corner of the screen tells that you must
press the ESCAPE key to leave the menu.
GN3-ERRb page 3

MotionBASIC
TM
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.
2.2 Clearing The Faults
To clear the system faults, simply press the ENTER key. If the faults are
successfully cleared, the screen will be refreshed showing 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, the system will leave the Fault Menu. If you
called the menu manually, the program will return to the point in the program
where the menu was called. If it entered the Fault Menu as a result of a fault
occurring, it will return to a routine that attempts to restart the machine. This
routine is application specific and should be written to provide a safe restart
procedure which takes any special application requirements into account.
page 4 GN3-ERRb

MotionBASIC
TM
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:
1. First, you must configure the module using MotionPRO’s off-line editor.
2. Second, you merge ERRMENU.BAS, and any other MBTools you want
to use, into the controller’s Setup Area.
3. Third, you modify your program to work with 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 Handler which axes must be present and healthy for your
application to run successfully. And second, you need to specify the names
you want the Fault Menu to use when referring to each of the axes.
The configuration is stored in a block of DATA statements identified by the
program label "ERR.DATA". You should edit this part of the ERRMENU.BAS
program before loading it into the controller.
GN3-ERRb page 5

MotionBASIC
TM
Error Handler Configuring The Module
The first DATA statement defines the required axes. It is set as a string
Figure 2, ERR.DATA Configuration Data
’ 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
’’
’’ DATA "axis 1 name",...., "axis 4 name"
’’
’
ERR.DATA:
DATA "{1,2}" ’set of required axes
DATA "Axis 1","Axis 2" ’axis names (8 max.)
variable representing an axis set. The format is:
"{a,b,c,d,...}"
Where a, b, c and d are the axis numbers that your application needs. For
example, if your application needs axis 1, 3 and 32, you would set the string to:
"{1,3,32}"
You 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 that the Fault Menu will display
when listing axis faults. You should set these to names such as "WINDER",
"FEEDER", "X-Axis", etc. that are appropriate for your application. The names
can vary in length, ERRMENU will automatically line up the columns on the
screen. However, the length of the longest name you use is limited by the
number of axes in the system. The way to determine the longest possible
name is:
1. Divide 55 by the number of axes.
2. Round the result DOWN to the nearest whole number.
3. Subtract 2.
No name should be longer than the resulting value. For example, if your
program uses 3 axes, the maximum length for any name will be 16 characters.
page 6 GN3-ERRb

MotionBASIC
TM
Error Handler Configuring The Module
1. 55/3=18.33
2. Round DOWN to the nearest whole number = 18
3. 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.
NOTE...... Some of the comments in the ERR.DATA block have a double tick, i.e. ’’.
The double tick tells MotionPRO
TM
not to download the comment to the
controller. This saves a considerable 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-? with the cursor located on ERR.DATA:
CAUTION...... Use caution when saving ERRMENU.BAS from the controller, the downloaded
version has the "double tick" comments removed. If uploaded with the same
file name, it will over-write the original version stored in your PC and these
comments will be gone forever. For this reason, we recommend that all editing
work on MBTools be done in the MotionPRO
TM
off-line editor.
GN3-ERRb page 7

MotionBASIC
TM
Error Handler Configuring The Module
THIS PAGE INTENTIONALLY LEFT BLANK
page 8 GN3-ERRb

MotionBASIC
TM
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:
1. First, you must configure the module using MotionPRO’s off-line editor.
Chapter 1 described this step.
2. Second, you merge ERRMENU.BAS, and any other MBTools you want
to use, into the controller’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 is to use
MotionPRO’s INCLUDE directive. Using the off-line editor, you should create a
file called MBTOOLS.BAS.
Figure 3, MBTOOLS.BAS Include File
’!INCLUDE "C:\ORMEC\BAS\MBTOOLS\IOMENU.BAS",40000,1,40999
’!INCLUDE "C:\ORMEC\BAS\MBTOOLS\ERRMENU.BAS",41000,,41999
’!INCLUDE "C:\ORMEC\BAS\MBTOOLS\MENU.BAS",42000,,42999
’!INCLUDE "C:\ORMEC\BAS\MBTOOLS\MISC.BAS",43000,,43999
GN3-ERRb page 9

MotionBASIC
TM
Error Handler Loading The Module
The file should contain the information shown in Figure 3. The ’!INCLUDE is a
MotionPROTM directive which tells MotionPROTM 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
MotionPROTM 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, MotionPROTM will not test for one.
In the above example, the include file tells MotionPROTM 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, MotionPROTM 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

MotionBASIC
TM
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 MotionPROTM Setup pull-down 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 next step.
NOTE...... To merge any MBTools Module into your program, the program Setup Area
must be enabled and file line numbers must be turned off. You can disable the
Setup Area and/or turn file line numbers back on, if you wish to, after merging
the modules.
GN3-ERRb page 11

MotionBASIC
TM
Error Handler Loading The Module
THIS PAGE INTENTIONALLY LEFT BLANK
page 12 GN3-ERRb
Table of contents
Popular Control Unit manuals by other brands

Bailey
Bailey Infi 90 NTPL01 Instruction

Velux
Velux KMG 100 instructions

Rodix
Rodix FEEDER CUBE FC-40 Plus Series Adjustments and Set Up

Cooper Crouse-Hinds
Cooper Crouse-Hinds CEAG GHG 44 Series Annex to operating instructions

Festo
Festo HSP-AE-IO Series Brief overview

Bard
Bard CMA-39 Supplemental instructions

Digitrax
Digitrax UT1 manual

Reece
Reece VADA V-PC quick guide

Siemens
Siemens WATCHDOG-Modul ET 200iSP Product information

Motorola
Motorola M68EML08GZ16 user manual

oventrop
oventrop Multiblock TQ-RTL Installation and operating instructions

Bell and Gossett
Bell and Gossett DB-3/4 Installation, operation & service instructions