Protocol and station errors

The station error messages are stored in a FIFO memory. Up to 10 error messages can be buffered. In the case of fatal communication errors (e.g. errors of the connection layer, the checksum of the frame is wrong) the connection is interrupted and must be re-established. Errors in the application layer (e.g. the ASDU transmit buffer has overflowed due to too many frames) are only logged and do not lead to interruption of the connection. Even with these errors it is still possible to interrupt the connection from the application. Apart from the error code, the error source is also stored in the error message. This makes it easier to locate the error.

Example

The accumulated error messages of a 60870-5-104 central station can be read out using the following call:

PROGRAM MAIN
VAR
...

client : FB_IEC870_5_104Master;

...
END_VAR

...

REPEAT
client.system.device.errors.RemoveError( );
IF client.system.device.errors.bOk THEN
ADSLOGSTR( ADSLOG_MSGTYPE_ERROR OR ADSLOG_MSGTYPE_LOG,
'IEC60870-5-104 master error: 0x%s',
DWORD_TO_HEXSTR( client.system.device.errors.getError.nErrId, 8, FALSE) );
END_IF
UNTIL NOT client.system.device.errors.bOk
END_REPEAT

...

The associated PLC example tutorial can be downloaded here.