Extended diagnosis
Debugging messages written to the application log facilitate troubleshooting of the system. Four stages of the debug messages can presently be activated in an IEC application. The messages are activated by the dbgMode system parameters of the control station (ST_IEC870_5_101SystemParams).
Debug messages that are logged when the TCP/IP connection is established or released, plus link layer error messages (dbgMode: IEC870_DEBUGMODE_LINKERROR);
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.
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:](Images/gif/2036183051__Web.gif)
Further diagnostic tools are available:
TwinCAT ADS monitor
Network monitor
Wireshark
Ethereal
Diverse protocol test suite products