Extended diagnosis

Debugging messages written to the application log facilitate troubleshooting of the system. 5 stages of the debug messages can presently be activated in an IEC application. Four stages are activated by the dbgMode system parameters of the substation (ST_IEC870_5_101SystemParams).

Debugging messages that are logged when the TCP/IP connection is established or released (TcSocketHelper.Lib messages). These messages can be activated by the nMode parameter: CONNECT_MODE_ENABLEDBG when calling the F_CreateServerHnd() function;

Station status messages (dbgMode: IEC870_DEBUGMODE_DEVSTATE);

Hexadecimal output of the ASDUs (dbgMode: IEC870_DEBUGMODE_ASDU). 32 ASDU data bytes per row are output as hexadecimal numbers. Longer ASDUs are spread across several rows;

Hexadecimal output of the APDUs (TCP/IP telegrams, dbgMode: IEC870_DEBUGMODE_LINKLAYER). 32 APDU data bytes per row are output as hexadecimal numbers. Like in 3., longer APDUs are spread across several rows;

Output of the link layer errors as messages (dbgMode: IEC870_DEBUGMODE_LINKERROR);

In order to view the activated debug messages start the TwinCAT System Manager and activate log view. A debugging output is shown below. The first three different types of message are marked with corresponding numbers.

Extended diagnosis 1: