Ethercat Protocol
From TASTE
Contents
Ethernet frames format
The protocol itself is fully compliant with the Ethernet standard. In fact, ethercat frames are sent on top of ethernet frames. So, you have the traditional ethernet frame with the following characteristics:
- MAC source: MAC address of the Network Interface (XX:XX:XX:XX:XX:XX)
- MAC destination: broadcast address (FF:FF:FF:FF:FF:FF)
- Ethernet type: 0x88A4 (value for ethercat frames)
Ethercat frames content
The remainder of the frame contains two things:
- One header
- One or several datagrams
Ethercat frame header
The header of an Ethercat frame contains:
- Length (11 last bits)
- A valid indicator (bit 12)
- A type (bits 13 .. 16)
- Ethercat command= 0x001
Ethercat datagram
A datagram contains:
- A header
- Some data
- Working count
Ethercat datagram header
The header contains the following fields
- Command (first 8bits)
- Auto-increment physical Read = 1
- Auto-increment physical Write = 2
- Configured address Physical Read = 4
- Configured address Physical Write = 5
- Broadcast read = 7
- Broadcast write = 8
- Index (8bits)
- Slave Address (16bits)
- Offset Address (16bits)
- Length (16bits), with:
- Length (Last 11 bits)
- Valid indicator (from bit 3 to 5)
- Round trip (bit 2)
- Last indicator - indicate if this is the last ethercat datagram (bit 1)
- Interrupt (16bits)
- Padding to complete the ethernet frame
Useful links
- Ethercat protocol definition for Wireshark: http://wiki.wireshark.org/Protocols/ethercat