EtherCAT Communication 070531 - Elmo · ISO/OSI Layer Model • * „empty“means that the layer...
Transcript of EtherCAT Communication 070531 - Elmo · ISO/OSI Layer Model • * „empty“means that the layer...
30.05.2007 EtherCAT Communication 1© Copyright by Beckhoff, 2007
EtherCAT Technology Group
EtherCAT Communication
Communication Principles
30.05.2007 EtherCAT Communication 2
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Agenda
• EtherCAT Basics
• Slave Structure
• Physical Layer
• Device Model
• Data Link Layer
– Frame Structure
– Addressing, Commands
– Memory, SyncManager, FMMUs
– Diagnosis
• Application Layer
– State Machine
– Mailbox (Mailbox Protocols)
– Slave Information Interface (EEPROM)
• Device Profiles
• Distributed Clocks
• Device Description
• Tools (Configuration Tool, Monitor, …)
• EtherCAT Master
• Standard & References
30.05.2007 EtherCAT Communication 3
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Topology
EtherCAT Segment (Slaves)
Master
• Flexible Topology
• Any number of physical layer changes possible
• Standard Ethernet 100m cable distance between 2 devices
• Up to 65.535 devices possible
30.05.2007 EtherCAT Communication 4
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Functional Principle: Ethernet „on the Fly“
Car
27
Analogy Fast Train:
• „Train“ (Ethernet Frame) does not stop
• Even when watching „train“ through narrow window one
sees the entire train
• „Car“ (Sub-Telegram) has variable length
• One can „extract“ or „insert“ single „persons“ (Bits) or
entire „groups“ – even multiple groups per train
30.05.2007 EtherCAT Communication 5
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Functional Principle: Ethernet „on the Fly“
Slave Device
EtherCAT Slave
Controller
Slave Device
EtherCAT Slave
Controller
• Process data is extracted and inserted on the fly
• Process data size per slave almost unlimited
(1 Bit…60 Kbyte, if needed using several frames)
• Compilation of process data can change in each cycle,
e.g. ultra short cycle time for axis, and longer cycles for I/O
update possible
• In addition asynchronous, event triggered communication
30.05.2007 EtherCAT Communication 6
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
DVI
IPC
....
Frame Processing within one node
EtherCAT Segment (Slaves)Master
vom Master
zum Master
vom Master
30.05.2007 EtherCAT Communication 7
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Logical Process Data Image
logischesProzessabbild: bis4 GByte
0
232 Telegrammstruktur
Ethernet HDR HDR 1 PLC Data HDR 2 NC Data HDR n Data n CRC
PLC Data
Data n
NC Data
Sub-
Telegramm 1Sub-
Telegramm 2
Sub-
Telegramm n
DVI
IPC
..
..
30.05.2007 EtherCAT Communication 8
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Slave Structure
PHY PHY
Trafo
Trafo
RJ45
RJ45
ESC
Host
CPU
EEPROM
Standard Ethernet
Physical Layer Components
DVI....
EtherCAT Master
EDSXML
Electronic
Data Sheet
Slave
Slave-Hardware
Application Layer
(Mailbox Protocols)
ESC
Configuration
Data
EtherCAT
Slave
Controller
30.05.2007 EtherCAT Communication 9
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Slave Evaluation Kit (by Beckhoff)
8/16bit µC
interface
32 bit
parallel
interface
PIC over SPI
SPI
Power
Supply
Programmer for
FPGA
Basic
Board
EL9800
PIC Program &
Debug Interface
PDI
Selector
EtherCAT
Slave Controller Board
30.05.2007 EtherCAT Communication 10
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Slave Controller Board
EtherCAT
Slave
Controller
(FPGA)
PHY
Trafo
RJ45Status LED
* Post stamp design, not cost and space optimized
EEPROM
30.05.2007 EtherCAT Communication 11
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Ethernet on LVDS physics
(E-Bus):
for modular devices
EtherCAT Physical Layers
• On cables: 100BaseTX or 100BaseFx
• Device internal: E-Bus (LVDS)
Ethernet on
100BASE-TX;
up to 100 m, with
transformer coupling
any number of
physical layer
changes allowed
E-Bus
DVI
IPC
....
30.05.2007 EtherCAT Communication 12
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Physical Layer
• 100 BASE-TX
– Most popular physical layer for Fast Ethernet
– Shielded twisted pair (STP) with 2 pairs of wires
– Cable categories CAT5, 6, 7 can be used
– RJ45 connector standard, M12 connector for IP67
– PHY Support for auto negotiation and auto crossover recommended
• 100 BASE-FX
– All media options possible
– Simple solution for TX-to-FX converter
• E-BUS
– Interface for low cost backplane applications
– Widely used LVDS (Low Voltage Differential Signaling) adopted
– Use Manchester Bit Coding
– LVDS: Low Voltage Differential Signaling according to ANSI/TIA/EIA-644, also used in IEEE 802.3ae (10Gigabit Ethernet)
30.05.2007 EtherCAT Communication 13
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Port Management
• A Slave Controller can have up to 4 EtherCAT Ports
• If a Port is closed the controller forward it to the next port
Ports can be opened/closed automatically with link up or
opened closed by EtherCAT command
• The EtherCAT frame processing and forwarding order
depends on logical ports configured:
0�EtherCAT Processing Unit�3 / 3�1 / 1�2 / 2�0 4 ports
0�ECAT Proc. Unit�1 / 1�2 / 2�0 (log. ports 0,1, and 2)
or
0�ECAT Proc.Unit�3 / 3�1 / 1�0 (log. ports 0,1, and 3)
3 ports
0�EtherCAT Processing Unit�1 / 1�0 2 ports
30.05.2007 EtherCAT Communication 14
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Frame Processing
Auto Forwarder and Loop Back
1
Port 2
Auto-
Forwarder
Port 1
Port 3
Auto-
Forwarder
Port 0
Loopback function
EtherCAT
Processing Unit
Loopback function
ET1100
port 2 closed
port 2 open
port 3 open
port 3 closed
30.05.2007 EtherCAT Communication 15
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
ISO/OSI Layer Model
• * „empty“ means that the layer behavior exists, but is not shown explicitly
7
6
5
4
3
2
1
empty*
OSI
Layers
Application Layer (AL)
Data Link Layer (DLL)
Physical Layer (PhL)
30.05.2007 EtherCAT Communication 16
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Device Model – ISO/OSI Reference
Physical Layer
EtherCAT Data Link Layer
SDO
Process DataMailbox
Object Dictionary
AL Control/
AL Status
Application
e.g. DS402 Drive Profile
PDO Mapping
IP
UDPTCP
HTTP,
FTP, …
SoE
Service
Channel
Servo
Application
According
IEC 61491
Data
Link
Layer
(DL)
Application
Layer
(AL)
DL
Address
DL
Info
Sync Man
Settings
Slave Inform
ation
FMMUFMMU
FMMUFMMU n
DL Control/
DL Status
File
Access
Appli-
cation
Layer
Management
Ethernet
Physical
Layer (PHY)
30.05.2007 EtherCAT Communication 17© Copyright by Beckhoff, 2007
Application
EtherCAT Slave Controller (ESC)
Application
e.g. CiA402 Drive Profile
HTTP,
FTP, ..Appli-
cation
PHY
Trafo
RJ45PHY
Trafo
RJ45
FMMU
SyncMan1 MbxIn
SII
EEPROM
MII / EBUS
Port 3
MII / EBUS
Port 1
EtherCAT Processing Unit
and Auto-Forwarder with Loop Back
LVDS
Con
Process DataMailboxRegisters
Data
Link
Layer
(DL)
Physical
Layer
(PL)
FMMU
SyncMan2 SyncMan3
SDO
Object Dictionary
PDO...
Application
Layer
(AL)File
Access
TCP, UDP
ESC Address Space (DPRAM)
FMMUFMMU n
IP
PDO Mapping
CoECoEEoEFoEVoE
Process Data Interface (µC, SSI, I/O )
….
PHY
Management
FMMU n
SyncMan0 MbxOut
RD / WR
MII / EBUS
Port 0
MII / EBUS
Port 2
Ethernet HDRLRWProcess DataFPWRMailbox DataMore Datagrams..FCS ECAT HDR
WKC
WKC
HDR
HDR
Mailbox DLL
0x0000 0x1000
30.05.2007 EtherCAT Communication 18
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Purpose of Data Link Layer
• Data Link Layer links Physical and Application Layer
• Data Link Layer takes care of the underlying communication infrastructure
– Link Control
– Access to Transceivers (PHY)
– Addressing
– Slave Controller configuration
– EEPROM access
– SyncManager configuration and management
– FMMU configuration and management
– Process Data Interface configuration
– Distributed Clock
– Set Up AL State Machine interactions
30.05.2007 EtherCAT Communication 19
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Data Link Layer – Overview
• Standard IEEE 802.3 Ethernet Frame
– No special requirements for the master
– Use of standard Ethernet infrastructure
• IEEE Registered EtherType: 88A4h
– Optimized frame overhead
– IP stack not required
– Simple master implementation
• Additionally over UDP (IANA registered Port 88A4h)
– EtherCAT communication over the Internet possible
– Using of standard sockets
• Frame processing at Slave side
– EtherCAT Slave Controller processes the frame in hardware
• Communication Performance independent from processor power
– no time critical reaction at slave side in software
30.05.2007 EtherCAT Communication 20
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Ethernet / EtherCAT Frame Structure
Ethernet Frame: max. 1514 Byte
Ethernet Header Ethernet Data FCS
Destination EtherType
16 Bit48 Bit48 Bit 32 Bit
Source EtherCAT Data FCS
EtherType 88A4h
Destination EtherTypeSource
16 Bit
Header Datagrams FCS
48 -1498 Byte
Simple EtherCAT Communication
1
1
UDP Destination Port 88A4h
16 Bit
Dest TypeEtherType 0800h
Src IP Header UDP H.
160 Bit 64 Bit
Header Datagrams FCS
48 -1470 Byte
2
EtherCAT communication over Internet 2
TypeRes.Length
1 Bit 4 Bit11 Bit
Type of following data
Reserved
Length of following EtherCAT datagrams
(not checked by slave)
30.05.2007 EtherCAT Communication 21
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Frame Header
TypeRes.Length
4 Bit11 Bit 1 Bit
0 11 12 15
Type Meaning
-----------------------------------------------------------------------
0: Reserved
1: EtherCAT Datagram (s)
the only type that is evaluated by the ESC
2,3: Reserved
4: Network Variables
5: Mailbox over IP
6-15: Reserved for future use
30.05.2007 EtherCAT Communication 22
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Datagrams
Ethernet H. Ethernet Data FCS
EtherCAT Datagrams FCS
14 Byte 4 Byte2 Byte 44*-1498 Byte
Ethernet H. 10Len
* add 1-32 padding bytes if Ethernet frame is less than 64
EtherCAT Datagrams
Datag. Header Data WKC
10 Byte 2 Bytemax. 1486 Byte
WKC = Working Counter
1st EtherCAT Datagram nth EtherCAT Datagram2nd…. ….
30.05.2007 EtherCAT Communication 23
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Working Counter Details
• EtherCAT Datagram ends with a 16 Bit Working Counter
• Working Counter counts the number of interactions of
devices addressed by an EtherCAT Datagram
• EtherCAT Slave Controller increments the Working
Counter in hardware – if the controller is addressed and
the addressed memory is accessible (Sync Manager)
• Each Datagram should have an expected Working counter
value – calculated by the configuration tool
• The Master checks the valid processing of EtherCAT
Datagrams by comparing the Working Counter with the
expected value
• Special case: RW addressing methods will increment
WKC by 2 for write access and by 1 for read access
30.05.2007 EtherCAT Communication 24
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Working Counter Example
PC1xread+
1xwrite+
1+read/ write
= 5
node 2
DO=write
WC+1=2
node 1
DI = read
WC+1=1
node 3
DI/DO=
read+write
WC+3=5
WC=0 WC=1 WC=2 WC=5
WC=5WC=5WC=5
• WKC valid: data of this datagram was written to and
read from all addressed devices
• WKC invalid: memory of one or more devices was not
accessible
30.05.2007 EtherCAT Communication 25
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Working Counter Example
WC+1
WC+1
WC+3
WC+1
WC+1
30.05.2007 EtherCAT Communication 26
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Addressing
Ethernet H. Ethernet Data FCS
EtherCAT Datagrams FCS
14 Byte 4 Byte2 Byte 44*-1498 Byte
Ethernet H. 10Len
* add 1-32 padding bytes if Ethernet frame is less than 64
EtherCAT Datagrams
Datag. Header Data WKC
10 Byte 2 Bytemax. 1486 Byte
WKC = Working Counter
Cmd Idx Address Len R M IRQ
8 Bit 8 Bit 32 Bit 16 Bit11 Bit 4 1
1st EtherCAT Datagram nth EtherCAT Datagram2nd…. ….
30.05.2007 EtherCAT Communication 27
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Datagram Header Address
Ethernet Frame Header Address
EtherCAT Addressing Overview
Segment Addressing
Device Addressing
Position Addressing
Logical Addressing
Node Addressing
MAC
Address
Process Data
Address
Assigned Node
Address
Address by
physical Position
30.05.2007 EtherCAT Communication 28
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Segment Addressing by MAC Address
EtherCAT Segment = Ethernet Device
EtherCAT Segment = Ethernet Device
Master
Device Switch
Segment
Address
Slave
Device
Slave
Device
Slave
Device
Slave
Device
Slave
Device
Slave
Device
Generic
Ethernet Device
Slave
Device
Slave
Device
Slave
Device
Slave
Device
Slave
DeviceMaster
Device
Segment
Address
Slave
Device
• Direct mode (no switch): broadcast MAC Address
EtherCAT Segment = Ethernet Device
Slave
Device
Slave
Device
Slave
Device
Slave
Device
Slave
Device
Slave
Device
Master
Device
• Open mode: One MAC-Address for an EtherCAT Segment
30.05.2007 EtherCAT Communication 29
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Datagram Header Address
Ethernet H. Ethernet Data FCS
EtherCAT Datagrams FCS
14 Byte 4 Byte2 Byte 44*-1498 Byte
Ethernet H. 10Len
* add 1-32 padding bytes if Ethernet frame is less than 64
EtherCAT Datagrams
Datag. Header Data WKC
10 Byte 2 Bytemax. 1486 Byte
WKC = Working Counter
Cmd Idx Address Len R M IRQ
8 Bit 8 Bit 32 Bit 16 Bit11 Bit 2
More EtherCAT Datagrams?
1st EtherCAT Datagram nth EtherCAT Datagram2nd…. ….
C R
1 1 1
Circulating Datagram?
30.05.2007 EtherCAT Communication 30
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Address Field
Auto Increment Addressing (local)
Cmd Idx
Position Offset
Len R M IRQ
Logical Address
8 Bit 8 Bit
16 Bit 16 Bit
16 Bit11 Bit 2
Address Offset
Address
32 Bit
Fixed Addressing (local)
Logical Addressing (global)
• 32 Bit address space
- used for 16 bit device addressing (65.535 devices
possible)
and 16 bit for addressing local memory space of device
(max. 64kByte)
or
- 32 bit logical addressing
C R
1 1 1
30.05.2007 EtherCAT Communication 31
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Auto Increment Addressing
• Negative Auto Increment Address for every slave
depending on position (16 bit)
• Slave which reads address == 0x0000 is addressed
• Every slave increments address by 1
• Offset addresses local memory space of device
• Usually used during scan of hardware configuration
DVI
IPC
....
0xFFFE
0xFFFF
0xFFFD
0xFFFC
0xFFFB
0xFFF8
0xFFF9
1 2 3 4
5 6
7 8 9
0xFFFA
0x0000
Position Offset
16 Bit 16 Bit
30.05.2007 EtherCAT Communication 32
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Fixed Addressing
• Every Slave has a fixed address (16 bit)
• Usually assigned during hardware configuration scan
• Independent from slave position
• Fixed address lost after power loss
DVI
IPC
....
0x3EA
0x3E9
0x3EB
0x3EC
1 2 3 4
5 6
7 8 9
0x3ED
0x3EE
0x3EF
0x3F0
0x3F1
Address Offset
16 Bit 16 Bit
30.05.2007 EtherCAT Communication 33
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Logical Addressing
• Slave reads from/ writes its data into the 4 GByte great
Ethernet frame (fragmented)
0
232 Telegrammstruktur
Ethernet HDR HDR 1 PLC Data HDR 2 NC Data HDR n Data n CRC
PLC Data
Data n
NC Data
Sub-
Telegramm 1Sub-
Telegramm 2
Sub-
Telegramm n
DVI
IPC
..
..
Logical process image up to 4 GByte
Position
32 Bit
30.05.2007 EtherCAT Communication 34
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Commands
• Different commands to optimize reading and writing for all
access methods within a Fieldbus communication system
Cmd Idx Len R M IRQ
32 Bit logical addressR, W, RWLogical
CommentOffsetAddressAccessCmd Type
Local Memory
Address
(increments)R, W, RWBroadcast
Match address value to
local address register
Local Memory
Address
Address
(configured)
R, W, RW,
RMW
configured
Address
Position value 0
(at entry) addressed
Local Memory
Address
Position
(increments)
R, W, RW,
RMW
Auto
Increment
No OperationNOP
Address Offset C R
30.05.2007 EtherCAT Communication 35
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Commands
• Broadcast Read
– Individual Bits of a Byte will be added with a bitwise
OR operation between incoming data and local data
• Read Write Actions
– Exchange of incoming data and local data
(exception: Broadcast – see broadcast read)
• Read Multiple Write Actions (RMW)
– Addressed Station will read the others will write
30.05.2007 EtherCAT Communication 36
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Local Address Space of ESC
Registers
User memory
process data in
process data out
mailbox data out
mailbox data in
0x0110 DL Control
0x0110 DL Status
0x0120 AL Control
0x0130 AL Status
……
4 kByte
1..60 kByte
ESC
0x1000
0xFFFF
0x0000
0x0FFF
30.05.2007 EtherCAT Communication 37
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Local Address Space of ESC
• 64 kByte address space
• Divided into registers and dual ported RAM (DPRAM)
• First 4 kByte are reserved for registers
• DPRAM starts at 1000h
• DPRAM size depends on Slave Controller implementation
(up to 60 kByte, 4kByte in actual FPGA implementation)
• Addressing of registers and DPRAM same
• Register Write is different –
shadow Register for all Registers integrated
DPRAM write is not shadowed
30.05.2007 EtherCAT Communication 38
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Register of EtherCAT Slave Controller
• First 1000h bytes (4 kbytes) of local address space
• Read access for both sides (EtherCAT and application)
• Write access from EtherCAT for most of the registers
– Master has to configure the Slave Controller
• No address settings needed
• FMMU and Sync Manager configuration can be optimized for available bandwidth and cycle times
– Exceptions that are writable from the application side:
• AL Status Register, AL Status Code Register, AL Event Mask Register, Sync Manager Disable Registers, AL Identification Registers
• Process Data Interface (PDI) register initialized from Slave Information interface (Serial EEPROM)
30.05.2007 EtherCAT Communication 39
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Register
• Registers might be monitored via configuration tool
30.05.2007 EtherCAT Communication 40
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Register – ESC Data Sheet
• Register description for every ESC (FPGA/ ASIC)
– DL Information, DL Control, DL Status, DL Address
– AL Control, AL Status, AL Event
– SyncManager + FMMU configuration
– Distributed Clocks
– Slave Information interface (Serial EEPROM )
Enable Disable Ports
Status of the device state machine
Error Code
32 Bit I/0, SPI, µC Interface
Control of the device state machine
30.05.2007 EtherCAT Communication 41
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
SyncManager Overview
• SyncManager protects a DPRAM section from simultaneous access � data consistency
• Mailbox Type
– 1 buffer SyncManager supports handshake
– Data overflow protection
– Writing side must write before reading side can read
– Reading side must read before writing side can write again
• Buffered Type
– 3 buffer SyncManager guarantees consistent data delivery and access to the newest data any time
– Always a free buffer to write
– Always a consistent buffer to read (except before the first writing)
– Usually used for process data communication
• Up to 16 independent SyncManger channels possible
• The SyncManager configuration registers start at address 0x0800
30.05.2007 EtherCAT Communication 42
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Buffered Type (3 buffers) Write Example
• Characteristic: Data always available for both sides
• Requires 3 (consecutive) memory areas
ECAT NEXT USEREtherCAT PDI
Write end
Write begin WRITE WRITE WRITE
WRITE WRITE WRITE
WRITE WRITE WRITE
WRITE WRITE WRITE
WRITE WRITE WRITE1 2 3
Read end
2
3
Read latest
available data
Read latest
available data READ READ READ
READ READ READ
READ READ READ
READ READ READ
READ READ READ
Write begin
2ECATECATECATECA
TECATECATECATEC
ATECATECATECATE
CATECATECAT
1WRITE WRITE WRITE
WRITE WRITE WRITE
WRITE WRITE WRITE
WRITE WRITE WRITE
WRITE WRITE WRITE
1WRITE WRITE WRITE
WRITE WRITE WRITE
WRITE WRITE WRITE
WRITE WRITE WRITE
WRITE WRITE WRITE
3READ READREAD READ READ
READ READ READ
….Go on Reading
a
b
c
Cycle begins again � a
30.05.2007 EtherCAT Communication 43
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Mailbox Type (1 buffer) Read Example
• Allows handshake Communication
• Useful for non-Process Data
• Handshake mechanism – one side has control
EtherCATMaster
FailedMBX Empty
Read ����
Read
WKC = 0
Write ����
Write
MBX Full Successfull
Slave
MBX Empty
Read ����
Read
WKC = 1
Successfull
30.05.2007 EtherCAT Communication 44
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
SyncManager channel configuration registers
Start Address Length Ctrl Status E
16 Bit 16 Bit 8 Bit 8 Bit 16 Bit
Channel
Enable
1/3 Buffer R/W IE IP WD R
00: 3 Buffer
10: 1 Buffer
00: Read
01: Write
Interrupt
Enable
to PDI
Watchdog
Enable
0 2 4 5 6 7
IW 1PWD Res.IR 3P
Completely
written
Completely
read
0: read
1: written
00: Buffer 0
01: Buffer 1
10: Buffer 2
11: locked (Start)
0 1 2 3 4 6
0 16 32 40 48 49
Repeat Reserved
R49 49
Res50
0 1
E49R
5649Res
57 63
Request
MasterResponse
Slave
30.05.2007 EtherCAT Communication 45
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
SyncManager assignment
• Standard assignment
– With mailbox support
• SM0: Mailbox output
• SM1: Mailbox input
• SM2: Process data outputs
• SM3: Process data inputs
• Readable via CoE object 1C00h
– Without mailbox support
• SM0: Process data outputs (or inputs if no outputs available)
• SM1: Process data inputs
• Extended assignment
– SM0: Mailbox output
– SM1: Mailbox input
– Rest is configurable via CoE object 1C00h
• One or more PDO always fit exactly in a SyncManager
30.05.2007 EtherCAT Communication 46
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Fieldbus Memory Management Unit (FMMU)
• Maps a section of the local address space into the global
address space and vice versa
• Read and write access distinguishable
• Bitwise configuration of the memory section possible
• Up to 16 independent FMMU channels possible
– FMMU configuration registers start at address
0x0600
• Operation samples:
• Mapping of process data into the global address space
• Mapping of status bits from the register section
– Access to device specific status information with a
minimum overhead – e.g. fill status of a sync
manager channel
30.05.2007 EtherCAT Communication 47
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
FMMU Usage for Addressing
• Global address space
• 4 GByte address space
• Mapping to local addresses by
Fieldbus Memory Management Units (FMMU)
• All EtherCAT devices can map data in a single EtherCAT
Datagram LRW – depending on the FMMU configuration
Ethernet HDR EH Data FCSFH WKC
30.05.2007 EtherCAT Communication 48
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
FMMU entity configuration registers
Glob. Start Addr. Length GSB
32 Bit 16 Bit 8 Bit
Enable
GEB Phy. Start LSB Dir E Res…
8 Bit 16 Bit 8 Bit 8 Bit 1 31 Bit
0-7 Reserved W ReservedR
Global
Start Address
(32 Bit)
Length of all
concerned
Bytes
GSB: Global Start Bit
GEB: Global End Bit
LSB: Local Start Bit
Read Enable
Write Enable
Local
Start Address
(16 Bit)
3 Bit 5 Bit 6 Bit
0 32 48 56 64 80 88 96 97 127
0 3 7 7210
30.05.2007 EtherCAT Communication 49
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
FMMU Setup
1. Master reads hardware configuration including input and
output data length of each slave
2. Master organizes mapping of process data
3. Master distributes information (start address etc.) for
every slave about where process data in logical process
image is provided
4. Process data communication starts
30.05.2007 EtherCAT Communication 50
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
FMMU example
• Map 6 Bits form logical address 0x14711.3 to 0x14712.0 to
the physical register bits 0x0F01.1 to 0x0F01.6.
– The FMMU length is 2 Byte, since the mapped bits
span 2 Bytes of the logical space.
1 (enable)0xCActivate
Rand and/or Write0xBType
0x01
0x0F01
0x00
0x03
0x0002
0x00014711
ValueFMMU reg. offsetFMMU config. register
0x0:0x3Logical Start Address
0x4:0x5Length (Byte)
0x6Logical Start Bit
0x7Logical Stop Bit
0xAPhysical Start Bit
0x8:0x9Physical Start Address
Note: FMMU configuration registers start at address 0x0600
30.05.2007 EtherCAT Communication 51
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Diagnosis at Data Link – Possible Errors
Close loop in the middle
Check errors again
If no frame loss repeat this in the 2nd half of
segment
Otherwise repeat this in the first half of segment
Repeat this until only a single station remains,
which should be the station with problems
Frame loss
Check working counter of a Broadcast readLink loss/
Station fault
Check Link Status of last device (should have
only a single port connected)
Change
between In and
Out Cable
Check Transmission Error Counter of each stationTransmission
Errors
Check EEPROM, Vendor, Device, SerialNoWrong Station
DetectionError situation
30.05.2007 EtherCAT Communication 52
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Monitoring of EtherCAT Communication
Switch
Master
• Masters sends an EtherCAT Frame (broadcast)
� Monitor gets the first copy (unprocessed)
• Frame returns from EtherCAT Slave Devices
� Monitor gets the second copy (processed)
• DLL for readable format available on EtherCAT Web site
Network Monitor
30.05.2007 EtherCAT Communication 53
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Monitoring of EtherCAT Communication
Master
• Masters sends an EtherCAT Frame (broadcast)
� Monitor gets the first copy (unprocessed)
• Frame returns from EtherCAT Slave Devices
� Monitor gets the second copy (processed)
• DLL for readable format available on EtherCAT Web site
Network Monitor
Attention:
At low cycle times order of frames might be mixed because of timing restrictions within
NDIS protocol driver
30.05.2007 EtherCAT Communication 54
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Purpose of Application Layer (AL)
• EtherCAT State Machine
• Mailbox Interfaces and Protocols
– Ethernet over EtherCAT
– CANopen over EtherCAT
– Filetransfer over EtherCAT
– Servo Drive over EtherCAT
• Slave Information Interface (SII)
30.05.2007 EtherCAT Communication 55© Copyright by Beckhoff, 2007
Application
EtherCAT Slave Controller (ESC)
Application
e.g. CiA402 Drive Profile
HTTP,
FTP, ..Appli-
cation
PHY
Trafo
RJ45PHY
Trafo
RJ45
FMMU
SyncMan1 MbxIn
SII
EEPROM
MII / EBUS
Port 3
MII / EBUS
Port 1
EtherCAT Processing Unit
and Auto-Forwarder with Loop Back
LVDS
Con
Process DataMailboxRegisters
Data
Link
Layer
(DL)
Physical
Layer
(PL)
FMMU
SyncMan2 SyncMan3
SDO
Object Dictionary
PDO...
Application
Layer
(AL)File
Access
TCP, UDP
ESC Address Space (DPRAM)
FMMUFMMU n
IP
PDO Mapping
CoECoEEoEFoEVoE
Process Data Interface (µC, SSI, I/O )
….
PHY
Management
FMMU n
SyncMan0 MbxOut
RD / WR
MII / EBUS
Port 0
MII / EBUS
Port 2
Ethernet HDRLRWProcess DataFPWRMailbox DataMore Datagrams..FCS ECAT HDR
WKC
WKC
HDR
HDR
Mailbox DLL
0x0000 0x1000
30.05.2007 EtherCAT Communication 56
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Purpose of EtherCAT State Machine
• State Machine is build upon the Data Link Layer
• Defines general communication states of EtherCAT slave
devices
• Specifies the initialization and error handling of EtherCAT
slave devices � Boot-up of the network
• States correspond to the communication relationship
between master and slave
• Requested and current state of a slave device are
reflected in the AL Control and AL Status registers
• Five states are defined:
– ‘Init’, ‘Pre-Operational’, ‘Safe-Operational’,
‘Operational’
– ‘Bootstrap’ optional state for firmware updates
30.05.2007 EtherCAT Communication 57
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT State Machine
Init
(IP)
Pre-Operational
Operational
Safe-Operational
(OP)
(PI)
(PS) (SP)
(OS)(SO)
(SI)
(OI)
Bootstrap(optional)
(IB) (BI)
30.05.2007 EtherCAT Communication 58
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
State Machine / Init
• ‘Init’ State
• No communication on the
Application Layer
• Master has access to the
DL-Information registers
• Transition to ‘Pre-Operational’
• Master configures register, at least:
– DL Address register
– Sync Manager channels for Mailbox communication
• Master requested ‘Pre-Operational’ state
– sets AL Control register
– wait for AL Status register confirmation
Init
Pre-Operational
Operational
Safe-Operational
30.05.2007 EtherCAT Communication 59
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
State Machine / Pre-Operational
• ‘Pre-Operational’ State
• Mailbox communication on the
Application Layer
• No Process Data communication
• Transition to ‘Safe-Operational’
• Master configures parameter using the Mailbox
– e.g.: Process Data Mapping
• Master configures DL Register
– SyncManager channels for Process Data
communication
– FMMU channels
• Master requested ‘Safe-Operational’ state
Init
Pre-Operational
Operational
Safe-Operational
30.05.2007 EtherCAT Communication 60
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
State Machine / Safe-Operational
• ‘Safe-Operational’ State
• Mailbox communication on the
Application Layer
• Process Data communication,
but only Inputs are evaluated –
Outputs in ‘Safe’ state
• Transition to ‘Operational’
• Master sends valid Outputs
• Master requested ‘Operational’ state
(AL Control/Status)
Init
Pre-Operational
Operational
Safe-Operational
30.05.2007 EtherCAT Communication 61
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
State Machine / Operational
• ‘Operational’ State
• Inputs and Outputs are valid
Init
Pre-Operational
Operational
Safe-Operational
30.05.2007 EtherCAT Communication 62
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
State Machine / Bootstrap
• ‘Bootstrap’ State
• ‘Bootstrap’ State is optional –
but recommended if firmware
updates necessary
• State changes only from and to ‘Init’
• No Process Data communication
• Communication via Mailbox on Application Layer
• Special mailbox configuration possible,
e.g. larger mailbox size
• Only FoE protocol available (possibly limited “file” range)
Init
Pre-Operational
Operational
Safe-Operational
Bootstrap
30.05.2007 EtherCAT Communication 63
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
State Machine / Control and Status
• Requested and current state of a slave device are
reflected in the AL Control and AL Status registers
– AL Control (0x0120)
Initiate State Transition of Device State Machine
– AL Status (0x0130)
Actual State of Device State Machine
– AL Status Code (0x0134)
Reason of error or other status code
30.05.2007 EtherCAT Communication 64
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Diagnosis at Application Layer
• AL Status Code (0x0134)
– Error Codes (extract)
– Further Status Codes (extract)
Sync manager watchdog0x001B
Synchronization error0x001A
No valid outputs0x0019
No valid inputs available0x0018
Invalid mailbox configuration0x0015
Invalid requested state change0x0011
No Error0x0000
DescriptionCode
Invalid DC Latch Configuration0x0031
Invalid DC Sync Configuration0x0030
Slave need PREOP0x0022
Slave needs INIT0x0021
DescriptionCode
30.05.2007 EtherCAT Communication 65
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Full duplex capable
Mailbox Transfer for Parameter Data
Mailbox Transfer
DVI
IPC
....
Statusword0x6041
Controlword0x6040
Actual values0x2070
Motor parameter0x2040
Velocity control0x2010
Current control0x2000
TxPDO Mapping0x1A00
RxPDO Mapping0x1600
ValueIndex
Device Parameter (example)
Simple IO-Device
No Parameter
� No Mailbox necessary
State "PreOperational"
30.05.2007 EtherCAT Communication 66
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Purpose of Mailbox Transfer
• Standard way to exchange Parameter Data
• The Mailbox Interface is optional – but recommended
• Needed if Process Data configurable or any other non
cyclic services
• Full duplex capable
(Slave can initiate a communication)
• 2 Sync Manager channels reserved
– Sync Manager 0 : Master to Slave
– Sync Manager 1 : Slave to Master
• Available at early stage of communication
(State Pre-Operational)
• Multi protocol capable
30.05.2007 EtherCAT Communication 67
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Mailbox Protocol Types
• Ethernet over EtherCAT (EoE)
– Tunnels standard Ethernet Frames over EtherCAT
• CANopen over EtherCAT (CoE)
– Access of a CANopen object dictionary and its objects
– CANopen Emergency and optional event driven PDO messages
• File Access over EtherCAT (FoE)
– Download and upload firmware and other ‘files’
• Servo Drive over EtherCAT (SoE)
– Access the Servo Profile Identifier (IDN)
• Vendor specific Profile over EtherCAT (VoE)
– First DWORD contains the Vendor ID, the next WORD contains a Vendor Type, the rest is vendor specific
30.05.2007 EtherCAT Communication 68
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Mailbox Interface
• Datagram within an EtherCAT Frame
• 2 Sync Manager channels (1 buffer-mode) reserved
– Sync Manager 0 : Master to Slave Mbx
– Sync Manager 1 : Slave to Master Mbx
EC HeaderType = 1
EtherCAT Data
1st EtherCAT Datagram nth EtherCAT Datagram…
Ethernet HeaderType = 88A4h
FCS
2nd …
Datag. Header Data WKC
Mailbox Protocol
Mbx Header Command Cmd specific data
30.05.2007 EtherCAT Communication 69
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Mailbox Header
Mbx Header Command Cmd specific data
48 Bit
Length0
Address Channel Prio Type Cntr
16 Bit 16 Bit 6 Bit 2 Bit 4 Bit 4 Bit
16 32 38 40 44
Length of following dataLength
Station Address of originatorAddress
reserved for future useChannel
reserved for future usePriority
Sequence number for duplicate detection
Increments with every new mailbox service (only the values 1-7 will be used to be compatible with older versions).
Counter
Mailbox Type, Protocol identifier for following data0 Mailbox Error
2 EoE (Ethernet over EtherCAT)
3 CoE (CANopen over EtherCAT)
4 FoE (File Access over EtherCAT)
5 SoE (Servo Drive over EtherCAT)
15 VoE (Vendor specific profile over EtherCAT)
Type
30.05.2007 EtherCAT Communication 70
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Resilient Mailbox Procedure
• Reliable way of mailbox data exchange
• Mailbox control procedure
• Recover from lost frames
• No additional frames if no error
• Additional receive buffer required
• Extra counter in mailbox header needed
• HW/SW solution
– SyncManager configuration register with toggle flags
– SW-Mailbox-DL Layer for checking toggle bits
30.05.2007 EtherCAT Communication 71
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Mailbox Error Handling – Sync Manager
• Sync Manager channel configuration registers
WTStart Address Length Ctrl Status
16 Bit 16 Bit 8 Bit 8 Bit
0 16 32 40E Res.
6 Bit1
48 49 63D Res.
6 Bit1
56 5850RT57
1 1
WT – SM Write Toggle
RT – SM Read Toggle
• Following:
– Mailbox Error Handling - Write Example
– Mailbox Error Handling - Read Example
30.05.2007 EtherCAT Communication 72
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Mailbox Error Handling – Mailbox Write
MBX_MailboxWriteInd
Master Slave
FPWR response got lost,
Master repeats the Mailbox
Write without incrementing
the Mbx Hdr Ctr
Slave receives Mailbox Write Event
and calls MBX_MailboxWrite Ind
to start the handling on the Mailbox
Write service
Mailbox Write (Mbx Hdr Ctr=1)
Mailbox Write (Mbx Hdr Ctr=1)
Slave receives Mailbox Write Event,
detects an unchanged counter
in the mailbox header and discard
the Mailbox Write Service
30.05.2007 EtherCAT Communication 73
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Mailbox Error Handling – Mailbox Read
Master Slave
FPRD response got lost,
Master starts a repeating
sequence and shall not
read the mailbox again
before the repeating
sequence Is finished
Slave puts the Mailbox Read service
in the send mailbox and stores
the actual sent buffer
Slave receives Mailbox Read Event
and stores the sent buffer for a
possibly repeated service
MBX_MailboxSendReq(pMbx)
psReadMbx = pMbxMaster sends FPRD service,
to read the mailbox
psRepeatMbx = psReadMbx
Slave detects the Mailbox Repeat
request by checking the SM-Write-
Toggle, puts the psReceiveMbx
buffer in the Send mailbox and
toggles the SM-Read-ToggleMaster reads cyclically
the SM-Read-Toggle to
check if the Slave has
finished the repeat request
When the SM-Read-Toggle
has toggled the master reads
the send mailbox again
Mailbox Read
Mailbox Repeat (toggles SM-Write-Toggle)
Read SM-Read-Toggle
Mailbox Read (Mbx Hdr Ctr=1)
Mailbox Read
Mailbox Read (Mbx Hdr Ctr=1)
psReadMbx = psRepeatMbx
30.05.2007 EtherCAT Communication 74
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Ethernet over EtherCAT (EoE)
virtual
Ethernet
Switch
Functionality
Web server
virtual MAC Address
IP Address
Label printerWeb access on device with
web server
Even via
Internet
Switchport-
Terminal
Master
TCP/IP
30.05.2007 EtherCAT Communication 75
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Purpose of Ethernet over EtherCAT (EoE)
• Tunnels transparently Ethernet Frames over EtherCAT
• Tunneling reduces the cycle times without restrictions and
to optimized available bandwidth
• Used for devices with TCP/IP stacks (e.g. Web Server)
and for infrastructure devices like Switch Terminals
• Allows to access corresponding devices in the normal IP
network in combination with a ‘Virtual Ethernet Switch’
(Layer 2) on the master side
30.05.2007 EtherCAT Communication 76
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EoE – Switchport: Any Ethernet Protocol
• Interface to any Ethernet Device or Network
• Ethernet Frames are inserted in EtherCAT Protocol
EtherCAT Switchport
EtherCAT MAC / DLL PHYPHY
Process DataMailbox
µC
Ethernet MAC PHY
Fragmentation
TX1TX2TX3
TX
TX2TX3TX1
RX RX4RX1 RX2 RX3
30.05.2007 EtherCAT Communication 77
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EoE – Virtual Switch on Master
EoEVirt.
Switch
172.17.1.1
172.17.1.4
30.05.2007 EtherCAT Communication 78
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EoE – Bandwidth estimation
• EtherCAT Realtime not restricted by EoE
30.05.2007 EtherCAT Communication 79
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EoE – Frame Header
Mbx HeaderType = 2 (EoE)
EoE Cmd Cmd specific data
4 Byte
Type
4 Bit
Port
4 Bit
LF
1B
TA TR
1B 1B
res
5B
Frag.
NoSize
Frame
No
6 Bit 6 Bit 4 Bit
Number of the Ethernet FrameFrame No
Complete size of Ethernet FrameSize
Fragment Number of the Ethernet Frame fragmentFragment No
Time stamp requestTR
Time stamp appended (only if LF=1)TA
Last fragmentLF
Selected PortPort
EoE Frame Type0x00 EoE Fragment Request
0x01 Initiate EoE Request
0x02 IP Parameter Request
0x03 IP Parameter Response
0x04 Set MAC Address Filter Request
0x05 Set MAC Address Filter Response
Type
8 Byte Max. 1476 Byte
30.05.2007 EtherCAT Communication 80© Copyright by Beckhoff, 2007
EoE – Frames
EoE (Mbx Type = 2)
Mbx Header Fragment DataEoE Header (Type=0, TA=0)
Mbx Header Fragment DataEoE Header (Type=0,LF=1,TA=1) Time Stamp
Mbx Header IP Settings
Mbx Header MAC Filter Settings
Mbx Header
EoE Header (Type = 2)
EoE Header (Type = 4)
EoE Header (Type = 1) Time Stamp
n * 32 Byte
(except for the last fragment)
Mbx Header EoE Header (Type = 3)
Mbx Header EoE Header (Type = 5)
IP Settings Response
MAC Filter Settings Response
32 Bit
30.05.2007 EtherCAT Communication 81
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EoE – Time Stamp
• Time Stamp
– 32 Bit Timing information with 1 ns resolution
– DC System Time if available (Register 910h)
– Time stamp trigger is the beginning of Destination Address (DA) in the Ethernet Frame
• Time stamp appended (TA = 1)
– Slave to Master:Time stamp contains exact receive time
– Master to Slave:Time Stamp contains desired send time
– Time stamp extends frame data by 32 Bit
– TA is allowed in last fragment only (LF = 1).If necessary, add additional fragment
• fill the “last” fragment with parts of the Time Stamp (LF=0, TA=0) and send a very last fragment with the rest of the Time Stamp (LF=1, TA=1)
– Slave should always append a Time Stamp if it has this feature
30.05.2007 EtherCAT Communication 82
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EoE – Time Stamp
• Time Stamp requested (TR = 1)
– Response with the exact send time and the same
FrameNo requested
– Response should be send as soon as possible
– Can be used for segment to segment synchronization
30.05.2007 EtherCAT Communication 83
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EoE – Error Handling
• No special Error Handling required!
• EoE is a Layer 2 Protocol – logical like an Ethernet Switch
• If a fragment is missing, the whole frame will be discarded
• Frame loss is recognized at higher levels
30.05.2007 EtherCAT Communication 84
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Purpose of CANopen over EtherCAT (CoE)
• Recommended protocol for Service Data Access
– Configuration of communication parameter
– Configuration of device specific parameter
• Easy migration path from CANopen Devices to EtherCAT CoE
Devices
– Protocol Stacks can be re-used
30.05.2007 EtherCAT Communication 85
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Device
EtherCAT Slave Controller
Process DataMailbox
Ethernet Physical Layer
Service Data Objects
Object Dictionary
PDO Mapping
CoE CoE
CANopen Application
Process Data
CANopen over EtherCAT Device Architecture
30.05.2007 EtherCAT Communication 86
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Standard CANopen Features
CANopen over EtherCAT (CoE)
• SDO: Access to a CANopen object dictionary ✔– Download and Upload of parameters
– Standard Process Data Mapping (PDO Mapping)
– Full Access to CANopen Profiles
• PDO: Process Data Objects ✔– Direct PDO transfer
– Remote Transmission Requests of PDOs
• Emergency Messages ✔• Network Management ✔
• + Object Dictionary Information (SDO Information)
– Upload of object dictionary (identifier lists)
– Upload of object description
– Upload of entry descriptions
30.05.2007 EtherCAT Communication 87
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
CoE –Frame Header
Mbx HeaderType = 3 (CoE)
CoE Cmd Cmd specific data
Number
9 Bit
res
3 Bit
Type
4 Bit
PDO Number (PDO transfer only)Number
Message Type0 reserverd
1 Emergency Message
2 SDO Request
3 SDO Response
4 TxPDO
5 RxPDO
6 Remote transmission request of TxPDO
7 Remote transmission request of RxPDO
8 SDO information
9-15 reserved for future use
Type
2 Byte8 Byte Max. 1478 Byte
30.05.2007 EtherCAT Communication 88
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
CoE – Standard CANopen Frames
Mbx HeaderType = 3 (CoE)
CoE Cmd Cmd specific data
SDO
Control
8 Bit
Index
8 Bit
Subindex
16 Bit
Optionally more than 4 bytes of data can be sent
with one frame.
Full mailbox size usable
Data (optional)
Data for the SDO-ServiceData
… and SubindexSubindex
Standard CANopen SDO ServicesSDO Control
Object Addressing by Index …Index
2 Byte8 Byte Max. 1478 Byte
DataData
(optional)
32 Bit 1 .. 1470 Byte
Standard CANopen Frame
30.05.2007 EtherCAT Communication 89
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Example: ‘Initiate SDO Download’ Request
Mailbox Header CoE SDO
48 Bit 16 Bit
DataIndexI
8 Bit 32 Bit16 Bit
0 32 63
Data (optional)
64 Bit
0-4 Bytes E Size C Ccs Sub1 2 4 5 8 24
LengthIndexI0 32
E Size C Ccs Sub1 2 4 5 8 24
1 1 4-n 0 1
Data 7-n64
0 0 0 0 1
Data > Mailbox: ‘Download SDO Segment’ follows
L0
Size T Ccs1 4 5
Data 0-68
0/1 0 0/1 0
<= 7 BytesL
0
Size T Ccs1 4 5
Data 0-n8
0/1 7-n 0/1 0
63
Data 0-n64
Expedited
Mailbox Size
> 4 Bytes
> 7 Bytes
left
= Initiate SDO Download Request
= Download SDO Segment Request
the original
CANopen Protocol
(CiA DS301)
30.05.2007 EtherCAT Communication 90
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Optional SDO Extensions to CANopen DS 301
• Breaking of the 8 byte border
– Full mailbox size usable � Block transfer unnecessary
– ‘Initiate SDO Download’ request / ‘SDO Upload’ response can contain data after SDO header
– ‘Download SDO Segment’ request / ‘Upload SDO Segment’ response can contain more than 7 bytes of data
• Downloading and Uploading all Subindices at once
– Bit 4 of the Initiate ‘SDO Download / Upload’ request header indicates a ‘Complete Access’ to an Index
– Sub Index field contains the start Subindex
• 0: Complete Index with all Subindices
• 1: Complete Index without Subindex 0
30.05.2007 EtherCAT Communication 91
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
CoE: Optional SDO Information Protocol
• Access to object lists
– list of all supported object identifiers
– list of all object identifiers that can be mapped in
PDOs
– list of all object identifiers that should be included in
a backup
• Access to object descriptions
– Descriptions of objects – as defined in DS 301
• Access to entry descriptions
– Descriptions of object entries (sub index) – as
defined in DS 301
30.05.2007 EtherCAT Communication 92
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
CoE – Object Dictionary
• Devices with an EtherCAT-CoE and a CANopen interface
are possible with the same object dictionary
MeaningIndex Range
reserved0xA000 – 0xFFFF
Profile specific0x6000 – 0x9FFF
Manufacturer specific0x2000 – 0x5FFF
Communication objects• Device Type, Identity, PDO Mapping – like defined in DS 301
• Objects defined in DS 301 not needed are reserved for EtherCAT
• Additional objects (Sync Manager Communication Type, Sync
Manager PDO Assignment) located in unused areas of DS 301
0x1000 – 0x1FFF
Data Type Description0x0000 – 0x0FFF
30.05.2007 EtherCAT Communication 93
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
CoE – Online Object Dictionary
30.05.2007 EtherCAT Communication 94
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
CoE – New objects for EtherCAT
• SyncManager Communication Type
– Subindex (1-32) defines communication type of the corresponding Sync Manager channel
• Mailbox Out (= 1 buffer write)
• Mailbox In (= 1 buffer read)
• Process Data Out (= 3 buffer write)
• Process Data In (= 3 buffer read)
• SyncManager PDO Assign
– Contains a list of assigned PDOs for each Sync Manager channel (Index of PDO mapping objects)
– Assigned PDO in Subindex 1 to n describe the process data parts of the Sync Manager channel
• SyncManager Parameter
– SubIdx 1: Synchronization type (Freerun, synchron, DC Sync0, DC Sync1, SyncSm0 .. SyncSm1F)
– SubIdx 2: Cycle time
– SubIdx 3: Shift time
MeaningIndex
SyncManager Parameter 0x1C30 – 0x1C4F
SyncManager PDO Assign 0x1C10 – 0x1C2F
SyncManager Communication Type 0x1C00
30.05.2007 EtherCAT Communication 95
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
CoE – Process Data Objects
• Standard CANopen PDO frames can be used
• CANopen PDO mapping used for EtherCAT too
• PDOs usually are related to their „own“ Sync Manager
channels
– Cyclic data transmission
– No PDO communication parameters necessary
• PDOs can be transmitted by the mailbox for acyclic
communication
Process Data
1…8 Byte
Process Data
1..n Byte
Standard CANopen PDO frame optional
30.05.2007 EtherCAT Communication 96
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
CoE – PDO Process Data mapping
• No mapping protocol implemented for very simple devices
– Fixed process data
– Readable via EEPROM – no SDO protocol necessary
• Readable PDO Mapping
– Fixed process data mapping
– Readable via SDO
• Selectable PDO Mapping
– Multiple fixed PDO – selectable via CoE object (1C1xh)
– Selectable via SDO (required)
• Variable PDO Mapping
– Configurable via CoE or SoE required
– Writable PDO content
30.05.2007 EtherCAT Communication 97
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
CoE – PDO Configuration
30.05.2007 EtherCAT Communication 98
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
CoE – Emergency Message
• Standard CANopen Emergency frames can be used
• More than 5 bytes of data can be send optionally with one
frame
DataError RegisterErrorCodeCoE HeaderMailbox Header
2 Bytes6 Bytes 2 Bytes 1 Byte 5 Bytes
Data
1..n Bytes
Standard CANopen Emergency frame optionalMandatory Header
30.05.2007 EtherCAT Communication 99
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
File Access over EtherCAT (FoE)
• Similar to TFTP (Trivial File Transfer Protocol, RFC 1350)
• Simple to implement – suitable for bootstrap loaders
• 6 Services are defined:
– WRQ: Write request with “file name”
– RRQ: Read request with “file name”
– DATA: Data block (full mailbox size used)
– ACK: Acknowledgment of DATA and WRQ requests
– ERR: Error notification with predefined error codes
– BUSY: Busy notification in case of longer procedures,extension to TFTP (e.g. erasing of flash modules)
• Special mailbox configuration for bootstrap mode possible
– Fixed addresses and fixed size of the mailbox
– Configuration defined by device (EEPROM)
30.05.2007 EtherCAT Communication 100
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
File Access over EtherCAT (WRQ, normal)
Master Slave
WRQ (with file name)
ACK (packet no 0)
DATA (packet no 1, full mailbox)
ACK (packet no 1)
DATA (packet no 2, full mailbox)
ACK (packet no 2)
DATA (packet no 3, less data or zero data)
ACK (packet no 3)
30.05.2007 EtherCAT Communication 101
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
File Access over EtherCAT (WRQ, with busy)
Master Slave
WRQ (with file name)
ACK (packet no 0)
DATA (packet no 1, full mailbox)
ACK (packet no 1)
DATA (packet no 2, less data or zero
data)BUSY (X of N done)
DATA (packet no 2, less data or zero data)
BUSY (Y of N done)
DATA (packet no 2, less data or zero data)
ACK (packet no 2)
30.05.2007 EtherCAT Communication 102
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
File Access over EtherCAT (WRQ, with error)
Master Slave
WRQ (with file name)
ERR (error code and optional error text)
30.05.2007 EtherCAT Communication 103
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
File Access over EtherCAT (RRQ, normal)
Master Slave
RRQ (with file name)
DATA (packet no 1, full mailbox)
ACK (packet no 1)
DATA (packet no 2, full mailbox)
ACK (packet no 2)
DATA (packet no 3, less data or zero data)
ACK (packet no 3)
30.05.2007 EtherCAT Communication 104
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Servo Drive over EtherCAT (SoE)
• Implements Service Channel
– Read / Write to several elements of an IDN (Ident number)
– Support of Procedure Commands
– Slave Info
• The mapping of the IEC 61800-7-1 Annex D (SERCOS™) on
EtherCAT is described in IEC 61800-7-3 Annex D
30.05.2007 EtherCAT Communication 105
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
SoE – Frame Header
Mbx HeaderType = 5 (SoE)
SoE Cmd Cmd specific data
4 Byte
Cmd
3 Bit
Incomp
1 Bit
Drive
3 Bit
contains IDN according to IEC 61800-7-2 Annex D
or an indicator for fragments left in case of segmented service
IDN
Contains the ElementFlags. There is a single Flag for each
element of an IDN indicating which elements of the object
addressed by the IDN are accessed
Element
Indicates if an Error has occurredError
Contains the address of the drive inside the slave device that is
addressed
Drive
Indicates if execution of another service is needed to complete
the operation
Incomplete
Command TypeRead Request, Read Response, Write Request, Write Response, Notification
Command
Err
1 Bit
Element
8 Bit
IDN
16 Bit
6 Byte Max. 1476 Byte
30.05.2007 EtherCAT Communication 106
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
SoE Communication phases
Init
(IP)
Pre-Operational
Operational
Safe-Operational(OP)
(PI)
(PS) (SP)
(OS)(SO)
(SI)
(OI)
Phase 0 / 1
Phase 2
Phase 3(with Inputs)
Phase 4
(S-0-0128)
(S-0-0127)
EtherCATIEC 61784
CPF 16
• SERCOS communication phases (CPs) comparable to EtherCAT state machine
• Phases 0 and 1 covered by the ‘Init’
• Phase 2 corresponds to ‘Pre-Operational’
allows access to the IDNs via ‘service channel’ (SoE).
• Phase 3 mapped to ‘Safe-Operational’
slave shall transmit valid inputs, ignore outputs from the master.
• ‘Operational’ corresponds to phase 4
all inputs and outputs are valid.
30.05.2007 EtherCAT Communication 107
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Slave Information Interface (SII)
PHY PHY
Trafo
Trafo
RJ45
RJ45
ESC
Host
CPU
EEPROM
DVI....
EDSXML
Slave
ESC
Configuration
Data
30.05.2007 EtherCAT Communication 108© Copyright by Beckhoff, 2007
Application
EtherCAT Slave Controller (ESC)
Application
e.g. CiA402 Drive Profile
HTTP,
FTP, ..Appli-
cation
PHY
Trafo
RJ45PHY
Trafo
RJ45
FMMU
SyncMan1 MbxIn
SII
EEPROM
MII / EBUS
Port 3
MII / EBUS
Port 1
EtherCAT Processing Unit
and Auto-Forwarder with Loop Back
LVDS
Con
Process DataMailboxRegisters
Data
Link
Layer
(DL)
Physical
Layer
(PL)
FMMU
SyncMan2 SyncMan3
SDO
Object Dictionary
PDO...
Application
Layer
(AL)File
Access
TCP, UDP
ESC Address Space (DPRAM)
FMMUFMMU n
IP
PDO Mapping
CoECoEEoEFoEVoE
Process Data Interface (µC, SSI, I/O )
….
PHY
Management
FMMU n
SyncMan0 MbxOut
RD / WR
MII / EBUS
Port 0
MII / EBUS
Port 2
Ethernet HDRLRWProcess DataFPWRMailbox DataMore Datagrams..FCS ECAT HDR
WKC
WKC
HDR
HDR
Mailbox DLL
0x0000 0x1000
30.05.2007 EtherCAT Communication 109
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Purpose of Slave Information Interface
• The mandatory Slave Information Interface (SII) consists of
all objects that can be stored persistently.
• The information is stored in an EEPROM
• EtherCAT Slave Controller has SPI interface to EEPROM
– 1 kBit … 4 MBit
• The SII contains
– boot configuration data
– device identity (mandatory)
• Vendor Id, Product Code, Revision No, Serial No
• Same information in CoE object 0x1018
– application information data
• Contains additional information (optional)
– Subdivided in categories
30.05.2007 EtherCAT Communication 110
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
SII – EEPROM content
30.05.2007 EtherCAT Communication 111
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
SII – EEPROM Layout
EtherCAT Slave Controller Configuration Area
VendorId ProductCode RevisionNo SerialNo
Additional Information (Subdivided in Categories)
…
0
16
32
Byte
128
Hardware Delays Bootstrap Mailbox Config48
Reserved
Mailbox Sync Man Config
Category FMMU
Category Strings
Category Generals
Category SyncManager
Category Tx- / RxPDO for each PDO
30.05.2007 EtherCAT Communication 112
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EEPROM – Slave Configuration Area
CRC of first 6 words
(x^8+x^2+x+1, initial value 0xFF)
Initialization value for Configured Station Alias
Address register
Initialization value for extended PDI
Configuration register
Initialization value for Pulse Length of SYNC
Signals register
in Units of 10 ns
Initialization value for PDI Configuration
register
Depends on the selected PDI,
Configuration of Sync0 and Sync1 Pin
Initialization value for PDI Control register
(EEPROM ADR 0x0000.9 is also mapped to
register 0x0110.2)
Description
Checksum7
Reserved5, 6
0x0012
0x0013
Configured Station Alias4
0x0152
0x0153
Extended PDI
configuration
3
0x0982
0x0983
0x0150
0x0151
0x0140
0x0141
Corresp.
Register
PDI configuration, 1
Pulse length of SYNC
signals
2
PDI Control0
ParameterEEPROM
Word
Address
30.05.2007 EtherCAT Communication 113
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
SII – Categories
• Contains optional information
• Divided in categories
– Standard category(s)
– Vendor category(s)
• Same header for all categories
– Category Type
– Word-Length of data
Category Length
16 Bit 16 Bit
Data…
Receive PDO EntriesRxPDO
Transmit PDO Entries TxPDO
Modes of operation, EnableSyncManger
Device InformationGeneral
FMMU usageFMMU
Text stringsSTRINGS
MeaningCategory
30.05.2007 EtherCAT Communication 114
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Device Profiles – Motivation
• EtherCAT supports complex slaves
• Slaves with multiple channels are common
• Channels consists of
– Process data (Inputs/Outputs)
– Configuration
– Diagnosis
– …
• Different channels may have different functionality
���� Profile for Modular Devices
30.05.2007 EtherCAT Communication 115
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Device Profiles - Overview
Modular Device Profile Frameworkgeneral profile
Static Device Profile – No. 5001
Modular Devices with fixed
configuration
Dynamic Device Profile – No. 5002
Fieldbus Master Profile – No. 5002
Modular devices with dynamic
configuration
Profiles are EtherCAT specific!
Based on
30.05.2007 EtherCAT Communication 116
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Structuring of Object Dictionary
• Mapping of PDO like simple devices
• Basic Idea of Mapping SDO is to have
– Several areas with dedicated functions
– Each IO Channel can have several objects in this
areas
– The number of objects per IO Channel depends
upon implementation
– Up to 4096 Channels can be managed by a single
slave
30.05.2007 EtherCAT Communication 117
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Object Dictionary of Dynamic Device Profile
• 0x0000 – 0x0FFF Data Type Area
• 0x1000 – 0x1FFF: Communication Area
• 0x2000 – 0x5FFF: Manufacturer specific Area
• 0x6000 – 0x6FFF: Input Area
• 0x7000 – 0x7FFF: Output Area
• 0x8000 – 0x8FFF: Configuration Area
• 0x9000 – 0x9FFF: Information Area
• 0xA000 – 0xAFFF: Diagnosis Area
• 0xB000 – 0xBFFF: Service Transfer Area
• 0xC000 – 0xEFFF: Reserved Area
• 0xF000h – 0xFFFF: Device Area
30.05.2007 EtherCAT Communication 118
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Example for Dynamic Device Profile
BK1120 + DI 4 + DO 8 + AO 2BK1120 + DI 4 + DO 8 + AO 2
SI…Subindex (SI0 = number of SIs of this object)
EtherCAT Slave BK1120
Dig. Input 4 Dig. Output 8
Input Entries
RxPDO (Output)
Ouput Entries
Anal. Output 2
TxPDO (Input) 0x1A01
0x7010:SI
SI0, 1-8
0x6010
0x1601
0x1A02
0x7020:SI
SI0, 1-2
0x6020:SI
SI 0, 1-2
0x1602
0x6000:SI
SI 0,1-4
0x1A00
0x1600
0x7000
30.05.2007 EtherCAT Communication 119
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Fieldbus Gateway Profile
• Gateways from EtherCAT to legacy Fieldbusses like
- CANopen
- Profibus
- DeviceNet
- …
30.05.2007 EtherCAT Communication 120
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Drive Control - Modes of Operation
Torque
controlM
Velo.
control
Pos.
control
Pos.
Gen.
NC/ PC Drive
sv
t
EtherCAT
Torque
controlM
Velo.
control
Pos.
control
Pos.
Gen.
NC/ PC Drive
sv
t
EtherCAT
Torque
controlM
Velo.
control
Pos.
control
Pos.
Gen.
NC/ PC Drive
sv
t
EtherCAT
30.05.2007 EtherCAT Communication 121
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Purpose of Drive Profiles
• Definition of drive specific parameters
• Mapping of the parameters
• State machine of drives
• Synchronization behaviour
30.05.2007 EtherCAT Communication 122
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Drive Profile
IEC 61800-7-1 Interface definition
Annex A:Mapping toCiA402
Annex B:Mapping to
CIP
Annex C:Mapping toPROFIdrive
IEC TR 62390Device profile guideline
IEC 61800 Parts 1 to 6Adjustable speed electrical power drive systems
Annex D:Mapping toSERCOS
Abstractmodels
GenericPDSinterface
Mapping tosolutions(profiles)
Driveprofiles
Annex D:Profile
SERCOS
Annex C:Profile
PROFIdrive
Annex B:ProfileCIP
Annex A:ProfileCiA402
IEC 61800-7 Generic interface and use of profiles for power drive systems
IEC 61800-7-2 Profile specifications
Mapping toCANopen
Mapping toEtherCAT
Mapping toPROFIBUS
Mapping toPROFINET
Mapping tonetwork technologies
Mapping toDeviceNet
Mapping toEtherNet/IP
Mapping toSERCOS
I + II
Mapping toSERCOS
III
Mapping toETHERNETPowerlink
Mapping toEtherCAT
Mapping toControlNet
IEC 61800-7-3 Mapping of profiles to network technologies
Annex A Annex B Annex C Annex D
EtherCAT is Part of the drives standard in Annex A and D
SERCOS interface™ is a trade name of Interests Group SERCOS interface e.V. Compliance to this profile does not require use of the trade name SERCOS
interface. Use of the trade name SERCOS interface requires permission of the trade name holder.
30.05.2007 EtherCAT Communication 123
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
M S
S
S S S S S
S
∆t
Purpose of Distributed Clocks (DC)
Precise Synchronization (<< 1 µs!) by exact adjustment of
distributed clocks
DVI
IPC
....
30.05.2007 EtherCAT Communication 124
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
M S
S
S S S S S
S
External Clock Synchronization: IEEE 1588
Switchport with integrated
IEEE 1588 Boundary Clock
DVI
IPC
....
IEEE 1588
Grandmaster
Clock
Boundary
Clock
30.05.2007 EtherCAT Communication 125
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Distributed Clocks – Features
• Synchronization of EtherCAT devices
• Definition of a System Time
– Beginning on January, 1st 2000 at 0:00h
– Base unit is 1 ns
– 64 bit value (enough for more than 500 years)
– Lower 32 bits spans over 4.2 seconds
• Normally enough for communication and time
stamping
• Definition of a Reference Clock
– One EtherCAT Slave will be used as a Reference Clock
– Reference Clock distributes its Clock cyclically
– Reference Clock adjustable from a “global” Reference
Clock – IEEE 1588
30.05.2007 EtherCAT Communication 126
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Distributed Clocks Unit
EtherCAT Slave Controller (ESC)
FMMU n
SyncMan
EtherCAT Address Space
EtherCAT Processing Unit
and Auto-Forwarder with Loop Back
Port 0 Port 1 Port 2 Port 3
PHY
Trafo
RJ45
PHY
Trafo
RJ45
Distributed Clocks
SPI / µC parallel
Digital I/O Sync0 / Latch0
Sync1 / Latch1IRQ
Process Data Interface
(PDI)
Sync / Latch Unit
DC
Control
System Time
Offset
Delay
30.05.2007 EtherCAT Communication 127
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Features of DC Unit within ESC
• Provider for local time signals
– Generation of synchronous local output signals
(SYNC0, SYNC1 Signals)
– Generation of synchronous Interrupts
• Synchronous Digital Output updates and Input sampling
• Precise time stamping of input events (Latch unit)
30.05.2007 EtherCAT Communication 128
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Features of DC Unit within ESC
• Propagation delay measurement support
– Each EtherCAT slave controller measures the delay
between the two directions of a frame
– Master calculates the propagation delays between all
slaves
• Offset compensation to Reference Clock
– Offset between local clock and Reference Clock
– Same absolute system time in all devices
– Simultaneousness (clear below 100ns difference) in
all devices
• Drift compensation to Reference Clock
– DC Control Unit
30.05.2007 EtherCAT Communication 129
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Register System Time
• Registers:
– System Time(0x0910:0x0917, small systems 0x0910:0x0913)
• System Time
– Read access from both sides (EtherCAT and µC)
– Consistent access from µC (access to first byte saves an internal copy)
– Consistent access from EtherCAT (within a single frame, internally latched with SOF)
– Write access from EtherCAT starts the DC control
– ARMW command (auto increment read – multiple write) allows to read System Time of the reverence clock and write it to all slave clocks within a single frame
30.05.2007 EtherCAT Communication 130
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
DC – Propagation Delay Measurement (I)
EtherCAT Node measures time difference between leaving and
returning frame
vom MasterEtherCAT Frame
30.05.2007 EtherCAT Communication 131
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
DC – Propagation Delay Measurement (II)
Propagation delays between any nodes can be computed
DVI
IPC
....
30.05.2007 EtherCAT Communication 132
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Propagation Delay Measurement
• Registers:
– Receive Time Port 0 (0x0900:0x0903)
– Receive Time Port 1 (0x0904:0x0907)
– Receive Time Port 2 (0x0908:0x090B)
– Receive Time Port 3 (0x090C:0x090F)
– System Time Delay (0x0928:0x092B)
• Write access to Receive Time Port 0 activates latch
– Latch local time of SOF (Start of Frame)
– At EOF (End of Frame) SOF time is copied to Receive Time Port X
• Receive Time Port X in local clock units (controlled)
• SOF time of all frames are latched on all ports internally
• Master reads all time stamps and calculates the delay times withrespect to the topology.
• Individual delay time is written to register System Time Delay
30.05.2007 EtherCAT Communication 133
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
MS
S
S S S S S
S
∆t
Offset and Drift Compensation
Same System Time in all devices
DVI
IPC
....
Global System Time
e.g. by RTC or IEEE1588
Reference: Jan 1st 2000
Individual
System Time Offset
30.05.2007 EtherCAT Communication 134
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Offset Compensation
• Registers:
– System Time Offset
(0x0920:0x927, small systems 0x0920:0x0923)
• Difference between the Reference Clock and every slave
device's clock is calculated by the master.
• The offset time is written to register System Time Offset
• Each slave calculates its local copy of the System time
using its local time and the local offset value:
• tLocal copy of System Time = tLocal time + tOffset
30.05.2007 EtherCAT Communication 135
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Drift Compensation – DC Control
• Registers:
– System Time (0x0910:0x0917, small systems 0x0910:0x0913)
– System Time Offset (0x0920:0x927, small systems 0x0920:0x0923)
• ARMW command (auto increment read – multiple write) allows to read System Time of the reverence clock and write it to all slave clocks within a single frame
• DC Control
– Write access to System Time compares received Time with local time
• ∆t = (tLocal time + tOffset + tPropagationDelay) - tReceived Time
– If (∆t > 0) then decelerate local clockelse if (∆t < 0) accelerate local clock
30.05.2007 EtherCAT Communication 136
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
System Time Distribution
Local
Clock @ SOF
Start of Frame (SOF)
Receive Time
Port 0-3
Write to Receive Time Port 0
System Time
Offset+ +-
-
System Time
Delay
Write to System
Time register
SyncSignal
generation
and
LatchSignal
time stamping
Add 9/10/11
every 10ns Local
Clock
Time Control
Loop
System Time (local copy)
30.05.2007 EtherCAT Communication 137
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Initialization of DCs
• Initialization with Propagation Delay compensation1. Master reads the DL Status register of all slaves and calculates the network topology.
2. Master sends a broadcast write to Receive Time Port 0 register (at least first byte). All slaves
latch the local time of the first preamble bit of this frame at all ports and at the ECAT
Processing Unit. Some ESCs need the EtherCAT network to be free of frames before the
broadcast write is sent.
3. Master waits until the broadcast write frame has returned.
4. Master reads all Receive Time Port 0-3 registers (depending on the topology and the Receive
Time ECAT Processing Unit register (0x0918:0x091F) which contains the upper 32 bits of the
receive times.
5. Master calculates individual propagation delays and writes them to System Time Delay
registers of the slaves. Possible overruns of the 32 bit Receive Times have to be checked and
taken into account.
6. Master sets System Time Offset register of the Reference Clock so that the Reference Clock is
bound to the master time. The offset for the Reference Clock is master time minus Receive
Time ECAT Processing Unit (local time) of the Reference Clock.
7. Master calculates System Time offsets for all DC slaves and writes them to the System Time
Offset registers. The offset of each slave is Receive Time ECAT Processing Unit from
Reference Clock minus Receive Time ECAT Processing Unit from each DC slave.
8. For static drift compensation, the master sends many separate ARMW or FRMW drift
compensation frames (e.g., 15,000 frames) to distribute the System Time of the Reverence
Clock to all DC slaves.
9. For dynamic drift compensation, the master sends ARMW or FRMW commands periodically to
distribute the System Time of the Reverence Clock to all DC slaves. The rate of the drift
compensation commands depends on the acceptable maximum deviation.
30.05.2007 EtherCAT Communication 138
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
SyncSignal Generation
• Output of the Sync unit can be used for
– Interrupt generation
– PDI Digital Output Update events
• Can be mapped to
– AL Event Request Register forPDI IRQ
– SYNC0 and SYNC1
• SyncSignals can be generated at a specific System Time
• Four Operation modes are supported:
– Cyclic generation
– Single shot
– Cyclic acknowledge
– Single shot acknowledge
• The second SyncSignal (SYNC1) depends on SYNC0, it can be generated with a predefined delay after SYNC0 pulses
• Initiated alternatively from the EtherCAT master or slave application side
Distributed Clocks
Sync0 / Sync1
Latch0 / Latch1PDI IRQ
Sync Unit
Latch Unit
DC
Control
System Time
Offset
Delay
30.05.2007 EtherCAT Communication 139
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Registers for SyncSignal Generation
Register Address Name Description
0x0140[11:10] PDI Control Enable/Disable DC Units (power saving)
0x0151 Sync/Latch PDI Configuration Configuration of SYNC/LATCH[1:0] pins
0x0980.0 Cyclic Unit Control Assignment of cyclic function to EtherCAT or PDI
0x0981 Activation Activation of cyclic function and SYNC pins
0x0982:0x0983 Pulse Length of SYNC signals Length of SYNC impulse length
0x098E SYNC0 Status Status of SYNC0 signal
0x098F SYNC1Status Status of SYNC1 signal
0x0990:0y0997 SYNC0 Start Time Start Time of cyclic operation
0x0998:0x099F NEXT SYNC1 Pulse Next Sync1 Pulse
0x09A:0x09A3 SYNC0 Cycle Time Cycle Time of SYNC0
0x09A4:0x09A7 SYNC1 Cycle Time Cycle Time of SYNC1
30.05.2007 EtherCAT Communication 140
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
SYNC0 Signal Generation modes
SYNC0
Acknowlege
SYNC0
SYNC0
Single shot
Cyclic generation
Cyclic Acknowledge mode
Activation SYNC0 Cycle Time
Acknowlege
SYNC0
Single shot Acknowledge mode
Start Time
Single Shot Acknowledge*
Single Shot
= 0
Cyclic Acknowledge*= 0
Cyclic generation> 0
> 0
SYNC0 Cycle Time (0x09A0:0x09A3)
Pulse Length
of SYNC Signals(0x0982:0x0983)
* Acknowledge by reading SYNC status register (0x098E, 0x098F)
30.05.2007 EtherCAT Communication 141
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
SYNC1 Signal Generation modes
SYNC0
SYNC1
SYNC1 Cycle Time
SYNC0 Cycle Time
SYNC0
SYNC1
SYNC1 Cycle Time
SYNC0 Cycle Time
SYNC1 Cycle Time < SYNC0 Cycle Time
SYNC1 Cycle Time = SYNC0 Cycle Time
SYNC0
SYNC1
SYNC1 Cycle Time
SYNC0 Cycle TimeSYNC1 Cycle Time = 2*SYNC0 Cycle Time
SYNC1 Cycle Time
SYNC1 Cycle Time
SYNC0
SYNC1
SYNC1 Cycle Time
SYNC0 Cycle Time
SYNC1 Cycle Time > SYNC0 Cycle Time
and
SYNC1 Cycle Time < 2*SYNC0 Cycle Time
SYNC1 Cycle Time
Start Time
30.05.2007 EtherCAT Communication 142
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Latch Functionality
• The Latch Event unit supports time stamping of the system
time with two independent input signals
– LATCH0 and LATCH1 input signals are used(can be the same pins as for SYNC0 and SYNC1, ESC dependents)
– Time Stamping of SyncManager events is possible
• Latch on positive and/or negative edge
• Single or continuous latch configurable
• The Latch Time register (0x09B0:0x09CF) contain the time
stamps
– Acknowledge by reading the Latch Time register.
30.05.2007 EtherCAT Communication 143
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Registers for Latch Input Events
Register Address Name Description
0x0140[11:10] PDI Control Enable/Disable DC Units (power saving)
0x0151 Sync/Latch PDI Configuration Configuration of SYNC/LATCH[1:0] pins
0x0980[5:4] Cyclic Unit Control Assignment of cyclic function to EtherCAT or PDI
0x09A8 Latch0 Control Latch unit configuration for Latch0
0x09A9 Latch1 Control Latch unit configuration for Latch1
0x09AE Latch0 Status Latch status of Latch0
0x09AF Latch1 Status Latch status Latch1
0x09B0:0x09B7 Latch0 Time Positive Edge Time stamp positive edge Latch0
0x09B8:0x09BF Latch0 Time Negative Edge Time stamp negative edge Latch0
0x09C0:0x09C7 Latch1 Time Positive Edge Time stamp positive edge Latch1
0x09C8:0x09CF Latch1 Time Negative Edge Time stamp negative edge Latch1
0x09F0:0x09F3 EtherCAT Buffer Change Event Time
Time stamp for ECAT SyncManager buffer change event
0x09F8:0x09FB PDI Buffer Start Event Time Time stamp for PDI SyncManager buffer start event
0x09FC:0x09FF PDI Buffer Change Event Time Time stamp for PDI SyncManager buffer change event
30.05.2007 EtherCAT Communication 144
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Local Synchronization Modes in the Slaves
• Free Run
– Slave’s application is not synchronized to EtherCAT
• Synchronous with SM Event
– Slave’s application is synchronized to the SM2 Event
(if cyclic outputs are transmitted) or the SM3 Event (if
only cyclic inputs are transmitted)
• Synchronous with SYNC Event
– Slave’s application is synchronized to the SYNC0 or
SYNC1 Event
• Normal Mode
• Optimized Mode
30.05.2007 EtherCAT Communication 145
Free Run
1C32:3 (Shift Time)(Hardware Delay)
1C33:3 (Shift Time)
Local Timer Event
0x1C32.2 / 0x1C33.2 (Cycle Time)
Local Timer Event
Outputs Valid Input Latch
1C33:6 (Min Delay Time)(Calc + Copy Inputs)
1C32:5 / 1C33:5 (Min Cycle Time)
1C32:6 (Min Delay Time)(Copy + Calc Outputs)
this value could be 0 like
described in Normal DC Mode
30.05.2007 EtherCAT Communication 146
Synchronous to SM2/3 event
1C32:3 (Shift Time)(Hardware Delay)
1C33:3 (Shift Time)
SM2/3 Event
0x1C32.2 / 0x1C33.2 (Cycle Time)
SM2/3 Event
Frame
Outputs Valid Input Latch
Frame
1C32:5 / 1C33:5 (Min Cycle Time)
1C33:6 (Min Delay Time)(Calc + Copy Inputs)1C32:6 (Min Delay Time)
(Copy + Calc Outputs)
this value could be 0 like
described in Normal DC Mode
30.05.2007 EtherCAT Communication 147
Normal DC mode
Sync0 Event Sync0 Event
1C32:3 (Shift Time)(Hardware Delay)
1C33:3 (Shift Time)
Register 0x9A0-0x9A3 (Cycle Time)
Frame
Outputs Valid Input Latch
Frame
1C32:5 / 1C33:5 (Min Cycle Time)
1C32:6 (Min Delay Time)(Copy + Calc Outputs) = 0
1C33:6 (Min Delay Time)(Calc + Copy Inputs)
30.05.2007 EtherCAT Communication 148
Optimized DC mode
Sync0 Event Sync0 Event
1C32:3 (Shift Time)(Hardware Delay)
1C33:3 (Shift Time)
SM2/3 Event
Register 0x9A0-0x9A3 (Cycle Time)
SM2/3 Event
Frame
Outputs Valid Input Latch
Frame
1C32:5 / 1C33:5 (Min Cycle Time)
1C32:6 (Min Delay Time)(Copy + Calc Outputs) != 0
1C33:6 (Min Delay Time)(Calc + Copy Inputs)
30.05.2007 EtherCAT Communication 149
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Device Description Overview
• Device Description File in XML format
• One file suitable for a set of devices (from one Vendor)
• File contains information about:
– Vendor
• Vendor ID, Name, Logo, …
– Device groups
• Organization units to help configuration tools
– Device
• Device Identity, Name, PDI type
– PDO Mapping
– FMMU / SyncManager
• number and usage
• Schema is defined in “EtherCATInfo.xsd”
• Can be viewed with Browser, Text Editor or XML Editors
30.05.2007 EtherCAT Communication 150
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
General Structure
EtherCATInfo.xsd
Vendor
Description
Groups
Devices
Type
Name
Group Type
Profile
Fmmu
Sm
Su
RxPdo
TxPdo
Mailbox
Dc
Modules
ESC
Eeprom
Vendor Spec
….
ID
Name
Comment
Image
Vendor Spec
optional
mantadory
30.05.2007 EtherCAT Communication 151
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Attributes Vendor, Groupes, Devices
• Vendor
– vendor ID, vendor name
– Bitmap image and information text
• Groups
– Device groups help configuration tool to sort the
devices.
– Configuration tool may use three levels to sort
devices: vendor, group and device.
– At least one device group must be provided, each
device is assigned to one group
EtherCATInfo.xsd
Vendor
Description
ID
Name
Comment
Image
Vendor Spec
Groups
Devices
Type
Name
Groupe Type
Profile
Fmmu
Sm
Su
RxPdo
TxPdo
Mailbox
Dc
Modules
ESC
ESC
Eeprom
Vendor Spec
….
• Devices
– Device description shall contain Type, Name and Group
Type
– FMMU, SM, PDO, Mailbox and Eeprom are
recommended
30.05.2007 EtherCAT Communication 152
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Attributes Profile
• Profile
– Profile Information
– Object Dictionary
– Same Structure for CoE and SoE Dictionaries
• Separation of Object and Data Type descriptions
– Flat list of Objects
– All Objects derived from a Data Type
– ARRAY, RECORD (CoE) and Variable Data (SoE)
defined as Data Types
– Data Type describes the complete data of an object
exactly as for a “Complete Access” download or upload
30.05.2007 EtherCAT Communication 153
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Data Types and Objects
Element „Profile“
Element „Data Type“
Element „Object“
Data Type
„STRING(20)“
Object „Device Name“
30.05.2007 EtherCAT Communication 154
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
XML and EEPROM
Config
Tool
XML
EEPROM
0110010001010… (*.bin)
Configuration Tool generates binary file from device
description to update EEPROM on slave
30.05.2007 EtherCAT Communication 155
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Configuration Tool
• Configure EtherCAT Slave devices
– Evaluate XML device description
– Evaluate EEPROM information – if online
• Generate network initialization commands
– Information for the EtherCAT driver
– Initialization commands correspond to State Machine
transitions
• Generates cyclic commands
– Information for the EtherCAT driver
30.05.2007 EtherCAT Communication 156
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Network Configuration
EtherCAT
Configuration Tool
(Offline)
EtherCAT
Master Driver
(Online)
XML
File
Device Descriptions
(XML)
Configuration
Information (XML)
General Exchange
Format
Configuration
Information (binary)
Vendor specific
Format
E2PROM
Information
30.05.2007 EtherCAT Communication 157
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Configuration Exchange Format
• Vendor and Driver independent format
• Master Vendor must not imperatively develop an own
Configuration Tool
• Contains
– initialization commands – per slave device
– cyclic process data commands
– information about the mailboxes
30.05.2007 EtherCAT Communication 158
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Master
• Configuration with help of an EtherCAT configuration XML
file
• Send and receive raw Ethernet frames from a network
adapter
• Management of the EtherCAT slaves
– Sending init commands defined in the XML file
• Mailbox Communication
– CANopen over EtherCAT protocol (CoE)
– Servo-Profile over EtherCAT protocol (SoE)
– Ethernet over EtherCAT protocol (EoE)
– Filetransfer over EtherCAT protocol (FoE)
• Software-integrated switch functionality
• Cyclic process data communication
30.05.2007 EtherCAT Communication 159
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
What does an EtherCAT Master do?
• Parse XML Hardware configuration file (initialization, state
machine, and process data mapping)
• Initialization of Fieldbus
• Runs State Machine
• Interface to application
• Interface to network driver
• Sends cyclic process data commands
• Sends mailbox commands
• Handles various protocols
30.05.2007 EtherCAT Communication 160
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Master Block Diagram
System
Configuration
Tool
EtherCAT Master Driver
Control Task
Standard Ethernet MAC
HDR Process Data
XML Parser
Process Image
(XML)
HW Config
Init Cmds
XML
Device Description
XML
Network Description
Initialization Commands
Process Image
Online functions
EtherCAT Master
30.05.2007 EtherCAT Communication 161
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Prerequisites for EtherCAT Master (Real Time)
• Hardware
• Standard network controller using DMA
– NO special plug in card needed
– Speed and Quality important
• No switches or hubs required
• Cache design, CPU
• Low jitter, x86 Dual Xeon < 2 µs
• Software
• Realtime kernel
• Configuration tool
30.05.2007 EtherCAT Communication 162
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
EtherCAT Master Development (Real Time)
1. XML Parser functionality
2. EtherCAT Master driver
– Interface to configuration tool
– State machine
– Interface to application
– Interface to network card
– NIC Timing Interface
3. Real Time Kernel
4. Hardware Configuration Tool
– 3.rd party configuration tools can be used
as the configuration is provided to
EtherCAT master in a common format
(XML)
necessary
optional
30.05.2007 EtherCAT Communication 163
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Master Sample Code Structure
NDIS
TCP/IP
Protocol Driver
NPF (based)
Protocol Driver
EtherCAT
Master Driver (Sample)
XML
FileEtherCAT
Configuration
Tool
Parser Appl.
Process Image
Ethernet Frames
Miniport
Online Functions
30.05.2007 EtherCAT Communication 164
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Master Sample Code Overview
• Sample EtherCAT Master Communication Software
(including Source Code)
– Non Real Time
– Realized as Windows Application Program
(MS Windows XP/2000)
– Source Code MS C++
30.05.2007 EtherCAT Communication 165
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Standards and References
• Specification of EtherCAT has been done in the EtherCAT
Technology Group (ETG)
• Specifications available at www.EtherCAT.org
– XML File Style sheet
– Datasheets of ESC, ...
– Modular Device Profile
– Reports of ETG TC meetings
• International standardization efforts
30.05.2007 EtherCAT Communication 166
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Standards and References
•EtherCAT is part of different international
standardization efforts
Type 12:
EtherCAT Specification
Remarks
CDVPart 6: Application Layer protocol
specification
CDVPart 5: Application Layer service definition
CDVPart 4: Data Link Layer protocol specification
CDVPart 3: Data Link Layer service definition
CDVPart 2: Physical Layer service definition and
protocol specification
CDV
PAS
StatusTitleStandard
Part 1: Overview and guidance
Digital data communication for measurement
and control – Fieldbus for use in industrial
control systems
IEC 61158
Real Time Ethernet control automation
technology (ETHERCAT)
IEC/PAS
62407
PASPAS : Public available standard: Public available standard
CDVCDV : Committee draft for vote: Committee draft for vote
30.05.2007 EtherCAT Communication 167
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Standards and References
Mapping
EtherCAT to
CANopen DS402
and SERCOS
Part 7:
Drive Profiles
CPF12: EtherCAT
Remarks
CDVPart 7-3: Generic interface and use of profiles
for power drive systems – Mapping of profiles
to network technologies
CDVPart 7-2: Generic interface and use of profiles
for power drive systems – Profile specifications
CDVPart 7-1: Generic interface and use of profiles
for power drive systems – Interface definition
Adjustable speed electrical power drive
systems
IEC 61800
CDV
Ed1.0
Part 2: Additional profiles for ISO/IEC 8802-3
based communication networks in real-time
applications
CDV
Ed2.0
Part 1: Profile sets for continuous and discrete
manufacturing relative to fieldbus use in
industrial control systems
Digital data communication for measurement
and control
IEC 61784
StatusTitleStandard
CPFCPF : : CommunicationCommunication profileprofile
30.05.2007 EtherCAT Communication 168
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Standards and References
Mapping
EtherCAT to
CANopen DS301
PRF AmdPart 4 Amd 2: Profiles for Modbus TCP,
EtherCAT and ETHERNET Powerlink
CANopenEd 1Industrial automation systems and integration -
- Open systems application integration
framework
ISO 15745
RemarksStatusTitleStandard
PRF PRF AmdAmd: : : Proof of a new International Standard, Amendment: Proof of a new International Standard, Amendment
30.05.2007 EtherCAT Communication 169
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
IEC 61158
• Digital data communication for measurement and control –
Fieldbus for use in industrial control systems
• The communication standard
• EtherCAT is named Type 12 in IEC 61158
(no brand names allowed)
• Transformation of the communication protocol to a
common model
30.05.2007 EtherCAT Communication 170
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
IEC 61158 – DL/AL services and protocols
DL Services
Part 3 in IEC 61158
• Model and Concepts
• Service description
• Register Description
(DL objects)
DL Protocol
Part 4 in IEC 61158
• Coding
• Medium Access
• State Machines
AL Services
Part 5 in IEC 61158
• Model and Concepts
• Data type definitions
• Application Objects
• Service description
• Communication Management
AL Protocol
Part 6 in IEC 61158
• Syntax definition and Coding
• Application Relationship
Procedures
• State Machines
Users Implementers
30.05.2007 EtherCAT Communication 171
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
IEC 61800-7
IEC 61800-7-1 Interface definition
Annex A:Mapping toCiA402
Annex B:Mapping to
CIP
Annex C:Mapping toPROFIdrive
IEC TR 62390Device profile guideline
IEC 61800 Parts 1 to 6Adjustable speed electrical power drive systems
Annex D:Mapping toSERCOS
Abstractmodels
GenericPDSinterface
Mapping tosolutions(profiles)
Driveprofiles
Annex D:Profile
SERCOS
Annex C:Profile
PROFIdriv
e
Annex B:ProfileCIP
Annex A:ProfileCiA402
IEC 61800-7 Generic interface and use of profiles for power drive systems
IEC 61800-7-2 Profile specifications
Mapping toCANopen
Mapping toEtherCAT
Mapping toPROFIBUS
Mapping toPROFINET
Mapping tonetworktechnologies
Mapping toDeviceNet
Mapping toEtherNet/IP
Mapping toSERCOS
I + II
Mapping toSERCOS
III
Mapping toETHERNETPowerlink
Mapping toEtherCAT
Mapping toControlNet
IEC 61800-7-3 Mapping of profiles to network technologies
Annex A Annex B Annex C Annex D
EtherCAT is Part of the drives standard in Annex A and D
SERCOS interface™ is a trade name of Interests Group SERCOS interface e.V. Compliance to this profile does not require use of the trade name SERCOS
interface. Use of the trade name SERCOS interface requires permission of the trade name holder.
30.05.2007 EtherCAT Communication 172
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
ESC Overview
• Available ESCs:
– FPGA
– IP Core
– ASIC
• Criteria:
– Features:
• Number/Type of Ports (MII, EBUS)
• PDI Type (functionality, speed)
• RAM
• DCs, Number of SyncManager, FMMUs
• …
• Needed Quantity, Flexibility in relation to price
30.05.2007 EtherCAT Communication 173
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Step by Step Implementation
• Step 1:
• Slave Evaluation Kit Workshop
µC
Step 3:
Build Lab wiring between Evaluation
Kit and Standard-Hardware (e.g.)
with 16Bit Microcontroller
Step 4:
Start SW-Project with Slave Sample
Code
Step 2:
Setup of a small EtherCAT System
with Master, I/O and Evaluation
Board.
30.05.2007 EtherCAT Communication 174
EtherCAT Basics
Slave Structure
Physical Layer
Device Model (ISO/OSI)
Data Link Layer
Frame Structure
Addressing
Commands
Memory/Registers
SyncManager
FMMU
Diagnosis
Application Layer
State Machine
Mailbox
Mailbox Interface
EoE Ethernet
CoE CANopen
FoE File Access
SoE Servo Drive
Slave Information /IF
Device Profiles
Modular Devices
Drives
Distributed Clocks
Device Description
Configuration Tool
EtherCAT Master
Standards&Implementation
© Copyright by Beckhoff, 2007
Step by Step Implementation
• Step 5:
• Download Slave Sample Code in
Target Hardware and set System
into Operation
Step 6:
Test implementation for PDO- und
Mailbox-Transfer
EtherCAT Hardware-Design
Step 7:
Software-Design with EtherCAT
Slave Sample Code for existing
Fieldbus SW-Architecture
ecatappl
mcihw
ecatslv mailbox
emcy
ecatcoe
coeappl
ecatfoe
foeappl
EtherCAT Slave
Application Software
EtherCAT
Slave
Controller
Slave Sample Code