Back to top

Building KAS Applications with Built-in EtherCAT Diagnostics

KAS 2.12 introduces the following functions / function blocks which help with diagnosing EtherCAT network issues.

  • ECATWCStatus
    • This function block reads the EtherCAT master state and the lost frame counter to determine if EtherCAT is running normally. Value 0 means no working counter errors. When the value is non zero, the master will automatically reduce the count by 1 for every thousand good frames received. When the working counter error exceeds the Working Counter Error limit, the EtherCAT network will be stopped.
  • ECATMasterStatus
    • This function block reads the EtherCAT master state and the lost frame counter, to determine if EtherCAT is running normally.
  • ECATDeviceStatus
    • This function block provides the EtherCAT state and the port link status information for the EtherCAT device. If the EtherCAT network communication is not running due to a shutdown, the device status contains information that was taken at the time the network was shutdown. This function block is useful in locating the device(s) with communication errors when the ECATWCStatus function indicates there are EtherCAT communication errors.
  • ECATCommErrors
    • This function block returns a list of bad EtherCAT connections. If EtherCAT network communication is shutdown, the failed connections are based on information that was taken at the time the network was shutdown.

KAS application can use these functions to create a built in diagnostic tool to help the field engineers to diagnose any EtherCAT communication quickly and effectively.

The flow chart below explains the steps involved in diagnosing the EtherCAT errors.

image

Attached to this article is a KAS code sample ( Diagnostics-V2.xk5 ) which is a diagnostic tool using the above functions.
Please note that this sample code requires KAS v2.12 or later.

Also attached is the file ECATDiagnosticsExample.kas which is a 2-axis PN network sample application that is built with the Diagnostics-V2.xk5 code sample.