If an EtherCAT bus failure causes my machine to shutdown unexpectedly, how can I determine where it was first lost so I can take corrective action?
I have 3 drives my test setup. Here I briefly disconnect and reconnect the cable between 1001 and 1002. This is a crude way to simulate a faulty cable, perhaps combined with EMI event or mechanical disturbance.
Here is what I see in the EtherCAT status web page (but maybe the system is reset before I notice it):
Here is what I see with diagnostic FB's from the CXA EtherCAT Master library:
Now a break between 1002 and 1003:
As you can see, the registers are 0 for drives upstream of the break. The bits below are TRUE for drives downstream of the break. So you could monitor this in code, store the result, and provide the information on the HMI about where to look for a weak connection.
To save some work you can alternatively try Ethercat_Diagnosis_01V00 from a colleague in the Community. It automatically detects the number of configured slaves and turns on the bit bTopologyNotOK if there is a break. It reports the first missing device as a string. So if I briefly disconnect the cable between 1002 and 1003, it reports ‘ctrlX_DRIVE_XCS_SoE_FSoE” (address 1003):
As soon as I reconnect the cable the bit turns off and the string is empty:
So you could monitor the TopologyNotOk bit and latch the string variable if the bit goes FALSE. This points to the first device after the break. Maybe you have a faulty cable on the IN port of this device.
Best regards,
Brian