Professional Documents
Culture Documents
EtherCAT
1. General EtherCAT 2
o Features
o Sync Unit
o Frames
o Working Counter
o Topology
o Redundant System
2. EtherCAT Master 7
o Topology
o EtherCAT State
o State Machine
o Addressing
o FrameState
o DevState
3. EtherCAT Coupler 22
o CRC
o Port Status
o Working Counter
4. EtherCAT Terminal 29
o Profibus Master Terminal
o CANopen Master Terminal
5. TwinCAT PLC 35
6. EtherCAT Diagnosis 40
o Diagnosis with TwinCAT SystemManager
o Diagnosis with TwinCAT Topology View
o Diagnosis with TwinCAT PLC Library
o Troubleshooting
o Advanced Diagnosis with Network Monitor
8. Notes 68
o Firmware Update
1
EtherCAT Training
1. General EtherCAT
EtherCAT Features
• no manual setup of node addresses
• no IP Address configuration
• no setup of Baud rates
• no restrictions in network topology
• no (practical) limitation of the maximum number of nodes (max. 65535 nodes/segment)
Sync Unit
• four independent modules (a module defines a set of process data which is consistent and synchronized)
• combination of data from different slaves (validity of data is important)
• cyclic process data diagnosis for each sync unit
• if process data in one sync unit is invalid: separate reaction of control application can be defined
• for Multi-Task-Operation: each Task has own Sync-Unit/Frame (read/write process data in different task cycles)
Æ reduces bus load!
• Useful for applications with machine parts which can be out of order (planned or unplanned) and the rest of the
machine should work. ÆSync Units help to structure these applications
• granularity depends on EtherCAT Slaves
• each EtherCAT Slave defines one or more process data areas which can be exchanged synchronous and consistent
• The number of independent process data areas depends on the implementation and resources of the EtherCAT Slave
Controller (Sync Manager and FMMU channels)
2
EtherCAT Training
Master Settings Master Configuration Online: Scan Devices
Select EtherCAT Device
Offline: Insert EtherCAT Master Device
Select and configure network adapter
Frames
• Task with I/O = one Ethernet frame = one to 15 datagrams (one Ethernet frames transports up to 1480 bytes)
3
EtherCAT Training
Working Counter
Each EtherCAT Telegram ends with a 16 bit Working Counter. Each Slave Controller which successfully process the EtherCAT
command (read/write), increases the Working Counter. The Master compares the received Working Counter with the calculated
data, it allows the system to determine if the command could be successfully execute.
4
EtherCAT Training
Topology
Star topology with
Real Time
EK1122
5
EtherCAT Training
Redundant System
normal setup
redundant setup
If one station is disconnected, powered down or is missing, all remaining stations will still be communicating
6
EtherCAT Training
2. EtherCAT Master
Adapter Card
Advanced Settings
Configuration of
Master Info Data
EtherCAT Master - Advanced Setting “Stay at PREOP until sync task is started”:
In this case EtherCAT is waiting in PREOP with the switching to OP until the triggering task is running (possibly the PLC-
Bootproject). This should be the default setting and usually helps to avoid startup problems.
7
EtherCAT Training
EtherCAT - Topology
EtherCAT
CAN over EtherCAT
Profibus over EtherCAT
Online
Tabs:
- EtherCAT
- Online
- Process Data
8
EtherCAT Training
EtherCAT State
9
EtherCAT Training
Example:
F10 Machine
Layout
10
EtherCAT Training
EtherCAT State Machine
Index Group +
Index Offset =
Complete Access
11
EtherCAT Training
Master Interface
0x1 - 0xFFFE This is an ADS service directed at an individual slave device. The port
(fixed address of a slave device) number is the same as the EtherCAT address of the slave device.
12
EtherCAT Training
Online - Additional Debug Information
Master State
Frame Statistic
13
EtherCAT Training
In every cycle, synchronous with the cycle
- Working Counter
Æchecks the reading and/or writing of process data
Æreaction must be done in the application
Asynchronous, not in every cycle, event triggered
- Master State
Æ State Machine of the master
Æ Device state
- Slave State
Æ State Machine
Æ Link state
14
EtherCAT Training
Online - Physical Address
15
EtherCAT Training
Online - Physical Address
Online - AmsNetId
16
EtherCAT Training
Online - AmsNetId
17
EtherCAT Training
InfoData
InfoData
18
EtherCAT Training
Inputs - FrmXState (Frame X State)
Bit Meaning
…..
Bit Meaning
19
EtherCAT Training
Inputs - DevState
Bit Meaning
0 (0x0001) Link error detected.
Bit Meaning
0 (0x0001) 0x0001 = prevent 1. EtherCAT command from
sending (request NOP)
20
EtherCAT Training
Output - FrmXWcCtrl (Frame X Watchdog Control)
Bit Meaning
0 (0x0001) 0x0001 = copy data with wrong working
counter of 1. EtherCAT command
Master Identity
Configured Slaves
21
EtherCAT Training
Auto Inc Addr: The Auto Increment Address of the EtherCAT slave device. Auto-increment addressing can be used to address
each slave device via its physical position in the communication ring. Auto-increment addressing is used during the start-up phase,
during which the master assigns the EtherCAT Address to the slaves. The first slave in the ring has an address of 0 and for each
following the addresses is decremented (0xFFFF(-1), 0xFFFE(-2) etc.).
EtherCAT Addr: The fixed Address of the EtherCAT slave device. This address is set by the master during the start-up phase.
To change the default value you have to check the box left to the address.
Advanced settings
22
EtherCAT Training
InfoData - State
Bit Meaning
0x___1 Slave in 'INIT' state
23
EtherCAT Training
Online - CRC
CRC: 0 Port A
0, 0 Port A, B
0, 0, 0 Port A, B, C
0, 0, 0, 0 Port A, B, C, D
24
EtherCAT Training
Port Status
Carrier / Open Incoming EtherCAT frame (left) and outgoing frame (right)
No Carrier / Closed Last EtherCAT terminal (no terminal on port B, right)
25
EtherCAT Training
Working Counter - WC
SlaveDiagnosis WcState: Variable of Type BOOL
Shows Working Counter State from one EtherCAT Slave
0 (FALSE) = valid Working Counter
1 1 (TRUE) = invalid Working Counter
An invalid Working Counter State means that one EtherCAT Command for updating the Inputs and Outputs has an incorrect WC.
With this EtherCAT Command more than one Slave can be addressed. (Every Slave in this command has the same WC 1.)
Check the Slave State to see which Slave is responsible for the Working Counter error.
26
EtherCAT Training
EtherCAT command
EtherCAT command
Network Load
Meaning
27
EtherCAT Training
Configuration example with Profibus and CAN with 3 Trigger (additional) Tasks
CAN
Profibus
EtherCAT
28
EtherCAT Training
4. EtherCAT Terminals
Startup Parameter list; example for EL3142
29
EtherCAT Training
Configuration of
Slave Info Data
30
EtherCAT Training
Other fieldbusses
Example
31
EtherCAT Training
Profibus Master Terminal EL6731
Startup Parameter
32
EtherCAT Training
33
EtherCAT Training
CAN Master Terminal EL6751
EtherCAT Process Data and CAN settings below (See FC510x Documentation)
Software Version
CANopen Setup (See FC510x Documentation) Online Status of CANopen Process Data
34
EtherCAT Training
5. TwinCAT PLC
Name Meaning
FB_EcCoeSdoWrite SDO-Download
Write to EtherCAT Slave object directory
Name Meaning
FB_EcSoeRead Read Parameter via "Servo Drive Profile over EtherCAT“ (SoE) (Mailbox communication
necessary!)
FB_EcSoeWrite Write Parameter via "Servo Drive Profile over EtherCAT“ (SoE)
35
EtherCAT Training
Name Meaning
Name Meaning
FB_EcGetSlaveCrcError Get CRC-Error Counter from one single Slave (for all single Ports A, B, C)
FB_EcGetSlaveState Get EtherCAT State and Link State from one single Slave
36
EtherCAT Training
Name Meaning
37
EtherCAT Training
38
EtherCAT Training
39
EtherCAT Training
6. EtherCAT Diagnosis
General Overview
Diagnosis with TwinCAT System Manager
Diagnosis with TwinCAT Topology View (see page 8)
Diagnosis with PLC Library
Troubleshooting
Advanced Diagnosis with Network Monitor
40
EtherCAT Training
Diagnosis with TwinCAT System Manager
E-Bus Current
EL9400 will not be scanned and therefore not shown. The E-Bus power will not be shown correct:
To resolve the problem (after a scan), the EL94x0 must be added to the configuration manually:
41
EtherCAT Training
ESC Build - FPGA/ASIC
Process Images
(Note: The number of images depends
on the number of tasks/frames.)
Diagnostics Info
42
EtherCAT Training
43
EtherCAT Training
Emergency Scan (Quality)
(in Configuration Mode only)
44
EtherCAT Training
With Communication Error
45
EtherCAT Training
Simulated Failure
EL3102 removed from Terminal Stack (EtherCAT and TwinCAT are running)
46
EtherCAT Training
Port Status EL3102 (Current State: INIT, Requested: OP)
Port Status EK1100 (one before EL3102) – Port B (EL3102) = “No Carrier / Closed”
47
EtherCAT Training
Compare Projects / EtherCAT configurations
Scan Devices (F5)
- shows differences in red
- disable/ignore/delete functionality
- copy function to match configurations
48
EtherCAT Training
2. Check for the priorities and cycle times of the tasks in the tsm (priority inversion?)
RX errors may count up faster than lost frames, if a frame is split into multiple pieces
Last row shows RX and TX errors of the NIC, there is no distinguishing between cyclic/queued frames
Queued frames are non cyclic (for diagnostic, CoE, SoE, EoE, AoE, …) from PLC, System Manager, Applications
49
EtherCAT Training
Æ search for the first slave starting at the master with a CRC on port A
Æ slave 4 (with slave address 1004) is detecting the real fault
Æ the faults on port B of Slave 2 (port address 1002) are green faults due older to FPGA terminals,
Æ ASIC terminals show red faults (the ASIC terminal determines if the detected CRC is already reported)
Æ the revision of the slave (>= ELxxxx-xxxx-0016 is usually an ASIC terminal)
Æ the ESC build <> 0 show usually an FPGA
Æ problem is located between/at slave 3 and/or slave 4
Æ search for the first slave starting at the last slave in the topology with a CRC on port B-D
Æ here slave 3 (with slave address 1003) is detecting the real fault
Æ the faults on port B of Slave 2 (port address 1002) are green faults due older to FPGA terminals,
Æ ASIC terminals show red faults (the ASIC terminal determines if the detected CRC is already reported)
Æ the revision of the slave (>= ELxxxx-xxxx-0016 is usually an ASIC terminal)
Æ the ESC build <> 0 show usually an FPGA
Æ problem is located between/at slave 3 and/or slave 4
Mixed
8. Check for old ESC builds (0x0000 = ASIC, 0x0001 … 0x000C = FPGA) if CRCs are happening
9. Evaluate CRCs
Æ distinguish between red and green errors
(only ASIC terminals point only to the first error location, FPGA terminals reflect the same error again)
CRC in other column (port B-D) are on the way back to the master
Æ first CRC error from the end of the list is pointing to the problem
10. Watch the machine cycle if CRCs always happen with a certain motion. This might be different in Automatic
Mode/Semi Automatic Mode.
E.g. a conveyor starts when the CRCs are generated. Or a mold is opened/closed when the CRCs are generated.
12. Check for the DevState of the EtherCAT master, if it indicates a problem
14. Check for multiple passive terminals (like EL9100, EL9400) or for passive terminals beside terminals in a double
width (KM-) housing (like EL67xx, EK1122, …)
51
EtherCAT Training
15. Make emergency scans in config mode for a few times with 100 frames per slave in order to find weak connections
17. Check for common or isolated 24V power supply to E-Bus and drives
Æ isolate the power supply for E-Bus from the 24V power for drives
18. Check for proper shielding of EtherCAT cables and of signal cables
20. Check for pulling force on the wires to a terminal, the terminal might get pulled away from the DIN rail
21. Check that all terminals are attached to the DIN rail and that the couplers are locked to it
22. Replace passive terminals with active terminals (like EL9400 with EL9410)
23. Isolate erroneous terminal by adding active terminals (like EL1004) around the problem terminal
25. Isolate the faulty terminal to its own sync unit in order to split the influence from other terminals to the WcState
of this terminal
27. Check the DC-Diagnose online if DC is used in order to evaluate the quality of the distributed clocks
(ratio early/late, max. deviation)
29. Finally use the ET2000 in combination with Wireshark in order to find problems on the EtherCAT wire
52
EtherCAT Training
List of probable causes for CRCs and lost frames due to noise on E-Bus or EtherCAT
‐ 24V power supply is the same for E-Bus and drives
‐ 24V power supply is patched from Output Voltage to electronic voltage on a coupler (Up and Us)
‐ Unshielded/wrong shielded drive power cables
‐ Improper use of drives in an unsupported mode (i.e. without an N)
‐ Ground loops
‐ 24V power supply is actually less then 20V
‐ Overload of the E-Bus power supply (too few EL94x0)
‐ Loose terminals on the DIN rail due to pulling force on the attached wires or due to not locked couplers
‐ Too many passive terminals in a row in combination with the noise issues
‐ Passive terminals beside double sized terminals (KM-housing) like EL67xx, EK1122, …
‐ Third party transformation of EtherCAT via opto couplers from copper to optical wire
‐ Slip rings
In case of a diagnostic change indicated via cyclic diagnostic execute some acyclic diagnostic
‐ Read and evaluated the frame statistic
‐ Read and evaluated the CRCs on the various ports
‐ Read and evaluated the EtherCAT slave states/link state
‐ Read and evaluated the slave identification
‐ …
53
EtherCAT Training
Supporting older FPGA cards with new TwinCAT Versions / Builds
If an older FPGA version EL card is used with newer version of TwinCAT, it can happen that this card goes in ERR INIT
mode because TwinCAT may recognize this card as a new ASIC version while it physically is an older FPGA version.
Not all the old revision numbers (XML) will be shown by default in the System Manager when adding a new card:
In order to see all new and older revision numbers, select the 2 check boxes below and then select the correct type:
TwinCAT System Manager allows updating all the EtherCAT card device description (XML) online. An internet connection
is required for the upload. Go to Options -> Update EtherCAT Device Description -> select Beckhoff Automation GmbH:
After the update is done, it will show how many files have been updates in the folder C:\TwinCAT\IO\EtherCAT\
54
EtherCAT Training
Diagnosis with TwinCAT PLC Library
FrmxWcState
55
EtherCAT Training
56
EtherCAT Training
Master Problem?
• wrong State?
• Link Error?
• min. one Slave with wrong State?
57
EtherCAT Training
One Structure for each single Slave with
• Device State
• Link State
Number of Slaves
Iteration over all Slaves; Example: to get the Identity of every Slave
58
EtherCAT Training
EL3142-0000-0000
TwinCAT InfoSys:
http://infosys.beckhoff.com/content/1033/tcplclibethercat/html/tcplclibtcethercat_overview.htm?id=12757
http://infosys.beckhoff.com/content/1033/tcplclibdrive/html/tcplclibdrive_intro.htm?id=12854
http://infosys.beckhoff.com/content/1033/tcplclibmc2_drive/html/tcplclibmc2_drive_intro.htm?id=13382
http://infosys.beckhoff.com/content/1033/tcplclibncdrive/html/tcplclibncdrive_intro.htm?id=13451
59
EtherCAT Training
Troubleshooting
EK1100
60
EtherCAT Training
All EtherCAT devices with a connector (e.g. RJ45, M12), must have a Link/Activity display. Devices without connector
could have such a display.
The RUN LED indicates the status of the EtherCAT device -> see State Machine
– Status:
• off: INIT
• blinking Pre-OP - Pre-Operational
• single flash Safe-OP - Safe-Operational
• on OP - Operational
• flickering Bootstrap
61
EtherCAT Training
EK1110
EL3314
62
EtherCAT Training
EtherCAT frames are Ethernet frames, so Standard Ethernet Protocol debugger can be used!
Æ Microsoft Network Monitor
Æ WireShark/Ethereal www.wireshark.org
For both Network Monitors a parser for EtherCAT is available www.ethercat.org
Ethereal installation:
1) execute the setup file for Ethereal/Wireshark
2) includes: installation for WinPcap
3) Not necessary any more:
4) copy the EtherCAT.dll in the Ethereal Plugins (C:\Programme\Ethereal\plugins\0.10.11)
5) Activate the Promiscuous Mode on the EtherCAT Adapter
6)
63
EtherCAT Training
64
EtherCAT Training
Wireshark Online
65
EtherCAT Training
66
EtherCAT Training
7. HPN List
EtherCAT Bus Coupler (E-Bus) 3459050 EK1100
EtherCAT Extension 4731349 EK1110
EtherCAT 2 Port Junction 4731326 EK1122
EtherCAT Bus Coupler (K-Bus) 3459051 BK1120
Digital in 24V, 4 channel, 3.0ms 3905764 EL1004
Digital in 24V, 4 channel, 10µs; 2 wire 3454441 EL1014
Digital in 24V, 4 channel, 10µs; 2 or 3 wire 4808165 EL1114
Digital in 24V, 2 channel XFC 4677708 EL1262
Digital out 24V, 4 channel, 0.5A 3459021 EL2004
Digital out 24V, 8 channel, 0.5A 3905733 EL2008
Digital out 24V, 4 channel, 2.0A 3905765 EL2024
Digital out 24V, 2 channel, 2.0A 3459025 EL2032
Digital out 24V, 0.5A 2 channel XFC 4677718 EL2262
2 Channel Digital output relay EL2622 2A/5A 4443659 EL2622
Analog in 0V...+10V, 2 channel, differential, 12bit 4443654 EL3062
Analog in 0V...+10V, 4 channel, differential, 12bit 4443653 EL3064
Analog in -10V...+10V, 2 channel, differential, 16bit 3459026 EL3102
Analog in 4…20mA, 2 channel, single-ended, 16bit 3459030 EL3152
Analog Input PT100 (RTD) for 2-, 3- or 4-wire connection 4443661 EL3202
Thermocouple in (2 channel) (K-type default) 4443660 EL3312
Thermocouple in (4 channel) (K-type default) 3905766 EL3314
3-phase power measurement terminal, max. 500V AC 3~ 5053979 EL3403-0010
Analog Input +/-10V 2-ch XFC 4903401 EL3702
Analog in, 0-20mA 2 channel XFC 4677689 EL3742
Analog out 0…10V, 2 channel, single-ended, 16bit 3459033 EL4102
Analog out -10V…10V, 2 channel, single-ended, 16bit 3459036 EL4132
Analog out, +/-10V 2 channel XFC 4677724 EL4732
Serial RS232 on EtherCAT 4443663 EL6001
Serial RS422/485 on EtherCAT 4443664 EL6021
Serial RS422/485 on EtherCAT, 2 x D Sub 4964762 EL6022
Ethernet over EtherCAT, 1 channel 4563714 EL6601
Ethernet over EtherCAT, 4 channel switch card 4964748 EL6614
ProfiNET IRT over EtherCAT 4563718 EL6632
Profibus over EtherCAT, Master Terminal 3459048 EL6731
CANopen over EtherCAT, Slave Terminal 4254504 EL6751-0010
Bus End Terminal 3459042 EL9010
Bus End Cap 4142093 EL9011
Potential Terminal 24V, 10A 3459041 EL9100
Potential Terminal 24V, 10A, with diagnostics 5276140 EL9110
Potential Distribution Terminal, 8 channel 4142096 EL9187
Power Supply Terminal for E-Bus, 2A 3459043 EL9400
Power Supply Terminal for E-Bus, 2A, with diagnostics 5276145 EL9410
EL6731-0000 Profibus Master Leap
EL6732-0000 ProfiNET IRT Master F10, Siemens ProfiNET Sinamics Drives
EL6751-0010 CANopen Slave Wittmann Robot
EL6021 RS485 Altanium Controller
EL6601 Ethernet TCP/IP CBW Robot
67
EtherCAT Training
8. Notes
Update Firmware (Experts only!)
Note: The firmware is saved with the I/O card. In case of a replacement, the firmware might have to be loaded again to the
replacement card. Verify first the version loaded on this card; it might be up-to-date or even newer.
68