Protocol and data transmission 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 link 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.
Sample
The accumulated error messages of an IEC 60870-5-101 substation can be read out using the following call:
PROGRAM MAIN
VAR
...
server : FB_IEC870_5_101Slave;
...
END_VAR
....
REPEAT
server.system.device.errors.RemoveError();
IF server.system.device.errors.bOk THEN
ADSLOGSTR( ADSLOG_MSGTYPE_ERROR OR ADSLOG_MSGTYPE_LOG,
'IEC60870-5-101 slave error: 0x%s',
DWORD_TO_HEXSTR( server.system.device.errors.getError.nErrId, 8, FALSE) );
END_IF
UNTIL NOT server.system.device.errors.bOk
END_REPEAT
...