Using the softkey editor utility – Rockwell Automation 8520-9API 9/Series OCI API Developer's Guide User Manual

Page 32

Advertising
background image

3–11

OCI Basic Display Set (BDS)

Publication 8520-6.6 - August 1999

Managing Errors on your Form

When you develop your new screen we recommend you place in
your code the following routine we use to handle and report error
conditions.

On Error GoTo ProgramError

(add your code here)

Exit Sub

Program Error:

WriteErrors

string, Err, debug, errorFile

Resume Next

End Sub

Where:

string – is the message you want displayed

Err – indicates to the code it is an error (enter the string ERR)

debug – is the string you want to pass on to help debug the error
condition. We recommend you use the name of the form and its
sub name.

errorFile – the number of the file to write errors into. #1 writes
to the poking error files, #2 writes to to the linking error file.
See Writing to Error files utility later in this section.

Also included with this source code is the softkey editor utility. Use
this utility whenever you need to add, remove, rename, or replace a
softkey in the Basic Display Set softkey structure. Though possible,
it is not recommended that you attempt to edit the softkey structure
without using this utility. You must have installed the Basic Display
Set source code before you will be allowed to use the softkey editor.

Each softkey in the Basic Display Set is assigned a number. Each
rack of five softkeys plus the more and back arrow keys is also
assigned a number. These numbers are used by the Basic Display
Set source code to determine if a softkey is to be displayed and what
forms appear when a specific softkey is pressed. Text for the
softkeys are stored in the data files with the extension .ABL and
.ABG. Aliases for the softkey numbers are created in the basic file
SOFTKEYS.BAS.

Important: Any softkeys you add must be softkey 1500 or higher.

Softkeys 1 to 1499 are used or reserved by
Allen–Bradley for future product development.

Using the Softkey Editor

Utility

Advertising