Error codes

The function blocks of the TcPlcLibMDP.Lib possess an output nErrID. This value is 4 bytes in size and returns the error code in the event of an error. nErrID consists of two parts:

(MSB) 2 bytes

2 bytes (LSB)

Error Group

Error Code

0x EC80

E_MDP_ErrCodesPLC

0x ECA6

MDP general error

0x ECA7

MDP API error

0x ECA8

ADS error

0x ECAF

MDP module specific error

Error Group

The Error Group describes the type of error that has occurred. The different groups are listed in the enumeration E_MDP_ErrGroup.
All errors generated within the PLC library have the error group 0xEC80.

Error Code

The Error Code describes the concrete error.
For errors internal to the PLC library with the error group 0xEC80, the identifiers are listed in the enumeration E_MDP_ErrCodesPLC. A description of the further error codes can be found in the Documentation of the IPC Diagnostics in the chapter MDP Error Codes.

Error codes 1:

General MDP-dependent errors are output in the error group 16#ECA6 “General error codes”. These errors sometimes indicate that an element from the module element list is not available. Example: 16#ECA60105 "No data available" If, in the case of a general or specific function block (see access options), several elements are queried at the same time and one of these elements is not available or exhibits an error, then the output variable iErrPos indicates the index position (0..n) at which the error occurred for the first time. All elements below this index were queried successfully and are indicated despite the generation of an error at the output.

FB_MDP_SplitErrorID

The function block FB_MDP_SplitErrorID enables the automatic separation of the variable nErrID into error group and error code.

Example:

nErrID          = 0x ECA8 0745

The Error Group is 0x ECA8, therefore it is an Ads error.
The Error Code is 0x 0745, therefore it is a timeout error.