EtherCAT Diagnostic Advanced

 As we all know, the EtherCAT | Online interface in the TwinCAT development environment can diagnose most EtherCAT problems, such as viewing the OP status of the master and each slave, CRC error count, etc. Here are a few of the more "hidden" tools in TwinCAT.

1 EtherCAT simulation tool

2 Register from the site

3. Frame timing analysis of DC slave station

4. Frame jitter

5.Complete AL status code explanation

 


1 EtherCAT simulation tool

This was originally a tool to support the hardware-in-the-loop debugging of TwinCAT Matlab/Simulink, but it can also be used with specialized automation simulation software and the IO interface of TwinCAT.I have discovered another use for it: practicing EtherCAT fault diagnosis - because engineers are not always in the workshop, when it comes to how to deal with an EtherCAT fault, there is no way to practice without hardware at hand.Beckhoff engineers have relatively good experimental conditions and can test on the Demo rack, but if the system is complex and there are many IO stations, it is still difficult to reproduce the fault.

The simplest EtherCAT simulation environment is as follows:

 



For example, when testing on a programming notebook, expanding a USB-to-Ethernet converter, the computer has two independent wired network cards. Shorting them with a network cable creates the hardware platform for the above test:



The configuration of EtherCAT Simulation is also very simple:

(1) Export EtherCAT configuration file

After configuring the EtherCAT network from the project file or manually, set the Adapter used, and then export the EtherCAT configuration file:


 (2)   Add  EtherCAT Simulation  manually.

Then set the Adapter used.

(3) Import configuration file to Simulation


 (4) Activate the configuration to see the results

If the Adapter is selected correctly, the EtherCAT driver is installed correctly, and the dual NICs are interconnected, all slaves and their status can be displayed in the Topology window of the EtherCAT Master.In order to test the simulation effect of a large EtherCAT network, 100 EK1100s and several XFC modules, compact drive modules, etc. are configured in this example:



(5) Simulate various EtherCAT faults

EtherCAT Simulation can simulate packet loss, disconnection, WC, and other faults, both short-term and permanent:




(6) Special instructions

This feature requires TE1111 authorization, and the trial version authorization can only run for 30 minutes.When Beckhoff engineers use EtherCAT Simulation to practice EtherCAT diagnostics, they can borrow a USB Dongle with a full license, but Beckhoff users will need to purchase one.

The simulation effect is related to CPU performance. The smaller the jitter and the shorter the cycle, the better the simulation effect.

For the simulation of slave stations with DC clocks, such as servo drives, XFC modules, etc., only their EtherCAT interfaces can be simulated, not the internal functions of the modules themselves.Due to hardware limitations, the simulated DC characteristics are not as good as those of real physical slave devices.

EtherCAT Simulation is typically used in conjunction with simulation software to simulate field devices to assist in virtual debugging of EtherCAT master applications.Fault simulation can be triggered from TwinCAT XAE or from the simulation software.In this example, the trigger from XAE is only for demonstration purposes.

2 EtherCAT slave station Register

Most of the time, the slave information can be intuitively diagnosed through the EtherCAT Online interface, Slave Diagnose interface, and TwinCAT alarm form in TwinCAT XAE.Where do these information come from?They must come from the slave's Register, which is collected by the master station and presented in a visual manner in TwinCAT XAE.Ordinary users can simply use these visual interfaces, but if you want to deeply understand the underlying mechanism, TwinCAT also provides a direct access to these Registers.Select the last item "ESCAccess/Memory" on the slave's Advanced Setting page:

Enter Start Offset and Length to define the starting address and length of the display.So what common information is located at what address?

(1) Connection loss counter

 

 

Register

Length

 Meaning

0x0310

byte

port 0 Number of losses

0x0311

byte

port 1 Number of losses

0x0312

byte

port 2 Number of losses

0x0313

byte

port 3Number of losses

 (2)  invalid counter

Register mem address

Length

 Meaning

0x0300

 1 byte

port 0 CRC check error counter

0x0301

 1 byte

port 0 RX error counter

0x0302

 1 byte

port 1 CRC check error counter

0x0303

 1 byte

port 1 RX error counter

0x0304

byte

port 2 CRC check error counter

0x0305

byte

port 2 RX error counter

0x0306

byte

port 3 CRC check error counter

0x0307

byte

port 4 RX error counter

(3) EtherCAT Online interface displays CRC

In TwinCAT, the Online page of the EtherCAT master always displays the count value in a word-oriented manner.However, the default Online interface does not display the above count, and it needs to be set in the Online View of the Advanced Setting page of the master:


After selecting Register such as 0300, it can be displayed in Online:

(4) Time for the frame to reach the slave port

(5) Historical diagnosis information Register 0x10F3

Some modules support the Diag History function, and there are corresponding tabs on their interfaces:



If there is a display here, you can also see the corresponding content from the registration word 0x10F3

 (6) AL status code Register 0x0134

Configuration error:

0x0003 : Invalid  Device Setup

0x001D : Invalid  Output Configuration

0x001E : Invalid  Input Configuration

0x0035 : Invalid  Sync Cycle Time

Run-time error:

 

0x001A: Synchronization error (network jitter causes loss of synchronization on the slave) 0x001B: Sync manager watchdog (slave did not receive periodic data for more than the watchdog time) 0x002C: Fatal SYNC error (ESC did not receive a SYNC hardware interrupt) For a complete list of fault codes, see Section 5 at the end of this article.

3  Frame timing analysis

For ordinary IO modules or EtherCAT slaves, an early or late arrival of the EtherCAT Frame, or even occasional non-arrival, has little impact. However, for EL modules or EtherCAT slaves with DC clock and DC function enabled, a late or missing Frame will cause an alarm.

So when does the Frame actually reach a specific EtherCAT slave?TwinCAT XAE provides a visual interface.Taking an EtherCAT network with two DC slaves EL7201 and EL7211 as an example, when the controller is in the Running mode, open the Slave Diagnose form from the Advanced Setting interface of the EtherCAT Master: