Extended diagnosis

Debug messages written to the application log facilitate debugging of the system. Currently, four levels of debug messages can be activated in an IEC application. The messages are activated via the dbgMode system parameter 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 the logger view. A debugging output is shown below. The first three different types of message are marked with corresponding numbers.

Extended diagnosis 1:Fig.1:

Further diagnostic tools are available:

TwinCAT ADS Monitor

Network monitor

Wireshark®

Ethereal

Diverse protocol test suite products