3 generating application error messages, Generating application error messages, 4plc functionality – Lenze E94AxPExxxx User Manual

Page 51

Advertising
background image

Lenze · 9400 Servo PLC· Reference manual · DMS 4.0 EN · 11/2013 · TD05/06

51

4

PLC functionality

4.3

Programming notes

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

4.3.3

Generating application error messages

For generating application error messages, the L_DevApplErr and L_DevApplErrFix function blocks

from the LenzeDevice9400Vxxxx library are available.
The errors are written unambiguously via module ID and error ID. Moreover, an error response can

be defined, see the documentation for function libraries.
For defining an error message for an error, the LT_DevErrorList data type is available in the

LenzeDevice9400Vxxxx library.

Data type LT_DevErrorList

Definition of error messages:

1. Depending on the number of the error messages to be defined, an instance of the data type

LT_DevErrorList must be created.

• a declaration as array is possible
• the data type must be defined as global constant and initialised there,

see example:

2. The error messages are incorporated in the software when the PLC application is imported into

»Engineer«.

Tip!
The import into the »Engineer« is described in section "

Import in the »Engineer« project

".

( 65)

Identifier

Data type

Information/possible settings

dwModulId

DWORD

Module ID (980 ... 990) of the error

dwErrorId

DWORD

Error ID (0 ... 65535) for error message

strErrorMessage

STRING(64)

Error text

VAR_GLOBAL CONSTANT

(* Example for declaration of errors as single structures *)

Error1 : LT_DevErrorList := (dwModulId := 980, dwErrorId:=8001,strErrorMessage:='Error1');

Error2 : LT_DevErrorList := (dwModulId := 980, dwErrorId:= 8002,strErrorMessage:=' Error2');

(* Example for declaration of errors as array *)

ErrorList : ARRAY[1..4] OF LT_DevErrorList :=(dwModulId := 901, dwErrorId:=1,strErrorMessage:='Hallo1'),

(dwModulId := 981, dwErrorId:= 8002,strErrorMessage:=' Error3'),

(dwModulId := 981, dwErrorId:= 8003,strErrorMessage:=' Error4'),

(dwModulId := 981, dwErrorId:= 8004,strErrorMessage:=' Error5');

END_VAR

Note!

• If the declaration of error messages is stored in an export file with the name

"Error_Text_Declaration.exp" in the project directory, the error messages will be read

out of this file during the importing process.

• Before error messages are imported from coded PLC projects, it is necessary to place

the error messages in an export file.

Advertising