Troubleshooting and debugging

Debugging messages written to the application log facilitate troubleshooting of the system. Currently three stages of debugging messages can be activated in an IEC application. These messages can be activated via the dbgMode system parameter of the control station (ST_IEC870_5_101SystemParams).

  1. Station status messages (dbgMode: IEC870_DEBUGMODE_DEVSTATE);
  2. Hexadecimal output of the ASDUs (frames without link layer control header, dbgMode: IEC870_DEBUGMODE_ASDU). 32 ASDU data bytes per row are output as hexadecimal numbers. Bigger frames are split into multiple lines;
  3. Hexadecimal output of the APDUs (serial frames, dbgMode: IEC870_DEBUGMODE_LINKLAYER). 32 APDU data bytes per row are output as hexadecimal numbers. Bigger frames are split into multiple lines;

Using additional option it is also possible to output the link layer errors (dbgMode: IEC870_DEBUGMODE_LINKERROR). In order to view the debugging messages start the TwinCAT System Manager and activate log view. A debugging output is shown below. The three different message types are identified with the respective numbers.

Troubleshooting and debugging 1:

Further diagnostic tools: