EtherCAT Technology Group

EtherCAT Communication

Communication Principles

30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 1 Agenda

EtherCAT Basics Slave Structure • EtherCAT Basics • Slave Structure Device Model (ISO/OSI) • Physical Layer Frame Structure • Device Model Addressing Commands • Data Link Layer Memory/Registers – Frame Structure SyncManager FMMU – Addressing, Commands Diagnosis – Memory, SyncManager, FMMUs State Machine – Diagnosis Mailbox • Application Layer Mailbox Interface EoE – State Machine CoE CANopen – Mailbox (Mailbox Protocols) FoE File Access SoE Servo Drive – Slave Information Interface (EEPROM) Slave Information /IF • Device Profiles Device Profiles Modular Devices • Distributed Clocks Drives • Device Description Distributed Clocks Device Description • Tools (Configuration Tool, Monitor, …) Configuration Tool • EtherCAT Master EtherCAT Master Standards&Implementation • Standard & References 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 2 Topology

EtherCAT Basics • Flexible Topology Slave Structure Physical Layer • Any number of physical layer changes possible Device Model (ISO/OSI) • Standard Ethernet 100m cable distance between 2 devices Data Link Layer Frame Structure • Up to 65.535 devices possible Addressing Commands Memory/Registers EtherCAT Segment (Slaves) SyncManager FMMU Diagnosis Application Layer State Machine Mailbox Mailbox Interface Master 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 3 Functional Principle: Ethernet „on the Fly“

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) Data Link Layer Frame Structure Addressing Commands Memory/Registers SyncManager FMMU Diagnosis Car Application Layer 27 State Machine Mailbox Mailbox Interface Analogy Fast Train: EoE Ethernet CoE CANopen • „Train“ () does not stop FoE File Access SoE Servo Drive • Even when watching „train“ through narrow window one Slave Information /IF Device Profiles sees the entire train Modular Devices Drives • „Car“ (Sub-Telegram) has variable length Distributed Clocks Device Description • One can „extract“ or „insert“ single „persons“ (Bits) or Configuration Tool EtherCAT Master entire „groups“ – even multiple groups per train Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 4 Functional Principle: Ethernet „on the Fly“

EtherCAT Basics Slave Structure Physical Layer Slave Device Slave Device Device Model (ISO/OSI) Data Link Layer Frame Structure Addressing EtherCAT Slave EtherCAT Slave Commands Controller Controller Memory/Registers SyncManager FMMU Diagnosis Application Layer State Machine • Process data is extracted and inserted on the fly Mailbox Mailbox Interface • Process data size per slave almost unlimited EoE Ethernet CoE CANopen (1 Bit…60 Kbyte, if needed using several frames) FoE File Access SoE Servo Drive • Compilation of process data can change in each cycle, Slave Information /IF e.g. ultra short cycle time for axis, and longer cycles for I/O Device Profiles Modular Devices update possible Drives Distributed Clocks • In addition asynchronous, event triggered communication Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 5 Frame Processing within one node

EtherCAT Basics Slave Structure Master EtherCAT Segment (Slaves) Physical Layer Device Model (ISO/OSI) Data Link Layer IPC Frame Structure Addressing Commands Memory/Registers .. SyncManager .. DVI FMMU Diagnosis Application Layer State Machine Mailbox vom Master Mailbox Interface EoE Ethernet zum Master 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 6 Logical Process Data Image

EtherCAT Basics Slave Structure

Physical Layer IPC Device Model (ISO/OSI) Data Link Layer Frame Structure

DVI .. Addressing .. 32 Commands 2 Telegrammstruktur Memory/Registers Ethernet HDR HDR 1 PLC Data HDR 2 NC Data HDR n Data n CRC SyncManager FMMU Diagnosis Application Layer Data n State Machine Mailbox PLC Data Mailbox Interface NC Data EoE Ethernet Sub- Sub- Sub- CoE CANopen Telegramm 1 Telegramm 2 Telegramm n FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives logisches bis Prozessabbild: GByte 4 0 Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 7 EtherCAT Slave Structure

EtherCAT Basics EtherCAT Master Slave Structure Physical Layer Device Model (ISO/OSI) EDS Electronic Data Link Layer XML Data Sheet

Frame Structure .... DVI Addressing Commands Slave Application Layer Memory/Registers (Mailbox Protocols) SyncManager EtherCAT Host FMMU CPU Diagnosis Slave ESC Application Layer Controller Configuration State Machine Mailbox EEPROM Data Mailbox Interface ESC EoE Ethernet CoE CANopen FoE File Access Trafo

SoE Servo Drive RJ45 Slave Information /IF PHY PHY Device Profiles RJ45 Trafo Modular Devices Drives Distributed Clocks Device Description Standard Ethernet Configuration Tool Slave-Hardware EtherCAT Master Physical Layer Components Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 8 EtherCAT Slave Evaluation Kit (by Beckhoff)

EtherCAT Basics Slave Structure EtherCAT Programmer for PIC Program & Physical Layer Slave Controller Board FPGA Debug Interface Power Device Model (ISO/OSI) Supply Data Link Layer Frame Structure Addressing Commands Memory/Registers SyncManager FMMU Diagnosis Application Layer PDI State Machine Selector Mailbox Basic Mailbox Interface Board EoE Ethernet EL9800 CoE CANopen FoE File Access SPI SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description 32 bit 8/16bit µC PIC over SPI Configuration Tool parallel EtherCAT Master interface Standards&Implementation interface 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 9 EtherCAT Slave Controller Board

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) Data Link Layer Frame Structure Status LED Addressing RJ45 Commands Memory/Registers SyncManager FMMU Diagnosis EtherCAT Application Layer Slave State Machine Trafo Mailbox Controller Mailbox Interface (FPGA) EoE Ethernet CoE CANopen FoE File Access SoE Servo Drive Slave Information /IF PHY EEPROM Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation * Post stamp design, not cost and space optimized 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 10 EtherCAT Physical Layers

EtherCAT Basics Slave Structure • On cables: 100BaseTX or 100BaseFx Physical Layer Device Model (ISO/OSI) • Device internal: E-Bus (LVDS) Data Link Layer Frame Structure Addressing Ethernet on LVDS physics E-Bus Commands (E-Bus): Memory/Registers for modular devices SyncManager FMMU Diagnosis IPC Application Layer State Machine Mailbox Mailbox Interface EoE Ethernet .. DVI CoE CANopen FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Ethernet on Distributed Clocks 100BASE-TX; any number of Device Description up to 100 m, with physical layer Configuration Tool EtherCAT Master transformer coupling changes allowed Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 11 Physical Layer

EtherCAT Basics Slave Structure • 100 BASE-TX Physical Layer – Most popular physical layer for Device Model (ISO/OSI) Data Link Layer – Shielded twisted pair (STP) with 2 pairs of wires Frame Structure – Cable categories CAT5, 6, 7 can be used Addressing Commands – RJ45 connector standard, M12 connector for IP67 Memory/Registers – PHY Support for auto negotiation and auto crossover SyncManager FMMU recommended Diagnosis • 100 BASE-FX Application Layer State Machine – All media options possible Mailbox – Simple solution for TX-to-FX converter Mailbox Interface EoE Ethernet CoE CANopen • E-BUS FoE File Access SoE Servo Drive – Interface for low cost backplane applications Slave Information /IF – Widely used LVDS (Low Voltage Differential Signaling) Device Profiles adopted Modular Devices Drives – Use Manchester Bit Coding Distributed Clocks – LVDS: Low Voltage Differential Signaling according to Device Description Configuration Tool ANSI/TIA/EIA-644, also used in IEEE 802.3ae (10Gigabit EtherCAT Master Ethernet) Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 12 Port Management

EtherCAT Basics Slave Structure Physical Layer • A Slave Controller can have up to 4 EtherCAT Ports Device Model (ISO/OSI) Data Link Layer Frame Structure Addressing • If a Port is closed the controller forward it to the next port Commands Ports can be opened/closed automatically with link up or Memory/Registers SyncManager opened closed by EtherCAT command FMMU Diagnosis Application Layer State Machine • The EtherCAT frame processing and forwarding order Mailbox Mailbox Interface depends on logical ports configured: EoE Ethernet CoE CANopen FoE File Access 2 ports 0EtherCAT Processing Unit 1 / 1 0 SoE Servo Drive Slave Information /IF Device Profiles 3 ports 0ECAT Proc. Unit 1 / 1 2 / 2 0 (log. ports 0,1, and 2) Modular Devices or Drives Distributed Clocks 0ECAT Proc.Unit 3 / 3 1 / 1 0 (log. ports 0,1, and 3) Device Description Configuration Tool 4 ports 0EtherCAT Processing Unit 3 / 3 1 / 1 2 / 2 0 EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 13 Frame Processing Auto Forwarder and Loop Back

EtherCAT Basics Slave Structure Port 3 Physical Layer Device Model (ISO/OSI) Auto- Data Link Layer Forwarder Frame Structure Addressing port 3 open Commands Memory/Registers EtherCAT Processing Unit SyncManager port 3 closed

FMMU Loopback function Diagnosis Application Layer State Machine Mailbox Port 0 ET1100 Port 1 Mailbox Interface 1 EoE Ethernet CoE CANopen FoE File Access Loopback function SoE Servo Drive port 2 closed Slave Information /IF Device Profiles

Modular Devices port 2 open Drives Distributed Clocks Auto- Device Description Forwarder Configuration Tool Port 2 EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 14 ISO/OSI Layer Model

EtherCAT Basics Slave Structure OSI Physical Layer Layers Device Model (ISO/OSI) Data Link Layer Frame Structure 7 Application Layer (AL) Addressing Commands 6 Memory/Registers SyncManager 5 FMMU empty* Diagnosis 4 Application Layer State Machine 3 Mailbox Mailbox Interface 2 Data Link Layer (DLL) EoE Ethernet CoE CANopen 1 Physical Layer (PhL) FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master • * „empty“ means that the layer behavior exists, but is not shown explicitly Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 15 Device Model – ISO/OSI Reference

EtherCAT Basics Slave Structure Physical Layer Servo Device Model (ISO/OSI) Application Appli- HTTP, Application According cation FTP, … e.g. DS402 Drive Profile Data Link Layer IEC 61491 Frame Structure Addressing Commands TCP UDP Memory/Registers Application Object Dictionary SyncManager Layer SoE IP File Service FMMU (AL) Access Ethernet SDO PDO Mapping Diagnosis Channel Application Layer State Machine Slave Information Slave Mailbox AL Control/ Sync Man Mailbox Process Data AL Status Settings Mailbox Interface Data EoE Ethernet FMMU Link FMMUFMMU CoE CANopen FMMU n Layer DL DL Layer FoE File Access (DL) Info Address Management SoE Servo Drive DL Control/ DL Status Slave Information /IF EtherCAT Data Link Layer Device Profiles Modular Devices Physical Drives Layer (PHY) Physical Layer Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 16 Application Appli- HTTP, Application …. cation FTP, .. e.g. CiA402 Drive Profile

Object Dictionary Application TCP, UDP RD / WR File PDO Mapping Layer ... Access IP SDO PDO (AL)

VoE FoE EoE CoE CoE Mailbox DLL Process Data Interface (µC, SSI, I/O ) SII EEPROM Registers Mailbox Process Data

0x0000 0x1000 ESC Address Space (DPRAM)

SyncMan0 MbxOut SyncMan1 MbxIn SyncMan2 SyncMan3 Data FMMU n FMMU n FMMUFMMU Link EtherCAT Slave Controller (ESC) FMMU Layer EtherCAT Processing Unit (DL) and Auto-Forwarder with Loop Back

PHY MII / EBUS MII / EBUS MII / EBUS MII / EBUS Management Port 0 Port 3 Port 2 Port 1 Trafo RJ45 Physical PHY PHY LVDS Con

RJ45 Layer Trafo (PL)

FCS More Datagrams.. Mailbox Data FPWR Process Data LRW ECAT HDR Ethernet HDR HDR HDR © Copyright by Beckhoff, 2007 30.05.2007 EtherCATWKC Communication WKC 17 Purpose of Data Link Layer

EtherCAT Basics Slave Structure • Data Link Layer links Physical and Application Layer Physical Layer Device Model (ISO/OSI) • Data Link Layer takes care of the underlying communication Data Link Layer infrastructure Frame Structure Addressing – Link Control Commands Memory/Registers – Access to Transceivers (PHY) SyncManager FMMU – Addressing Diagnosis Application Layer – Slave Controller configuration State Machine Mailbox – EEPROM access Mailbox Interface – SyncManager configuration and management EoE Ethernet CoE CANopen – FMMU configuration and management FoE File Access SoE Servo Drive – Process Data Interface configuration Slave Information /IF Device Profiles – Distributed Clock Modular Devices Drives – Set Up AL State Machine interactions Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 18 Data Link Layer – Overview

EtherCAT Basics Slave Structure • Standard IEEE 802.3 Ethernet Frame Physical Layer Device Model (ISO/OSI) – No special requirements for the master Data Link Layer – Use of standard Ethernet infrastructure Frame Structure Addressing • IEEE Registered EtherType: 88A4h Commands Memory/Registers – Optimized frame overhead SyncManager – IP stack not required FMMU Diagnosis – Simple master implementation Application Layer State Machine • Additionally over UDP Mailbox (IANA registered Port 88A4h) Mailbox Interface EoE Ethernet – EtherCAT communication over the Internet possible CoE CANopen – Using of standard sockets FoE File Access SoE Servo Drive • Frame processing at Slave side Slave Information /IF Device Profiles – EtherCAT Slave Controller processes the frame in Modular Devices hardware Drives Distributed Clocks • Communication Performance independent from processor power Device Description – no time critical reaction at slave side in software Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 19 Ethernet / EtherCAT Frame Structure

EtherCAT Basics Ethernet Frame: max. 1514 Slave Structure Physical Layer Device Model (ISO/OSI) Ethernet Header Ethernet Data FCS Data Link Layer Frame Structure Addressing 48 Bit 48 Bit 16 Bit 32 Bit Commands Destination Source EtherType EtherCAT Data FCS Memory/Registers SyncManager EtherType 88A4h FMMU 16 Bit 48 -1498 Byte Diagnosis Application Layer 1 Destination Source EtherType Header Datagrams FCS State Machine Mailbox Mailbox Interface 64 Bit 16 Bit EoE Ethernet 160 Bit 48 -1470 Byte CoE CANopen 2 Dest Src Type IP Header UDP H. Header Datagrams FCS FoE File Access EtherType 0800h UDP Destination Port 88A4h SoE Servo Drive Slave Information /IF 11 Bit 1 Bit 4 Bit Device Profiles Length Res. Type Modular Devices 1 Simple EtherCAT Communication Drives Distributed Clocks 2 EtherCAT communication over Internet Type of following data Device Description Reserved Configuration Tool Length of following EtherCAT datagrams EtherCAT Master (not checked by slave) Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 20 EtherCAT Frame Header

EtherCAT Basics Slave Structure Physical Layer 11 Bit 1 Bit 4 Bit Device Model (ISO/OSI) Data Link Layer 0 Length 11Res. 12Type 15 Frame Structure Addressing Commands Memory/Registers SyncManager Type Meaning FMMU ------Diagnosis Application Layer 0: Reserved State Machine 1: EtherCAT Datagram (s) Mailbox Mailbox Interface the only type that is evaluated by the ESC EoE Ethernet 2,3: Reserved CoE CANopen FoE File Access 4: Network Variables SoE Servo Drive 5: Mailbox over IP Slave Information /IF Device Profiles 6-15: Reserved for future use Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 21 EtherCAT Datagrams

EtherCAT Basics * add 1-32 padding if Ethernet frame is less than 64 Slave Structure Physical Layer Device Model (ISO/OSI) Ethernet H. Ethernet Data FCS Data Link Layer Frame Structure Addressing 14 Byte 2 Byte 44*-1498 Byte 4 Byte Commands Ethernet H. Len 0 1 EtherCAT Datagrams FCS Memory/Registers SyncManager FMMU Diagnosis Application Layer 1st EtherCAT Datagram 2nd …. …. nth EtherCAT Datagram State Machine Mailbox Mailbox Interface EoE Ethernet 10 Byte max. 1486 Byte 2 Byte CoE CANopen FoE File Access Datag. Header Data WKC SoE Servo Drive WKC = Working Counter Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 22 Working Counter Details

EtherCAT Basics Slave Structure • EtherCAT Datagram ends with a 16 Bit Working Counter Physical Layer Device Model (ISO/OSI) • Working Counter counts the number of interactions of Data Link Layer Frame Structure devices addressed by an EtherCAT Datagram Addressing Commands • EtherCAT Slave Controller increments the Working Memory/Registers SyncManager Counter in hardware – if the controller is addressed and FMMU the addressed memory is accessible (Sync Manager) Diagnosis Application Layer • Each Datagram should have an expected Working counter State Machine Mailbox value – calculated by the configuration tool Mailbox Interface EoE Ethernet • The Master checks the valid processing of EtherCAT CoE CANopen FoE File Access Datagrams by comparing the Working Counter with the SoE Servo Drive expected value Slave Information /IF Device Profiles • Special case: RW addressing methods will increment Modular Devices Drives WKC by 2 for write access and by 1 for read access Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 23 Working Counter Example

EtherCAT Basics Slave Structure • WKC valid: data of this datagram was written to and Physical Layer Device Model (ISO/OSI) read from all addressed devices Data Link Layer Frame Structure • WKC invalid: memory of one or more devices was not Addressing Commands accessible Memory/Registers SyncManager FMMU Diagnosis Application Layer WC=0 WC=1 WC=2 WC=5 State Machine node 1 node 2 node 3 Mailbox PC DI = read DO=write DI/DO= Mailbox Interface 1xread+ read+write EoE Ethernet 1xwrite+ WC+1=1 WC+1=2 WC+3=5 CoE CANopen 1+read/ write WC=5 WC=5 WC=5 FoE File Access = 5 SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 24 Working Counter Example

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) Data Link Layer Frame Structure Addressing Commands WC+1 Memory/Registers SyncManager FMMU Diagnosis WC+1 Application Layer State Machine Mailbox Mailbox Interface EoE Ethernet WC+3 CoE CANopen FoE File Access SoE Servo Drive Slave Information /IF Device Profiles WC+1 Modular Devices Drives Distributed Clocks WC+1 Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 25 EtherCAT Addressing

EtherCAT Basics * add 1-32 padding bytes if Ethernet frame is less than 64 Slave Structure Physical Layer Device Model (ISO/OSI) Ethernet H. Ethernet Data FCS Data Link Layer Frame Structure Addressing 14 Byte 2 Byte 44*-1498 Byte 4 Byte Commands Ethernet H. Len 0 1 EtherCAT Datagrams FCS Memory/Registers SyncManager FMMU Diagnosis Application Layer 1st EtherCAT Datagram 2nd …. …. nth EtherCAT Datagram State Machine Mailbox Mailbox Interface EoE Ethernet 10 Byte max. 1486 Byte 2 Byte CoE CANopen FoE File Access Datag. Header Data WKC SoE Servo Drive WKC = Working Counter Slave Information /IF Device Profiles Modular Devices 8 Bit 8 Bit 32 Bit11 Bit 4 1 16 Bit Drives Cmd Idx Address Len R M IRQ Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 26 EtherCAT Addressing Overview

EtherCAT Basics Slave Structure Physical Layer Ethernet Frame Header Address Device Model (ISO/OSI) Data Link Layer Frame Structure Addressing MAC Commands Segment Addressing Memory/Registers Address SyncManager FMMU Diagnosis Application Layer Device Addressing Logical Addressing State Machine Mailbox Mailbox Interface EoE Ethernet CoE CANopen Position Addressing Node Addressing FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Address by Assigned Node Process Data Drives physical Position Address Address Distributed Clocks Device Description EtherCAT Datagram Header Address Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 27 Segment Addressing by MAC Address

EtherCAT Basics Slave Structure • Direct mode (no switch): broadcast MAC Address Physical Layer EtherCAT Segment = Ethernet Device Device Model (ISO/OSI) Data Link Layer Frame Structure Master Slave Slave Slave Slave Slave Slave Addressing Device Device Device Device Device Device Device Commands Memory/Registers SyncManager FMMU Diagnosis • Open mode: One MAC-Address for an EtherCAT Segment Application Layer State Machine Mailbox EtherCAT Segment = Ethernet Device Mailbox Interface Segment EoE Ethernet Master Address Slave Slave Slave Slave Slave CoE CANopen Device Switch Slave Device Device Device Device Device Device FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Generic Modular Devices Ethernet Device EtherCAT Segment = Ethernet Device Drives Distributed Clocks Segment Address Device Description Slave Slave Slave Slave Slave Slave Device Device Device Device Device Configuration Tool Master Device EtherCAT Master Device Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 28 EtherCAT Datagram Header Address

EtherCAT Basics * add 1-32 padding bytes if Ethernet frame is less than 64 Slave Structure Physical Layer Device Model (ISO/OSI) Ethernet H. Ethernet Data FCS Data Link Layer Frame Structure Addressing 14 Byte 2 Byte 44*-1498 Byte 4 Byte Commands Ethernet H. Len 0 1 EtherCAT Datagrams FCS Memory/Registers SyncManager FMMU Diagnosis Application Layer 1st EtherCAT Datagram 2nd …. …. nth EtherCAT Datagram State Machine Mailbox Mailbox Interface EoE Ethernet 10 Byte max. 1486 Byte 2 Byte CoE CANopen FoE File Access Datag. Header Data WKC SoE Servo Drive WKC = Working Counter Slave Information /IF Device Profiles Modular Devices 8 Bit 8 Bit 32 Bit11 Bit 2 1 1 1 16 Bit Drives Cmd Idx Address Len R C R M IRQ Distributed Clocks Device Description Configuration Tool Circulating Datagram? More EtherCAT Datagrams? EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 29 Address Field

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) 8 Bit 8 Bit 32 Bit 11 Bit 2 1 1 1 16 Bit Data Link Layer Cmd Idx Address Len R C R M IRQ Frame Structure Addressing 16 Bit 16 Bit Commands Memory/Registers Position Offset Auto Increment Addressing (local) SyncManager FMMU Address Offset Fixed Addressing (local) Diagnosis Application Layer State Machine Logical Address Logical Addressing (global) Mailbox Mailbox Interface EoE Ethernet • 32 Bit address space CoE CANopen FoE File Access SoE Servo Drive - used for 16 bit device addressing (65.535 devices Slave Information /IF possible) Device Profiles Modular Devices and 16 bit for addressing local memory space of device Drives (max. 64kByte) Distributed Clocks Device Description or Configuration Tool EtherCAT Master Standards&Implementation - 32 bit logical addressing 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 30 16 Bit 16 Bit Auto Increment Addressing Position Offset

EtherCAT Basics • Negative Auto Increment Address for every slave Slave Structure Physical Layer depending on position (16 bit) Device Model (ISO/OSI) Data Link Layer • Slave which reads address == 0x0000 is addressed Frame Structure Addressing Commands • Every slave increments address by 1 Memory/Registers SyncManager • Offset addresses local memory space of device FMMU Diagnosis Application Layer • Usually used during scan of hardware configuration State Machine B C F E Mailbox D Mailbox Interface EoE Ethernet 0x0000 0xFFF 0xFFF 0xFFF CoE CANopen 0xFFF 0xFFF A 8 FoE File Access IPC 9 SoE Servo Drive Slave Information /IF Device Profiles 0xFFF 0xFFF 0xFFF Modular Devices .. Drives .. DVI 1 2 3 4 Distributed Clocks Device Description 5 6 Configuration Tool EtherCAT Master Standards&Implementation 7 8 9 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 31 16 Bit 16 Bit Fixed Addressing Address Offset

EtherCAT Basics Slave Structure • Every Slave has a fixed address (16 bit) Physical Layer Device Model (ISO/OSI) Data Link Layer • Usually assigned during hardware configuration scan Frame Structure Addressing • Independent from slave position Commands Memory/Registers SyncManager • Fixed address lost after power loss FMMU Diagnosis Application Layer State Machine A D E Mailbox 9 B C Mailbox Interface 0x3E 0x3E 0x3E EoE Ethernet 0x3E 0x3E 0x3E CoE CANopen IPC

FoE File Access F SoE Servo Drive F0 F1 Slave Information /IF 0x3E 0x3 0x3 Device Profiles Modular Devices .. DVI 1 2 3 4 Drives Distributed Clocks 5 6 Device Description Configuration Tool EtherCAT Master 7 8 9 Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 32 32 Bit Logical Addressing Position

EtherCAT Basics Slave Structure • Slave reads from/ writes its data into the 4 GByte great Physical Layer Device Model (ISO/OSI) Ethernet frame (fragmented) Data Link Layer Frame Structure Addressing Commands IPC Memory/Registers SyncManager FMMU DVI .. .. Diagnosis 232 Telegrammstruktur Application Layer State Machine Ethernet HDR HDR 1 PLC Data HDR 2 NC Data HDR n Data n CRC Mailbox Mailbox Interface EoE Ethernet Data n CoE CANopen FoE File Access PLC Data SoE Servo Drive NC Data Slave Information /IF Device Profiles Sub- Sub- Sub- Modular Devices Telegramm 1 Telegramm 2 Telegramm n Drives Distributed Clocks Device Description Configuration Tool

EtherCAT Master GByte 4 to up image process Logical Standards&Implementation 0 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 33 EtherCAT Commands

EtherCAT Basics Slave Structure • Different commands to optimize reading and writing for all Physical Layer Device Model (ISO/OSI) access methods within a communication system Data Link Layer Frame Structure Addressing Commands Cmd Idx Address Offset Len R C R M IRQ Memory/Registers SyncManager FMMU Diagnosis Application Layer Cmd Type Access Address Offset Comment State Machine Mailbox NOP No Operation Mailbox Interface EoE Ethernet Auto R, W, RW, Position Local Memory Position value 0 CoE CANopen Increment RMW (increments) Address (at entry) addressed FoE File Access SoE Servo Drive configured R, W, RW, Address Local Memory Match address value to Slave Information /IF Address RMW (configured) Address local address register Device Profiles Modular Devices Broadcast R, W, RW (increments) Local Memory Drives Address Distributed Clocks Device Description Logical R, W, RW 32 Bit logical address Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 34 EtherCAT Commands

EtherCAT Basics Slave Structure • Broadcast Read Physical Layer Device Model (ISO/OSI) – Individual Bits of a Byte will be added with a bitwise Data Link Layer Frame Structure OR operation between incoming data and local data Addressing Commands Memory/Registers SyncManager • Read Write Actions FMMU Diagnosis – Exchange of incoming data and local data Application Layer State Machine (exception: Broadcast – see broadcast read) Mailbox Mailbox Interface EoE Ethernet CoE CANopen • Read Multiple Write Actions (RMW) FoE File Access SoE Servo Drive – Addressed Station will read the others will write Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 35 Local Address Space of ESC

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) 0x0000 Data Link Layer Registers Frame Structure Addressing 0x0110 DL Control Commands 0x0110 DL Status 4 kByte Memory/Registers 0x0120 AL Control SyncManager 0x0130 AL Status FMMU 0x0FFF …… Diagnosis Application Layer 0x1000 State Machine User memory Mailbox Mailbox Interface process data in EoE Ethernet CoE CANopen process data out FoE File Access 1..60 kByte SoE Servo Drive mailbox data out Slave Information /IF Device Profiles mailbox data in Modular Devices Drives Distributed Clocks Device Description 0xFFFF ESC Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 36 Local Address Space of ESC

EtherCAT Basics Slave Structure • 64 kByte address space Physical Layer Device Model (ISO/OSI) • Divided into registers and dual ported RAM (DPRAM) Data Link Layer Frame Structure • First 4 kByte are reserved for registers Addressing Commands • DPRAM starts at 1000h Memory/Registers SyncManager • DPRAM size depends on Slave Controller implementation FMMU Diagnosis (up to 60 kByte, 4kByte in actual FPGA implementation) Application Layer State Machine • Addressing of registers and DPRAM same Mailbox Mailbox Interface • Register Write is different – EoE Ethernet CoE CANopen shadow Register for all Registers integrated FoE File Access DPRAM write is not shadowed SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 37 Register of EtherCAT Slave Controller

EtherCAT Basics Slave Structure • First 1000h bytes (4 kbytes) of local address space Physical Layer Device Model (ISO/OSI) • Read access for both sides (EtherCAT and application) Data Link Layer • Write access from EtherCAT for most of the registers Frame Structure Addressing – Master has to configure the Slave Controller Commands Memory/Registers • No address settings needed SyncManager • FMMU and Sync Manager configuration can be FMMU Diagnosis optimized for available bandwidth and cycle times Application Layer – Exceptions that are writable from the application side: State Machine Mailbox • AL Status Register, AL Status Code Register, Mailbox Interface AL Event Mask Register, Sync Manager Disable EoE Ethernet CoE CANopen Registers, AL Identification Registers FoE File Access • Process Data Interface (PDI) register initialized from Slave SoE Servo Drive Slave Information /IF Information interface (Serial EEPROM) Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 38 Register

EtherCAT Basics Slave Structure • Registers might be monitored via configuration tool 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 39 Register – ESC Data Sheet

EtherCAT Basics Slave Structure • Register description for every ESC (FPGA/ ASIC) Physical Layer Device Model (ISO/OSI) – DL Information, DL Control, DL Status, DL Address Data Link Layer Frame Structure – AL Control, AL Status, AL Event Addressing Commands – SyncManager + FMMU configuration Memory/Registers – Distributed Clocks SyncManager FMMU – Slave Information interface (Serial EEPROM ) Diagnosis Application Layer State Machine Mailbox Mailbox Interface EoE Ethernet CoE CANopen FoE File Access SoE Servo Drive Slave Information /IF Enable Disable Ports Device Profiles Modular Devices Control of the device state machine Drives Distributed Clocks Status of the device state machine Device Description Configuration Tool Error Code EtherCAT Master Standards&Implementation 32 Bit I/0, SPI, µC Interface 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 40 SyncManager Overview

EtherCAT Basics Slave Structure • SyncManager protects a DPRAM section from simultaneous Physical Layer access data consistency Device Model (ISO/OSI) Data Link Layer • Mailbox Type Frame Structure Addressing – 1 buffer SyncManager supports handshake Commands – Data overflow protection Memory/Registers SyncManager – Writing side must write before reading side can read FMMU Diagnosis – Reading side must read before writing side can write again Application Layer • Buffered Type State Machine Mailbox – 3 buffer SyncManager guarantees consistent data delivery Mailbox Interface and access to the newest data any time EoE Ethernet CoE CANopen – Always a free buffer to write FoE File Access SoE Servo Drive – Always a consistent buffer to read (except before the first Slave Information /IF writing) Device Profiles Modular Devices – Usually used for process data communication Drives • Up to 16 independent SyncManger channels possible Distributed Clocks Device Description • The SyncManager configuration registers start at address Configuration Tool 0x0800 EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 41 Buffered Type (3 buffers) Write Example

EtherCAT Basics • Characteristic: Data always available for both sides Slave Structure • Requires 3 (consecutive) memory areas Physical Layer Device Model (ISO/OSI) Data Link Layer EtherCAT ECAT NEXT USER PDI Frame Structure a Write begin WRITE WRITE WRITE Addressing WRITE WRITE WRITE Commands WRITE WRITE WRITE Read latest READ READ READ Memory/Registers WRITE WRITE WRITE Write end WRITE WRITE WRITE READ READ READ available data SyncManager 1 2READ READ 3 READ FMMU READ READ READ READ READ READ Diagnosis Application Layer State Machine b WRITE WRITE WRITE Mailbox WRITE WRITE WRITE Mailbox Interface WRITE WRITE WRITE WRITE WRITE WRITE EoE Ethernet WRITE WRITE WRITE CoE CANopen 2 1 READ3 READ ….Go on Reading READ READ READ FoE File Access READ READ READ Read end SoE Servo Drive Slave Information /IF Device Profiles c Write begin Read latest ECATECATECATECA Modular Devices WRITE WRITE WRITE available data TECATECATECATEC WRITE WRITE WRITE Drives ATECATECATECATE WRITE WRITE WRITE Distributed Clocks CATECATECAT WRITE WRITE WRITE Device Description 2 3 WRITE WRITE1 WRITE Configuration Tool EtherCAT Master Standards&Implementation Cycle begins again a 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 42 Mailbox Type (1 buffer) Read Example

EtherCAT Basics Slave Structure • Allows handshake Communication Physical Layer Device Model (ISO/OSI) • Useful for non-Process Data Data Link Layer Frame Structure • Handshake mechanism – one side has control Addressing Commands Memory/Registers Master EtherCAT Slave SyncManager FMMU Diagnosis Read Application Layer MBX Empty State Machine Failed  Read Mailbox Mailbox Interface WKC = 0 EoE Ethernet CoE CANopen  Write FoE File Access SoE Servo Drive Slave Information /IF MBX Full Write Successfull Device Profiles Modular Devices Drives Distributed Clocks Read Device Description MBX Empty Configuration Tool Successfull  Read EtherCAT Master WKC = 1 Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 43 SyncManager channel configuration registers

EtherCAT Basics Slave Structure 16 Bit 16 Bit 8 Bit 8 Bit 16 Bit Physical Layer Device Model (ISO/OSI) Res Res 0 Start Address 16 Length 32Ctrl 40 Status E 49R 49 E 49R 49 Data Link Layer 48 49 50 56 57 63 Frame Structure Request Response Addressing Master Slave Commands Memory/Registers 1/3 Buffer R/W I I WD R SyncManager 0 2 4E 5P 6 7 FMMU Diagnosis I I WD 1P 3P Res. Application Layer 0W 1R 2 3 4 6 State Machine Mailbox Mailbox Interface Watchdog Channel 00: Read Repeat Reserved EoE Ethernet Enable Enable 0 1 CoE CANopen 01: Write FoE File Access 0: read SoE Servo Drive 00: 3 Buffer Interrupt 1: written Slave Information /IF 10: 1 Buffer Enable Device Profiles to PDI Completely Modular Devices 00: Buffer 0 Drives read Distributed Clocks 01: Buffer 1 Device Description Completely 10: Buffer 2 Configuration Tool 11: locked (Start) EtherCAT Master written Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 44 SyncManager assignment

EtherCAT Basics Slave Structure • Standard assignment Physical Layer – With mailbox support Device Model (ISO/OSI) Data Link Layer • SM0: Mailbox output Frame Structure • SM1: Mailbox input Addressing Commands • SM2: Process data outputs Memory/Registers • SM3: Process data inputs SyncManager FMMU • Readable via CoE object 1C00h Diagnosis – Without mailbox support Application Layer State Machine • SM0: Process data outputs Mailbox (or inputs if no outputs available) Mailbox Interface EoE Ethernet • SM1: Process data inputs CoE CANopen • Extended assignment FoE File Access SoE Servo Drive – SM0: Mailbox output Slave Information /IF – SM1: Mailbox input Device Profiles Modular Devices – Rest is configurable via CoE object 1C00h Drives Distributed Clocks Device Description • One or more PDO always fit exactly in a SyncManager Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 45 Fieldbus Memory Management Unit (FMMU)

EtherCAT Basics Slave Structure • Maps a section of the local address space into the global Physical Layer Device Model (ISO/OSI) address space and vice versa Data Link Layer Frame Structure • Read and write access distinguishable Addressing Commands • Bitwise configuration of the memory section possible Memory/Registers SyncManager • Up to 16 independent FMMU channels possible FMMU Diagnosis – FMMU configuration registers start at address Application Layer State Machine 0x0600 Mailbox Mailbox Interface EoE Ethernet CoE CANopen • Operation samples: FoE File Access SoE Servo Drive • Mapping of process data into the global address space Slave Information /IF Device Profiles • Mapping of status bits from the register section Modular Devices Drives – Access to device specific status information with a Distributed Clocks minimum overhead – e.g. fill status of a sync Device Description Configuration Tool manager channel EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 46 FMMU Usage for Addressing

EtherCAT Basics Slave Structure • Global address space Physical Layer Device Model (ISO/OSI) • 4 GByte address space Data Link Layer Frame Structure • Mapping to local addresses by Addressing Commands Fieldbus Memory Management Units (FMMU) Memory/Registers SyncManager • All EtherCAT devices can map data in a single EtherCAT FMMU Diagnosis Datagram LRW – depending on the FMMU configuration 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 Ethernet HDR FH EH Data WKC FCS EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 47 FMMU entity configuration registers

EtherCAT Basics Slave Structure Physical Layer 32 Bit 16 Bit 8 Bit 8 Bit 16 Bit 8 Bit 8 Bit 1 31 Bit Device Model (ISO/OSI) Data Link Layer Glob. Start Addr. Length GSB GEB Phy. Start LSB Dir E Res… 0 32 48 56 64 80 88 96 97 127 Frame Structure Addressing Commands Memory/Registers 3 Bit 5 Bit 6 Bit SyncManager

FMMU 00-7 3Reserved 7 0 R 1W 2Reserved 7 Enable Diagnosis Application Layer State Machine Mailbox Length of all Write Enable Mailbox Interface concerned EoE Ethernet Read Enable CoE CANopen Bytes FoE File Access SoE Servo Drive Global GSB: Global Start Bit Local Slave Information /IF Device Profiles Start Address GEB: Global End Bit Start Address Modular Devices (32 Bit) LSB: Local Start Bit (16 Bit) Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 48 FMMU Setup

EtherCAT Basics Slave Structure 1. Master reads hardware configuration including input and Physical Layer Device Model (ISO/OSI) output data length of each slave Data Link Layer Frame Structure 2. Master organizes mapping of process data Addressing Commands 3. Master distributes information (start address etc.) for Memory/Registers SyncManager every slave about where process data in logical process FMMU image is provided Diagnosis Application Layer 4. Process data communication starts 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 49 FMMU example

EtherCAT Basics Slave Structure • Map 6 Bits form logical address 0x14711.3 to 0x14712.0 to Physical Layer Device Model (ISO/OSI) the physical register bits 0x0F01.1 to 0x0F01.6. Data Link Layer Frame Structure – The FMMU length is 2 Byte, since the mapped bits Addressing Commands span 2 Bytes of the logical space. Memory/Registers SyncManager FMMU FMMU config. register FMMU reg. offset Value Diagnosis Application Layer Logical Start Address 0x0:0x3 0x00014711 State Machine Length (Byte) 0x4:0x5 0x0002 Mailbox Mailbox Interface Logical Start Bit 0x6 0x03 EoE Ethernet CoE CANopen Logical Stop Bit 0x7 0x00 FoE File Access Physical Start Address 0x8:0x9 0x0F01 SoE Servo Drive Slave Information /IF Physical Start Bit 0xA 0x01 Device Profiles Modular Devices Type 0xB Rand and/or Write Drives Activate 0xC 1 (enable) Distributed Clocks Device Description Note: FMMU configuration registers start at address 0x0600 Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 50 Diagnosis at Data Link – Possible Errors

EtherCAT Basics Slave Structure Error situation Detection Physical Layer Device Model (ISO/OSI) Wrong Station Check EEPROM, Vendor, Device, SerialNo Data Link Layer Frame Structure Transmission Check Transmission Error Counter of each station Addressing Errors Commands Memory/Registers Change Check Link Status of last device (should have SyncManager FMMU between In and only a single port connected) Diagnosis Out Cable Application Layer State Machine Link loss/ Check working counter of a Broadcast read Mailbox Mailbox Interface Station fault EoE Ethernet CoE CANopen Frame loss Close loop in the middle FoE File Access SoE Servo Drive Check errors again Slave Information /IF Device Profiles If no frame loss repeat this in the 2nd half of Modular Devices segment Drives Distributed Clocks Otherwise repeat this in the first half of segment Device Description Configuration Tool Repeat this until only a single station remains, EtherCAT Master which should be the station with problems Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 51 Monitoring of EtherCAT Communication

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) Data Link Layer Switch Frame Structure Addressing Master Commands Memory/Registers SyncManager FMMU Diagnosis Application Layer State Machine Network Monitor Mailbox Mailbox Interface EoE Ethernet CoE CANopen FoE File Access • Masters sends an EtherCAT Frame (broadcast) SoE Servo Drive Slave Information /IF Monitor gets the first copy (unprocessed) Device Profiles Modular Devices • Frame returns from EtherCAT Slave Devices Drives Distributed Clocks Monitor gets the second copy (processed) Device Description Configuration Tool • DLL for readable format available on EtherCAT Web site EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 52 Monitoring of EtherCAT Communication

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) Network Monitor Data Link Layer Frame Structure Addressing Master Commands Memory/Registers SyncManager FMMU Diagnosis Application Layer State Machine Mailbox Mailbox Interface EoE Ethernet • Masters sends an EtherCAT Frame (broadcast) CoE CANopen FoE File Access Monitor gets the first copy (unprocessed) SoE Servo Drive Slave Information /IF • Frame returns from EtherCAT Slave Devices Device Profiles Modular Devices Monitor gets the second copy (processed) Drives Distributed Clocks • DLL for readable format available on EtherCAT Web site Device Description Configuration Tool Attention: EtherCAT Master At low cycle times order of frames might be mixed because of timing restrictions within Standards&Implementation NDIS protocol driver 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 53 Purpose of Application Layer (AL)

EtherCAT Basics Slave Structure • EtherCAT State Machine Physical Layer Device Model (ISO/OSI) • Mailbox Interfaces and Protocols Data Link Layer Frame Structure – Ethernet over EtherCAT Addressing Commands – CANopen over EtherCAT Memory/Registers SyncManager – Filetransfer over EtherCAT FMMU Diagnosis – Servo Drive over EtherCAT Application Layer State Machine • Slave Information Interface (SII) 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 54 Application Appli- HTTP, Application …. cation FTP, .. e.g. CiA402 Drive Profile

Object Dictionary Application TCP, UDP RD / WR File PDO Mapping Layer ... Access IP SDO PDO (AL)

VoE FoE EoE CoE CoE Mailbox DLL Process Data Interface (µC, SSI, I/O ) SII EEPROM Registers Mailbox Process Data

0x0000 0x1000 ESC Address Space (DPRAM)

SyncMan0 MbxOut SyncMan1 MbxIn SyncMan2 SyncMan3 Data FMMU n FMMU n FMMUFMMU Link EtherCAT Slave Controller (ESC) FMMU Layer EtherCAT Processing Unit (DL) and Auto-Forwarder with Loop Back

PHY MII / EBUS MII / EBUS MII / EBUS MII / EBUS Management Port 0 Port 3 Port 2 Port 1 Trafo RJ45 Physical PHY PHY LVDS Con

RJ45 Layer Trafo (PL)

FCS More Datagrams.. Mailbox Data FPWR Process Data LRW ECAT HDR Ethernet HDR HDR HDR © Copyright by Beckhoff, 2007 30.05.2007 EtherCATWKC Communication WKC 55 Purpose of EtherCAT State Machine

EtherCAT Basics Slave Structure • State Machine is build upon the Data Link Layer Physical Layer Device Model (ISO/OSI) • Defines general communication states of EtherCAT slave Data Link Layer Frame Structure devices Addressing Commands • Specifies the initialization and error handling of EtherCAT Memory/Registers SyncManager slave devices Boot-up of the network FMMU Diagnosis • States correspond to the communication relationship Application Layer between master and slave State Machine Mailbox • Requested and current state of a slave device are Mailbox Interface EoE Ethernet reflected in the AL Control and AL Status registers CoE CANopen FoE File Access • Five states are defined: SoE Servo Drive Slave Information /IF – ‘Init’, ‘Pre-Operational’, ‘Safe-Operational’, Device Profiles Modular Devices ‘Operational’ Drives Distributed Clocks – ‘Bootstrap’ optional state for firmware updates Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 56 EtherCAT State Machine

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) Init Data Link Layer Frame Structure Addressing Commands (IP) (PI) (SI) (IB) (BI) Memory/Registers SyncManager FMMU Pre-Operational Bootstrap Diagnosis (optional) Application Layer State Machine Mailbox Mailbox Interface (OI) (OP) (PS) (SP) EoE Ethernet CoE CANopen FoE File Access Safe-Operational SoE Servo Drive Slave Information /IF Device Profiles Modular Devices (SO) (OS) Drives Distributed Clocks Device Description Operational Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 57 State Machine / Init

EtherCAT Basics Init Slave Structure • ‘Init’ State Physical Layer Device Model (ISO/OSI) • No communication on the Pre-Operational Data Link Layer Frame Structure Application Layer Addressing Safe-Operational Commands • Master has access to the Memory/Registers SyncManager DL-Information registers Operational FMMU Diagnosis Application Layer State Machine • Transition to ‘Pre-Operational’ Mailbox Mailbox Interface • Master configures register, at least: EoE Ethernet CoE CANopen – DL Address register FoE File Access SoE Servo Drive – Sync Manager channels for Mailbox communication Slave Information /IF Device Profiles • Master requested ‘Pre-Operational’ state Modular Devices Drives – sets AL Control register Distributed Clocks Device Description – wait for AL Status register confirmation Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 58 State Machine / Pre-Operational

EtherCAT Basics Init Slave Structure • ‘Pre-Operational’ State Physical Layer Device Model (ISO/OSI) • Mailbox communication on the Pre-Operational Data Link Layer Frame Structure Application Layer Addressing Safe-Operational Commands • No Process Data communication Memory/Registers SyncManager Operational FMMU Diagnosis • Transition to ‘Safe-Operational’ Application Layer State Machine • Master configures parameter using the Mailbox Mailbox Mailbox Interface – e.g.: Process Data Mapping EoE Ethernet CoE CANopen • Master configures DL Register FoE File Access SoE Servo Drive – SyncManager channels for Process Data Slave Information /IF Device Profiles communication Modular Devices Drives – FMMU channels Distributed Clocks Device Description • Master requested ‘Safe-Operational’ state Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 59 State Machine / Safe-Operational

EtherCAT Basics Init Slave Structure • ‘Safe-Operational’ State Physical Layer Device Model (ISO/OSI) • Mailbox communication on the Pre-Operational Data Link Layer Frame Structure Application Layer Addressing Safe-Operational Commands • Process Data communication, Memory/Registers SyncManager but only Inputs are evaluated – Operational FMMU Outputs in ‘Safe’ state Diagnosis Application Layer State Machine Mailbox • Transition to ‘Operational’ Mailbox Interface EoE Ethernet • Master sends valid Outputs CoE CANopen FoE File Access • Master requested ‘Operational’ state SoE Servo Drive Slave Information /IF (AL Control/Status) Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 60 State Machine / Operational

EtherCAT Basics Init Slave Structure • ‘Operational’ State Physical Layer Device Model (ISO/OSI) • Inputs and Outputs are valid Pre-Operational Data Link Layer Frame Structure Addressing Safe-Operational Commands Memory/Registers SyncManager Operational 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 61 State Machine / Bootstrap

EtherCAT Basics Init Slave Structure • ‘Bootstrap’ State Physical Layer Device Model (ISO/OSI) • ‘Bootstrap’ State is optional – Pre-Operational Bootstrap Data Link Layer Frame Structure but recommended if firmware Addressing Safe-Operational Commands updates necessary Memory/Registers SyncManager • State changes only from and to ‘Init’ Operational FMMU Diagnosis • No Process Data communication Application Layer State Machine • Communication via Mailbox on Application Layer Mailbox Mailbox Interface • Special mailbox configuration possible, EoE Ethernet e.g. larger mailbox size CoE CANopen FoE File Access • Only FoE protocol available (possibly limited “file” range) SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 62 State Machine / Control and Status

EtherCAT Basics Slave Structure • Requested and current state of a slave device are Physical Layer Device Model (ISO/OSI) reflected in the AL Control and AL Status registers Data Link Layer Frame Structure – AL Control (0x0120) Addressing Commands Initiate State Transition of Device State Machine Memory/Registers SyncManager – AL Status (0x0130) FMMU Actual State of Device State Machine Diagnosis Application Layer – AL Status Code (0x0134) State Machine Mailbox Reason of error or other status code 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 63 Diagnosis at Application Layer

EtherCAT Basics Slave Structure • AL Status Code (0x0134) Physical Layer Device Model (ISO/OSI) – Error Codes (extract) Data Link Layer Frame Structure Code Description Addressing Commands 0x0000 No Error Memory/Registers 0x0011 Invalid requested state change SyncManager FMMU 0x0015 Invalid mailbox configuration Diagnosis Application Layer 0x0018 No valid inputs available State Machine 0x0019 No valid outputs Mailbox Mailbox Interface 0x001A Synchronization error EoE Ethernet CoE CANopen 0x001B Sync manager watchdog FoE File Access SoE Servo Drive – Further Status Codes (extract) Slave Information /IF Device Profiles Code Description Modular Devices 0x0021 Slave needs INIT Drives Distributed Clocks 0x0022 Slave need PREOP Device Description Configuration Tool 0x0030 Invalid DC Sync Configuration EtherCAT Master 0x0031 Invalid DC Latch Configuration Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 64 Mailbox Transfer

EtherCAT Basics Device Parameter (example) Slave Structure Physical Layer Index Value Device Model (ISO/OSI) 0x1600 RxPDO Mapping Data Link Layer Frame Structure 0x1A00 TxPDO Mapping Addressing 0x2000 Current control Commands Memory/Registers Mailbox Transfer for Parameter Data 0x2010 Velocity control SyncManager 0x2040 Motor parameter FMMU Full duplex capable Diagnosis 0x2070 Actual values Application Layer 0x6040 Controlword State Machine 0x6041 Statusword Mailbox IPC Mailbox Interface EoE Ethernet CoE CANopen State "PreOperational" FoE File Access SoE Servo Drive .. DVI Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Simple IO-Device Configuration Tool No Parameter EtherCAT Master Standards&Implementation No Mailbox necessary 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 65 Purpose of Mailbox Transfer

EtherCAT Basics Slave Structure • Standard way to exchange Parameter Data Physical Layer Device Model (ISO/OSI) • The Mailbox Interface is optional – but recommended Data Link Layer Frame Structure • Needed if Process Data configurable or any other non Addressing Commands cyclic services Memory/Registers SyncManager • Full duplex capable FMMU Diagnosis (Slave can initiate a communication) Application Layer • 2 Sync Manager channels reserved State Machine Mailbox – Sync Manager 0 : Master to Slave Mailbox Interface EoE Ethernet – Sync Manager 1 : Slave to Master CoE CANopen FoE File Access • Available at early stage of communication SoE Servo Drive Slave Information /IF (State Pre-Operational) Device Profiles Modular Devices • Multi protocol capable Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 66 Mailbox Protocol Types

EtherCAT Basics Slave Structure • Ethernet over EtherCAT (EoE) Physical Layer – Tunnels standard Ethernet Frames over EtherCAT Device Model (ISO/OSI) Data Link Layer Frame Structure • CANopen over EtherCAT (CoE) Addressing Commands – Access of a CANopen object dictionary and its objects Memory/Registers – CANopen Emergency and optional event driven PDO SyncManager FMMU messages Diagnosis Application Layer State Machine • File Access over EtherCAT (FoE) Mailbox – Download and upload firmware and other ‘files’ Mailbox Interface EoE Ethernet CoE CANopen • Servo Drive over EtherCAT (SoE) FoE File Access SoE Servo Drive – Access the Servo Profile Identifier (IDN) Slave Information /IF Device Profiles Modular Devices • Vendor specific Profile over EtherCAT (VoE) Drives – First DWORD contains the Vendor ID, the next WORD Distributed Clocks contains a Vendor Type, the rest is vendor specific Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 67 Mailbox Interface

EtherCAT Basics Slave Structure • Datagram within an EtherCAT Frame Physical Layer Device Model (ISO/OSI) • 2 Sync Manager channels (1 buffer-mode) reserved Data Link Layer Frame Structure – Sync Manager 0 : Master to Slave Mbx Addressing Commands – Sync Manager 1 : Slave to Master Mbx Memory/Registers SyncManager FMMU Ethernet Header EC Header EtherCAT Data FCS Diagnosis Type = 88A4h Type = 1 Application Layer State Machine

Mailbox st nd th Mailbox Interface 1 EtherCAT Datagram 2 … … n EtherCAT Datagram EoE Ethernet CoE CANopen FoE File Access Datag. Header Data WKC SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Mailbox Protocol Distributed Clocks Device Description Configuration Tool EtherCAT Master Mbx Header Command Cmd specific data Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 68 Mailbox Header

48 Bit EtherCAT Basics Slave Structure Mbx Header Command Cmd specific data Physical Layer Device Model (ISO/OSI) Data Link Layer 16 Bit 16 Bit 6 Bit 2 Bit 4 Bit 4 Bit Frame Structure Length Address Channel Prio Type Cntr Addressing 0 16 32 38 40 44 Commands Memory/Registers Length Length of following data SyncManager FMMU Address Station Address of originator Diagnosis Application Layer Channel reserved for future use State Machine Mailbox Priority reserved for future use Mailbox Interface EoE Ethernet Type Mailbox Type, Protocol identifier for following data CoE CANopen 0 Mailbox Error FoE File Access 2 EoE (Ethernet over EtherCAT) SoE Servo Drive Slave Information /IF 3 CoE (CANopen over EtherCAT) Device Profiles 4 FoE (File Access over EtherCAT) Modular Devices 5 SoE (Servo Drive over EtherCAT) Drives 15 VoE (Vendor specific profile over EtherCAT) Distributed Clocks Device Description Counter Sequence number for duplicate detection Configuration Tool EtherCAT Master Increments with every new mailbox service Standards&Implementation (only the values 1-7 will be used to be compatible with older versions). 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 69 Resilient Mailbox Procedure

EtherCAT Basics Slave Structure • Reliable way of mailbox data exchange Physical Layer Device Model (ISO/OSI) Data Link Layer • Mailbox control procedure Frame Structure Addressing Commands Memory/Registers • Recover from lost frames SyncManager FMMU Diagnosis • No additional frames if no error Application Layer State Machine Mailbox • Additional receive buffer required Mailbox Interface EoE Ethernet CoE CANopen FoE File Access • Extra counter in mailbox header needed SoE Servo Drive Slave Information /IF Device Profiles • HW/SW solution Modular Devices Drives – SyncManager configuration register with toggle flags Distributed Clocks Device Description – SW-Mailbox-DL Layer for checking toggle bits Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 70 Mailbox Error Handling – Sync Manager

EtherCAT Basics Slave Structure • Sync Manager channel configuration registers Physical Layer Device Model (ISO/OSI) 16 Bit 16 Bit 8 Bit 8 Bit 1 16 Bit 1 1 6 Bit Data Link Layer Frame Structure 0Start Address 16Length 32Ctrl 40 Status 48E 49 WT 50Res. 56D 57RT Res. 58 63 Addressing Commands Memory/Registers SyncManager WT – SM Write Toggle FMMU Diagnosis RT – SM Read Toggle Application Layer State Machine • Following: Mailbox Mailbox Interface – Mailbox Error Handling - Write Example EoE Ethernet CoE CANopen – Mailbox Error Handling - Read Example FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 71 Mailbox Error Handling – Mailbox Write

EtherCAT Basics Slave Structure Physical Layer Master Slave Device Model (ISO/OSI) Data Link Layer Mailbox Write (Mbx Hdr Ctr=1) Frame Structure Addressing Slave receives Mailbox Write Event Commands FPWR response got lost, and calls MBX_MailboxWrite Ind Memory/Registers Master repeats the Mailbox to start the handling on the Mailbox SyncManager Write without incrementing Write service FMMU the Mbx Hdr Ctr Diagnosis MBX_MailboxWriteInd Application Layer State Machine Mailbox Mailbox Write (Mbx Hdr Ctr=1) Mailbox Interface EoE Ethernet Slave receives Mailbox Write Event, CoE CANopen detects an unchanged counter FoE File Access in the mailbox header and discard SoE Servo Drive the Mailbox Write Service Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 72 Mailbox Error Handling – Mailbox Read

EtherCAT Basics Master Slave Slave Structure MBX_MailboxSendReq(pMbx) Physical Layer Slave puts the Mailbox Read service Device Model (ISO/OSI) in the send mailbox and stores Data Link Layer the actual sent buffer Frame Structure Addressing Master sends FPRD service, psReadMbx = pMbx Commands to read the mailbox Mailbox Read Memory/Registers Slave receives Mailbox Read Event SyncManager Mailbox Read (Mbx Hdr Ctr=1 ) and stores the sent buffer for a FMMU possibly repeated service Diagnosis Application Layer psRepeatMbx = psReadMbx State Machine FPRD response got lost, Mailbox Master starts a repeating Mailbox Interface sequence and shall not Mailbox Repeat (toggles SM-Write-Toggle) EoE Ethernet read the mailbox again CoE CANopen before the repeating Slave detects the Mailbox Repeat FoE File Access sequence Is finished request by checking the SM-Write- SoE Servo Drive Toggle, puts the psReceiveMbx Slave Information /IF buffer in the Send mailbox and Device Profiles Master reads cyclically Read SM-Read-Toggle toggles the SM-Read-Toggle Modular Devices the SM-Read-Toggle to Drives check if the Slave has Distributed Clocks finished the repeat request psReadMbx = psRepeatMbx Device Description Configuration Tool When the SM-Read-Toggle Mailbox Read EtherCAT Master has toggled the master reads Standards&Implementation the send mailbox again Mailbox Read (Mbx Hdr Ctr=1) 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 73 Ethernet over EtherCAT (EoE)

EtherCAT Basics Slave Structure Physical Layer Web server Device Model (ISO/OSI) Data Link Layer virtual MAC Address Frame Structure virtual IP Address Addressing Ethernet Commands Switch Memory/Registers Functionality SyncManager Switchport- FMMU Terminal Diagnosis Application Layer Master State Machine Mailbox Mailbox Interface EoE Ethernet TCP/IP CoE CANopen FoE File Access SoE Servo Drive Slave Information /IF Even via Device Profiles Internet Modular Devices Drives Distributed Clocks Label printer Device Description Web access on device with Configuration Tool web server EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 74 Purpose of Ethernet over EtherCAT (EoE)

EtherCAT Basics Slave Structure • Tunnels transparently Ethernet Frames over EtherCAT Physical Layer Device Model (ISO/OSI) • Tunneling reduces the cycle times without restrictions and Data Link Layer Frame Structure to optimized available bandwidth Addressing Commands • Used for devices with TCP/IP stacks (e.g. Web Server) Memory/Registers SyncManager and for infrastructure devices like Switch Terminals FMMU Diagnosis • Allows to access corresponding devices in the normal IP Application Layer network in combination with a ‘Virtual Ethernet Switch’ State Machine Mailbox (Layer 2) on the master side 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 75 EoE – Switchport: Any Ethernet Protocol

EtherCAT Basics Slave Structure • Interface to any Ethernet Device or Network Physical Layer Device Model (ISO/OSI) • Ethernet Frames are inserted in EtherCAT Protocol Data Link Layer Frame Structure Addressing Commands Memory/Registers EtherCAT Switchport SyncManager FMMU Diagnosis Ethernet MAC PHY Application Layer State Machine Mailbox Mailbox Interface RX1 RX2 TXRX RX3 RX4 EoE Ethernet µC CoE CANopen Fragmentation FoE File Access SoE Servo Drive Mailbox Process Data Slave Information /IF Device Profiles PHY EtherCAT MAC / DLL PHY Modular Devices TX2TX3TX1 TX2TX3TX1 Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 76 EoE – Virtual Switch on Master

EtherCAT Basics 172.17.1.4 Slave Structure Physical Layer Device Model (ISO/OSI) Data Link Layer Frame Structure Addressing Commands Memory/Registers SyncManager FMMU Diagnosis Application Layer State Machine Virt. EoE Mailbox Switch Mailbox Interface EoE Ethernet CoE CANopen 172.17.1.1 FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 77 EoE – Bandwidth estimation

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 • EtherCAT Realtime not restricted by EoE FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 78 EoE – Frame Header

EtherCAT Basics 8 Byte 4 Byte Max. 1476 Byte Slave Structure Mbx Header EoE Cmd Cmd specific data Physical Layer Type = 2 (EoE) Device Model (ISO/OSI) Data Link Layer 4 Bit 4 Bit 1B 1B 1B 5B 6 Bit 6 Bit 4 Bit Frame Structure Frag. Frame Addressing Type Port LF TA TR res Size Commands No No Memory/Registers SyncManager FMMU Type EoE Frame Type Diagnosis 0x00 EoE Fragment Request Application Layer 0x01 Initiate EoE Request State Machine 0x02 IP Parameter Request Mailbox 0x03 IP Parameter Response Mailbox Interface 0x04 Set MAC Address Filter Request EoE Ethernet 0x05 Set MAC Address Filter Response CoE CANopen FoE File Access Port Selected Port SoE Servo Drive LF Last fragment Slave Information /IF Device Profiles TA Time stamp appended (only if LF=1) Modular Devices Drives TR Time stamp request Distributed Clocks Fragment No Fragment Number of the Ethernet Frame fragment Device Description Configuration Tool Size Complete size of Ethernet Frame EtherCAT Master Frame No Number of the Ethernet Frame Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 79 EoE – Frames

EoE (Mbx Type = 2) n * 32 Byte (except for the last fragment) 32 Bit

Mbx Header EoE Header (Type=0, TA=0) Fragment Data

Mbx Header EoE Header (Type=0,LF=1,TA=1) Fragment Data Time Stamp

Mbx Header EoE Header (Type = 1) Time Stamp

Mbx Header EoE Header (Type = 2) IP Settings

Mbx Header EoE Header (Type = 3) IP Settings Response

Mbx Header EoE Header (Type = 4) MAC Filter Settings

Mbx Header EoE Header (Type = 5) MAC Filter Settings Response

30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 80 EoE – Time Stamp

EtherCAT Basics Slave Structure • Time Stamp Physical Layer – 32 Bit Timing information with 1 ns resolution Device Model (ISO/OSI) Data Link Layer – DC System Time if available (Register 910h) Frame Structure – Time stamp trigger is the beginning of Destination Addressing Commands Address (DA) in the Ethernet Frame Memory/Registers SyncManager FMMU • Time stamp appended (TA = 1) Diagnosis – Slave to Master: Application Layer Time stamp contains exact receive time State Machine Mailbox – Master to Slave: Mailbox Interface Time Stamp contains desired send time EoE Ethernet – Time stamp extends frame data by 32 Bit CoE CANopen FoE File Access – TA is allowed in last fragment only (LF = 1). SoE Servo Drive If necessary, add additional fragment Slave Information /IF Device Profiles • fill the “last” fragment with parts of the Time Stamp Modular Devices (LF=0, TA=0) and send a very last fragment with the Drives rest of the Time Stamp (LF=1, TA=1) Distributed Clocks Device Description – Slave should always append a Time Stamp if it has this Configuration Tool feature EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 81 EoE – Time Stamp

EtherCAT Basics Slave Structure • Time Stamp requested (TR = 1) Physical Layer Device Model (ISO/OSI) – Response with the exact send time and the same Data Link Layer FrameNo requested Frame Structure Addressing – Response should be send as soon as possible Commands Memory/Registers – Can be used for segment to segment synchronization 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 82 EoE – Error Handling

EtherCAT Basics Slave Structure • No special Error Handling required! Physical Layer Device Model (ISO/OSI) • EoE is a Layer 2 Protocol – logical like an Ethernet Switch Data Link Layer Frame Structure • If a fragment is missing, the whole frame will be discarded Addressing Commands • Frame loss is recognized at higher levels 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 83 Purpose of CANopen over EtherCAT (CoE)

EtherCAT Basics Slave Structure • Recommended protocol for Service Data Access Physical Layer Device Model (ISO/OSI) – Configuration of communication parameter Data Link Layer Frame Structure – Configuration of device specific parameter Addressing Commands Memory/Registers • Easy migration path from CANopen Devices to EtherCAT CoE SyncManager FMMU Devices Diagnosis Application Layer – Protocol Stacks can be re-used 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 84 CANopen over EtherCAT Device Architecture

EtherCAT Basics Slave Structure Physical Layer EtherCAT Device Device Model (ISO/OSI) Data Link Layer Frame Structure CANopen Application Addressing Commands Memory/Registers SyncManager FMMU Diagnosis Object Dictionary Process Data Application Layer State Machine Mailbox Service Data Objects PDO Mapping Mailbox Interface EoE Ethernet CoE CoE CoE CANopen FoE File Access Mailbox Process Data SoE Servo Drive Slave Information /IF Device Profiles EtherCAT Slave Controller Modular Devices Drives Distributed Clocks Ethernet Physical Layer Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 85 CANopen over EtherCAT (CoE)

EtherCAT Basics Slave Structure • SDO: Access to a CANopen object dictionary ✔ Physical Layer Device Model (ISO/OSI) – Download and Upload of parameters Data Link Layer Frame Structure – Standard Process Data Mapping (PDO Mapping) Addressing Commands – Full Access to CANopen Profiles Memory/Registers • PDO: Process Data Objects SyncManager ✔ FMMU – Direct PDO transfer Diagnosis Application Layer – Remote Transmission Requests of PDOs State Machine Mailbox • Emergency Messages ✔ Mailbox Interface EoE Ethernet • Network Management ✔ CoE CANopen Standard CANopen Features FoE File Access SoE Servo Drive • + Object Dictionary Information (SDO Information) Slave Information /IF Device Profiles – Upload of object dictionary (identifier lists) Modular Devices Drives – Upload of object description Distributed Clocks Device Description – Upload of entry descriptions Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 86 CoE –Frame Header

EtherCAT Basics 8 Byte 2 Byte Max. 1478 Byte Slave Structure Mbx Header CoE Cmd Cmd specific data Physical Layer Type = 3 (CoE) Device Model (ISO/OSI) Data Link Layer 9 Bit 3 Bit 4 Bit Frame Structure Addressing Number res Type Commands Memory/Registers SyncManager FMMU Number PDO Number (PDO transfer only) Diagnosis Application Layer Type Message Type State Machine 0 reserverd Mailbox 1 Emergency Message Mailbox Interface 2 SDO Request EoE Ethernet 3 SDO Response CoE CANopen 4 TxPDO FoE File Access 5 RxPDO 6 Remote transmission request of TxPDO SoE Servo Drive 7 Remote transmission request of RxPDO Slave Information /IF 8 SDO information Device Profiles 9-15 reserved for future use Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 87 CoE – Standard CANopen Frames

EtherCAT Basics 8 Byte 2 Byte Max. 1478 Byte Slave Structure Mbx Header CoE Cmd Cmd specific data Physical Layer Type = 3 (CoE) Device Model (ISO/OSI) Data Link Layer 8 Bit 16 Bit 8 Bit 32 Bit 1 .. 1470 Byte Frame Structure SDO Data Addressing Index Subindex Data Commands Control (optional) Memory/Registers SyncManager FMMU Standard CANopen Frame Diagnosis Application Layer State Machine SDO Control Standard CANopen SDO Services Mailbox Mailbox Interface Index Object Addressing by Index … EoE Ethernet CoE CANopen Subindex … and Subindex FoE File Access Data Data for the SDO-Service SoE Servo Drive Slave Information /IF Data (optional) Optionally more than 4 bytes of data can be sent Device Profiles with one frame. Modular Devices Full mailbox size usable Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 88 Example: ‘Initiate SDO Download’ Request

EtherCAT Basics the original Slave Structure Mailbox Size CANopen Protocol Physical Layer Device Model (ISO/OSI) (CiA DS301) Data Link Layer 48 Bit 16 Bit 64 Bit Frame Structure Mailbox Header CoE SDO Data (optional) Addressing Commands Memory/Registers SyncManager 16 Bit 8 Bit 32 Bit FMMU 0-4 Bytes I E Size C Ccs Index Sub Data Diagnosis 0 12 45 8 24 32 63 Application Layer Expedited = Initiate SDO Download Request State Machine 1 1 4-n 0 1 Mailbox > 4 Bytes I E Size C Ccs Index Sub Length Data 0-n Mailbox Interface 0 12 45 8 24 32 64 EoE Ethernet 0 0 0 0 1 CoE CANopen FoE File Access Data > Mailbox: ‘Download SDO Segment’ follows SoE Servo Drive Slave Information /IF > 7 Bytes L Size T Ccs Data 0-6 Data 7-n Device Profiles 0 1 4 5 8 64 Modular Devices left Drives 0/1 0 0/1 0 = Download SDO Segment Request Distributed Clocks <= 7 Bytes Device Description L Size T Ccs Data 0-n 0 1 4 5 8 63 Configuration Tool EtherCAT Master 0/1 7-n 0/1 0 Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 89 Optional SDO Extensions to CANopen DS 301

EtherCAT Basics Slave Structure • Breaking of the 8 byte border Physical Layer Device Model (ISO/OSI) – Full mailbox size usable Data Link Layer Block transfer unnecessary Frame Structure Addressing – ‘Initiate SDO Download’ request / Commands Memory/Registers ‘SDO Upload’ response can contain data after SDO SyncManager header FMMU Diagnosis – ‘Download SDO Segment’ request / Application Layer State Machine ‘Upload SDO Segment’ response can contain more Mailbox than 7 bytes of data Mailbox Interface EoE Ethernet CoE CANopen FoE File Access • Downloading and Uploading all Subindices at once SoE Servo Drive Slave Information /IF – Bit 4 of the Initiate ‘SDO Download / Upload’ request Device Profiles header indicates a ‘Complete Access’ to an Index Modular Devices Drives – Sub Index field contains the start Subindex Distributed Clocks Device Description • 0: Complete Index with all Subindices Configuration Tool EtherCAT Master • 1: Complete Index without Subindex 0 Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 90 CoE: Optional SDO Information Protocol

EtherCAT Basics Slave Structure • Access to object lists Physical Layer Device Model (ISO/OSI) – list of all supported object identifiers Data Link Layer Frame Structure – list of all object identifiers that can be mapped in Addressing Commands PDOs Memory/Registers SyncManager – list of all object identifiers that should be included in FMMU Diagnosis a backup Application Layer State Machine • Access to object descriptions Mailbox Mailbox Interface – Descriptions of objects – as defined in DS 301 EoE Ethernet CoE CANopen • Access to entry descriptions FoE File Access SoE Servo Drive – Descriptions of object entries (sub index) – as Slave Information /IF defined in DS 301 Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 91 CoE – Object Dictionary

EtherCAT Basics Slave Structure • Devices with an EtherCAT-CoE and a CANopen interface Physical Layer Device Model (ISO/OSI) are possible with the same object dictionary Data Link Layer Frame Structure Addressing Commands Index Range Meaning Memory/Registers SyncManager 0x0000 – 0x0FFF Data Type Description FMMU Diagnosis 0x1000 – 0x1FFF Communication objects Application Layer • Device Type, Identity, PDO Mapping – like defined in DS 301 State Machine Mailbox • Objects defined in DS 301 not needed are reserved for EtherCAT Mailbox Interface • Additional objects (Sync Manager Communication Type, Sync EoE Ethernet Manager PDO Assignment) located in unused areas of DS 301 CoE CANopen FoE File Access 0x2000 – 0x5FFF Manufacturer specific SoE Servo Drive 0x6000 – 0x9FFF Profile specific Slave Information /IF Device Profiles 0xA000 – 0xFFFF reserved Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 92 CoE – Online Object Dictionary

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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 93 CoE – New objects for EtherCAT

EtherCAT Basics Slave Structure Index Meaning Physical Layer 0x1C00 SyncManager Communication Type Device Model (ISO/OSI) Data Link Layer 0x1C10 – 0x1C2F SyncManager PDO Assign Frame Structure Addressing 0x1C30 – 0x1C4F SyncManager Parameter Commands Memory/Registers • SyncManager Communication Type SyncManager – Subindex (1-32) defines communication type of the corresponding Sync FMMU Manager channel Diagnosis • Mailbox Out (= 1 buffer write) Application Layer • Mailbox In (= 1 buffer read) State Machine Mailbox • Process Data Out (= 3 buffer write) Mailbox Interface • Process Data In (= 3 buffer read) EoE Ethernet • SyncManager PDO Assign CoE CANopen FoE File Access – Contains a list of assigned PDOs for each Sync Manager channel SoE Servo Drive (Index of PDO mapping objects) Slave Information /IF – Assigned PDO in Subindex 1 to n describe the process data parts of the Sync Device Profiles Manager channel Modular Devices • SyncManager Parameter Drives Distributed Clocks – SubIdx 1: Synchronization type Device Description (Freerun, synchron, DC Sync0, DC Sync1, SyncSm0 .. SyncSm1F) Configuration Tool – SubIdx 2: Cycle time EtherCAT Master – SubIdx 3: Shift time Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 94 CoE – Process Data Objects

EtherCAT Basics Slave Structure 1…8 Byte 1..n Byte Physical Layer Device Model (ISO/OSI) Process Data Process Data Data Link Layer Frame Structure Addressing Standard CANopen PDO frame optional Commands Memory/Registers SyncManager FMMU • Standard CANopen PDO frames can be used Diagnosis Application Layer • CANopen PDO mapping used for EtherCAT too State Machine Mailbox • PDOs usually are related to their „own“ Sync Manager Mailbox Interface EoE Ethernet channels CoE CANopen FoE File Access – Cyclic data transmission SoE Servo Drive Slave Information /IF – No PDO communication parameters necessary Device Profiles Modular Devices • PDOs can be transmitted by the mailbox for acyclic Drives communication Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 95 CoE – PDO Process Data mapping

EtherCAT Basics Slave Structure • No mapping protocol implemented for very simple devices Physical Layer Device Model (ISO/OSI) – Fixed process data Data Link Layer Frame Structure – Readable via EEPROM – no SDO protocol necessary Addressing Commands • Readable PDO Mapping Memory/Registers SyncManager – Fixed process data mapping FMMU Diagnosis – Readable via SDO Application Layer State Machine • Selectable PDO Mapping Mailbox Mailbox Interface – Multiple fixed PDO – selectable via CoE object (1C1xh) EoE Ethernet CoE CANopen – Selectable via SDO (required) FoE File Access SoE Servo Drive • Variable PDO Mapping Slave Information /IF Device Profiles – Configurable via CoE or SoE required Modular Devices Drives – Writable PDO content Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 96 CoE – PDO Configuration

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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 97 CoE – Emergency Message

EtherCAT Basics Slave Structure 6 Bytes2 Bytes 2 Bytes 1 Byte 5 Bytes 1..n Bytes Physical Layer Mailbox Header CoE Header ErrorCode Error Register Data Data Device Model (ISO/OSI) Data Link Layer Frame Structure Mandatory Header Standard CANopen Emergency frame optional Addressing Commands • Standard CANopen Emergency frames can be used Memory/Registers SyncManager • More than 5 bytes of data can be send optionally with one FMMU Diagnosis frame 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 98 File Access over EtherCAT (FoE)

EtherCAT Basics Slave Structure • Similar to TFTP (Trivial , RFC 1350) Physical Layer Device Model (ISO/OSI) Data Link Layer • Simple to implement – suitable for bootstrap loaders Frame Structure Addressing Commands • 6 Services are defined: Memory/Registers – WRQ: Write request with “file name” SyncManager FMMU – RRQ: Read request with “file name” Diagnosis – DATA: Data block (full mailbox size used) Application Layer State Machine – ACK: Acknowledgment of DATA and WRQ requests Mailbox – ERR: Error notification with predefined error codes Mailbox Interface EoE Ethernet – BUSY: Busy notification in case of longer procedures, CoE CANopen extension to TFTP (e.g. erasing of flash FoE File Access modules) SoE Servo Drive Slave Information /IF Device Profiles • Special mailbox configuration for bootstrap mode possible Modular Devices Drives – Fixed addresses and fixed size of the mailbox Distributed Clocks – Configuration defined by device (EEPROM) Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 99 File Access over EtherCAT (WRQ, normal)

EtherCAT Basics Slave Structure Physical Layer Master Slave Device Model (ISO/OSI) Data Link Layer WRQ (with file name) Frame Structure Addressing ACK (packet no 0) Commands Memory/Registers SyncManager DATA (packet no 1, full mailbox) FMMU Diagnosis ACK (packet no 1) Application Layer State Machine Mailbox DATA (packet no 2, full mailbox) Mailbox Interface EoE Ethernet ACK (packet no 2) CoE CANopen FoE File Access DATA (packet no 3, less data or zero data) SoE Servo Drive Slave Information /IF ACK (packet no 3) Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 100 File Access over EtherCAT (WRQ, with busy)

EtherCAT Basics Slave Structure Physical Layer Master Slave Device Model (ISO/OSI) Data Link Layer WRQ (with file name) Frame Structure Addressing ACK (packet no 0) Commands Memory/Registers DATA (packet no 1, full mailbox) SyncManager FMMU ACK (packet no 1) Diagnosis Application Layer DATA (packet no 2, less data or zero State Machine data) Mailbox BUSY (X of N done) Mailbox Interface EoE Ethernet DATA (packet no 2, less data or zero data) CoE CANopen FoE File Access BUSY (Y of N done) SoE Servo Drive Slave Information /IF DATA (packet no 2, less data or zero data) Device Profiles Modular Devices ACK (packet no 2) Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 101 File Access over EtherCAT (WRQ, with error)

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) Master Slave Data Link Layer Frame Structure WRQ (with file name) Addressing Commands ERR (error code and optional error text) 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 102 File Access over EtherCAT (RRQ, normal)

EtherCAT Basics Slave Structure Physical Layer Master Slave Device Model (ISO/OSI) Data Link Layer RRQ (with file name) Frame Structure Addressing DATA (packet no 1, full mailbox) Commands Memory/Registers ACK (packet no 1) SyncManager FMMU Diagnosis DATA (packet no 2, full mailbox) Application Layer State Machine ACK (packet no 2) Mailbox Mailbox Interface EoE Ethernet DATA (packet no 3, less data or zero data) CoE CANopen FoE File Access ACK (packet no 3) SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 103 Servo Drive over EtherCAT (SoE)

EtherCAT Basics Slave Structure • Implements Service Channel Physical Layer Device Model (ISO/OSI) – Read / Write to several elements of an IDN (Ident number) Data Link Layer Frame Structure – Support of Procedure Commands Addressing Commands – Slave Info Memory/Registers SyncManager FMMU • The mapping of the IEC 61800-7-1 Annex D (SERCOS™) on Diagnosis Application Layer EtherCAT is described in IEC 61800-7-3 Annex D 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 104 SoE – Frame Header

EtherCAT Basics 6 Byte 4 Byte Max. 1476 Byte Slave Structure Mbx Header SoE Cmd Cmd specific data Physical Layer Type = 5 (SoE) Device Model (ISO/OSI) Data Link Layer 3 Bit 1 Bit 1 Bit 3 Bit 8 Bit 16 Bit Frame Structure Addressing Cmd Incomp Err Drive Element IDN Commands Memory/Registers SyncManager FMMU Command Command Type Diagnosis Read Request, Read Response, Write Request, Write Response, Notification Application Layer State Machine Incomplete Indicates if execution of another service is needed to complete Mailbox the operation Mailbox Interface EoE Ethernet Error Indicates if an Error has occurred CoE CANopen Drive Contains the address of the drive inside the slave device that is FoE File Access SoE Servo Drive addressed Slave Information /IF Element Contains the ElementFlags. There is a single Flag for each Device Profiles element of an IDN indicating which elements of the object Modular Devices Drives addressed by the IDN are accessed Distributed Clocks IDN contains IDN according to IEC 61800-7-2 Annex D Device Description Configuration Tool or an indicator for fragments left in case of segmented service EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 105 SoE Communication phases

EtherCAT Basics IEC 61784 EtherCAT Slave Structure CPF 16 Physical Layer Device Model (ISO/OSI) Init Phase 0 / 1 Data Link Layer Frame Structure (IP) (PI) Addressing Commands (SI) Memory/Registers Pre-Operational Phase 2 SyncManager FMMU (OI) (PS) (SP) Diagnosis (S-0-0127) Application Layer (OP) Safe-Operational Phase 3 State Machine (with Inputs) Mailbox (SO) (OS) Mailbox Interface (S-0-0128) EoE Ethernet CoE CANopen Operational Phase 4 FoE File Access SoE Servo Drive • SERCOS communication phases (CPs) comparable to EtherCAT state machine Slave Information /IF Device Profiles • Phases 0 and 1 covered by the ‘Init’ Modular Devices • Phase 2 corresponds to ‘Pre-Operational’ Drives allows access to the IDNs via ‘service channel’ (SoE). Distributed Clocks • Phase 3 mapped to ‘Safe-Operational’ Device Description slave shall transmit valid inputs, ignore outputs from the master. Configuration Tool • ‘Operational’ corresponds to phase 4 EtherCAT Master Standards&Implementation all inputs and outputs are valid. 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 106 Slave Information Interface (SII)

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) EDS Data Link Layer XML

Frame Structure .... DVI Addressing Commands Slave Memory/Registers SyncManager Host FMMU CPU Diagnosis ESC Application Layer Configuration State Machine Mailbox EEPROM Data Mailbox Interface ESC EoE Ethernet CoE CANopen FoE File Access Trafo

SoE Servo Drive RJ45 Slave Information /IF PHY PHY Device Profiles RJ45 Trafo Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 107 Application Appli- HTTP, Application …. cation FTP, .. e.g. CiA402 Drive Profile

Object Dictionary Application TCP, UDP RD / WR File PDO Mapping Layer ... Access IP SDO PDO (AL)

VoE FoE EoE CoE CoE Mailbox DLL Process Data Interface (µC, SSI, I/O ) SII EEPROM Registers Mailbox Process Data

0x0000 0x1000 ESC Address Space (DPRAM)

SyncMan0 MbxOut SyncMan1 MbxIn SyncMan2 SyncMan3 Data FMMU n FMMU n FMMUFMMU Link EtherCAT Slave Controller (ESC) FMMU Layer EtherCAT Processing Unit (DL) and Auto-Forwarder with Loop Back

PHY MII / EBUS MII / EBUS MII / EBUS MII / EBUS Management Port 0 Port 3 Port 2 Port 1 Trafo RJ45 Physical PHY PHY LVDS Con

RJ45 Layer Trafo (PL)

FCS More Datagrams.. Mailbox Data FPWR Process Data LRW ECAT HDR Ethernet HDR HDR HDR © Copyright by Beckhoff, 2007 30.05.2007 EtherCATWKC Communication WKC 108 Purpose of Slave Information Interface

EtherCAT Basics Slave Structure • The mandatory Slave Information Interface (SII) consists of Physical Layer Device Model (ISO/OSI) all objects that can be stored persistently. Data Link Layer Frame Structure • The information is stored in an EEPROM Addressing Commands • EtherCAT Slave Controller has SPI interface to EEPROM Memory/Registers SyncManager – 1 kBit … 4 MBit FMMU Diagnosis • The SII contains Application Layer State Machine – boot configuration data Mailbox Mailbox Interface – device identity (mandatory) EoE Ethernet CoE CANopen • Vendor Id, Product Code, Revision No, Serial No FoE File Access SoE Servo Drive • Same information in CoE object 0x1018 Slave Information /IF Device Profiles – application information data Modular Devices Drives • Contains additional information (optional) Distributed Clocks Device Description – Subdivided in categories Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 109 SII – EEPROM content

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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 110 SII – EEPROM Layout

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) Byte 0 Data Link Layer EtherCAT Slave Controller Configuration Area Frame Structure 16 Addressing VendorId ProductCode RevisionNo SerialNo 32 Commands Hardware Delays Bootstrap Mailbox Config Memory/Registers 48 SyncManager Mailbox Sync Man Config FMMU Diagnosis Reserved Application Layer 128 State Machine Additional Information (Subdivided in Categories) Mailbox Mailbox Interface … EoE Ethernet Category Strings CoE CANopen FoE File Access Category Generals SoE Servo Drive Slave Information /IF Category FMMU Device Profiles Modular Devices Category SyncManager Drives Distributed Clocks Category Tx- / RxPDO for each PDO Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 111 EEPROM – Slave Configuration Area

EtherCAT Basics EEPROM Parameter Description Corresp. Slave Structure Word Register Physical Layer Address Device Model (ISO/OSI) Data Link Layer 0 PDI Control Initialization value for PDI Control register 0x0140 Frame Structure (EEPROM ADR 0x0000.9 is also mapped to 0x0141 Addressing register 0x0110.2) Commands 1 PDI configuration, Initialization value for PDI Configuration 0x0150 Memory/Registers register 0x0151 SyncManager Depends on the selected PDI, FMMU Configuration of Sync0 and Sync1 Pin Diagnosis Application Layer 2 Pulse length of SYNC Initialization value for Pulse Length of SYNC 0x0982 State Machine signals Signals register 0x0983 Mailbox in Units of 10 ns Mailbox Interface 3 Extended PDI Initialization value for extended PDI 0x0152 EoE Ethernet configuration Configuration register 0x0153 CoE CANopen FoE File Access 4 Configured Station Alias Initialization value for Configured Station Alias 0x0012 SoE Servo Drive Address register 0x0013 Slave Information /IF 5, 6 Reserved Device Profiles Modular Devices 7 Checksum CRC of first 6 words Drives (x^8+x^2+x+1, initial value 0xFF) Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 112 SII – Categories

EtherCAT Basics Slave Structure • Contains optional information Physical Layer Device Model (ISO/OSI) • Divided in categories Data Link Layer Frame Structure – Standard category(s) Addressing Commands – Vendor category(s) Memory/Registers SyncManager • Same header for all categories FMMU 16 Bit 16 Bit Diagnosis – Category Type Category Length Data… Application Layer State Machine – Word-Length of data Mailbox Mailbox Interface EoE Ethernet Category Meaning CoE CANopen FoE File Access STRINGS Text strings SoE Servo Drive Slave Information /IF General Device Information Device Profiles FMMU FMMU usage Modular Devices Drives SyncManger Modes of operation, Enable Distributed Clocks Device Description TxPDO Transmit PDO Entries Configuration Tool RxPDO Receive PDO Entries EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 113 Device Profiles – Motivation

EtherCAT Basics Slave Structure • EtherCAT supports complex slaves Physical Layer Device Model (ISO/OSI) • Slaves with multiple channels are common Data Link Layer Frame Structure • Channels consists of Addressing Commands – Process data (Inputs/Outputs) Memory/Registers SyncManager – Configuration FMMU Diagnosis – Diagnosis Application Layer State Machine –… Mailbox Mailbox Interface • Different channels may have different functionality EoE Ethernet CoE CANopen FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool Profile for Modular Devices EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 114 Device Profiles - Overview

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) Data Link Layer Frame Structure Static Device Profile – No. 5001 Dynamic Device Profile – No. 5002 Addressing Commands Fieldbus Master Profile – No. 5002 Memory/Registers Modular Devices with fixed Modular devices with dynamic SyncManager FMMU configuration configuration Diagnosis Application Layer State Machine Mailbox Based on Mailbox Interface EoE Ethernet CoE CANopen FoE File Access Modular Device Profile Framework SoE Servo Drive Slave Information /IF general profile Device Profiles Modular Devices Drives Distributed Clocks Profiles are EtherCAT specific! Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 115 Structuring of Object Dictionary

EtherCAT Basics Slave Structure • Mapping of PDO like simple devices Physical Layer Device Model (ISO/OSI) Data Link Layer Frame Structure • Basic Idea of Mapping SDO is to have Addressing Commands – Several areas with dedicated functions Memory/Registers SyncManager – Each IO Channel can have several objects in this FMMU Diagnosis areas Application Layer State Machine – The number of objects per IO Channel depends Mailbox Mailbox Interface upon implementation EoE Ethernet CoE CANopen – Up to 4096 Channels can be managed by a single FoE File Access slave SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 116 Object Dictionary of Dynamic Device Profile

EtherCAT Basics Slave Structure • 0x0000 – 0x0FFF Data Type Area Physical Layer Device Model (ISO/OSI) • 0x1000 – 0x1FFF: Communication Area Data Link Layer Frame Structure • 0x2000 – 0x5FFF: Manufacturer specific Area Addressing Commands • 0x6000 – 0x6FFF: Input Area Memory/Registers SyncManager • 0x7000 – 0x7FFF: Output Area FMMU Diagnosis • 0x8000 – 0x8FFF: Configuration Area Application Layer State Machine • 0x9000 – 0x9FFF: Information Area Mailbox Mailbox Interface • 0xA000 – 0xAFFF: Diagnosis Area EoE Ethernet CoE CANopen • 0xB000 – 0xBFFF: Service Transfer Area FoE File Access SoE Servo Drive • 0xC000 – 0xEFFF: Reserved Area Slave Information /IF Device Profiles • 0xF000h – 0xFFFF: Device Area Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 117 Example for Dynamic Device Profile

EtherCAT Basics Slave Structure BK1120 + DI 4 + DO 8 + AO 2 Physical Layer BK1120 + DI 4 + DO 8 + AO 2 Device Model (ISO/OSI) Data Link Layer Frame Structure Addressing RxPDO (Output) 0x1600 0x1601 0x1602 Commands Memory/Registers Ouput Entries 0x7000 0x7010:SI 0x7020:SI SyncManager SI0, 1-8 SI0, 1-2 FMMU Diagnosis TxPDO (Input) 0x1A00 0x1A01 0x1A02 Application Layer State Machine Mailbox Input Entries 0x6000:SI 0x6010 0x6020:SI Mailbox Interface SI 0,1-4 SI 0, 1-2 EoE Ethernet CoE CANopen Dig. Input 4 Dig. Output 8 Anal. Output 2 FoE File Access SoE Servo Drive Slave Information /IF EtherCAT Slave BK1120 Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master SI…Subindex (SI0 = number of SIs of this object) Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 118 Fieldbus Gateway Profile

EtherCAT Basics Slave Structure • Gateways from EtherCAT to legacy Fieldbusses like Physical Layer Device Model (ISO/OSI) - CANopen Data Link Layer Frame Structure - Addressing Commands - DeviceNet 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 119 Drive Control - Modes of Operation

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) NC/ PC EtherCAT Drive Data Link Layer Pos. Pos. Velo. Torque Frame Structure M Addressing Gen. control control control Commands t Memory/Registers v SyncManager s FMMU Diagnosis Application Layer NC/ PC EtherCAT Drive State Machine Pos. Pos. Velo. Torque Mailbox M Mailbox Interface Gen. control control control EoE Ethernet t CoE CANopen v FoE File Access s SoE Servo Drive Slave Information /IF Device Profiles Modular Devices NC/ PC EtherCAT Drive Drives Pos. Pos. Velo. Torque M Distributed Clocks Gen. control control control Device Description t Configuration Tool v EtherCAT Master s Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 120 Purpose of Drive Profiles

EtherCAT Basics Slave Structure • Definition of drive specific parameters Physical Layer Device Model (ISO/OSI) • Mapping of the parameters Data Link Layer Frame Structure • State machine of drives Addressing Commands • Synchronization behaviour 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 121 Drive Profile

EtherCAT Basics Slave Structure EtherCAT is Part of the drives standard in Annex A and D Physical Layer Device Model (ISO/OSI) IEC 61800 Parts 1 to 6 Adjustable speed electrical power drive systems IEC TR 62390 Data Link Layer Abstract Device profile guideline Frame Structure models Addressing IEC 61800-7 Generic interface and use of profiles for power drive systems Commands Memory/Registers Generic IEC 61800-7-1 Interface definition SyncManager PDS FMMU interface Annex A: Annex B: Annex C: Annex D: Diagnosis Mapping to Mapping to Mapping to Mapping to Mapping to Application Layer solutions CiA402 CIP PROFIdrive SERCOS State Machine (profiles) Mailbox IEC 61800-7-2 Profile specifications Mailbox Interface EoE Ethernet Annex A: Annex B: Annex C: Annex D: CoE CANopen Profile Profile Profile Profile FoE File Access Drive CiA402 CIP PROFIdrive SERCOS profiles SoE Servo Drive Slave Information /IF IEC 61800-7-3 Mapping of profiles to network technologies Device Profiles Mapping to Modular Devices network Annex A Annex B Annex C Annex D Drives technologies Distributed Clocks Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to SERCOS SERCOS ETHERNET EtherCAT Device Description CANopen EtherCAT Powerlink DeviceNet ControlNet EtherNet/IP PROFIBUS PROFINET I + II III Configuration Tool EtherCAT Master 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 Standards&Implementation interface. Use of the trade name SERCOS interface requires permission of the trade name holder. 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 122 Purpose of Distributed Clocks (DC)

EtherCAT Basics Slave Structure Physical Layer Precise Synchronization (<< 1 µs!) by exact adjustment of Device Model (ISO/OSI) Data Link Layer distributed clocks Frame Structure Addressing S Commands M Memory/Registers ∆t SyncManager IPC FMMU Diagnosis Application Layer State Machine S S Mailbox .. DVI Mailbox Interface EoE Ethernet CoE CANopen FoE File Access SoE Servo Drive SSSSS Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 123 External Clock Synchronization: IEEE 1588

EtherCAT Basics Slave Structure IEEE 1588 Physical Layer Switchport with integrated Grandmaster Device Model (ISO/OSI) Data Link Layer IEEE 1588 Boundary Clock Clock Frame Structure Addressing S Commands M Memory/Registers SyncManager IPC FMMU Diagnosis Application Layer State Machine S Boundary S Mailbox .. DVI Clock Mailbox Interface EoE Ethernet CoE CANopen FoE File Access SoE Servo Drive SSSSS Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 124 Distributed Clocks – Features

EtherCAT Basics Slave Structure • Synchronization of EtherCAT devices Physical Layer Device Model (ISO/OSI) • Definition of a System Time Data Link Layer st Frame Structure – Beginning on January, 1 2000 at 0:00h Addressing Commands – Base unit is 1 ns Memory/Registers – 64 bit value (enough for more than 500 years) SyncManager FMMU – Lower 32 bits spans over 4.2 seconds Diagnosis Application Layer • Normally enough for communication and time State Machine stamping Mailbox Mailbox Interface • Definition of a Reference Clock EoE Ethernet CoE CANopen – One EtherCAT Slave will be used as a Reference Clock FoE File Access SoE Servo Drive – Reference Clock distributes its Clock cyclically Slave Information /IF Device Profiles – Reference Clock adjustable from a “global” Reference Modular Devices Clock – IEEE 1588 Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 125 Distributed Clocks Unit

EtherCAT Basics SPI / µC parallel IRQ Sync1 / Latch1 Slave Structure Digital I/O Sync0 / Latch0 Physical Layer Device Model (ISO/OSI) Data Link Layer Process Data Interface EtherCAT Address Space Frame Structure (PDI) Addressing Commands FMMU n Memory/Registers SyncManager Sync / Latch Unit FMMU Diagnosis SyncMan DC Application Layer Offset State Machine Control Mailbox Mailbox Interface EtherCAT Processing Unit System Time and Auto-Forwarder with Loop Back EoE Ethernet Delay CoE CANopen Distributed Clocks FoE File Access Port 0 Port 1 Port 2 Port 3 SoE Servo Drive EtherCAT Slave Controller (ESC) Trafo

Slave Information /IF RJ45 PHY PHY RJ45

Device Profiles Trafo Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 126 Features of DC Unit within ESC

EtherCAT Basics Slave Structure • Provider for local time signals Physical Layer Device Model (ISO/OSI) – Generation of synchronous local output signals Data Link Layer Frame Structure (SYNC0, SYNC1 Signals) Addressing Commands – Generation of synchronous Interrupts Memory/Registers SyncManager • Synchronous Digital Output updates and Input sampling FMMU Diagnosis • Precise time stamping of input events (Latch unit) 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 127 Features of DC Unit within ESC

EtherCAT Basics Slave Structure • Propagation delay measurement support Physical Layer Device Model (ISO/OSI) – Each EtherCAT slave controller measures the delay Data Link Layer Frame Structure between the two directions of a frame Addressing Commands – Master calculates the propagation delays between all Memory/Registers SyncManager slaves FMMU Diagnosis • Offset compensation to Reference Clock Application Layer State Machine – Offset between local clock and Reference Clock Mailbox Mailbox Interface – Same absolute system time in all devices EoE Ethernet CoE CANopen – Simultaneousness (clear below 100ns difference) in FoE File Access all devices SoE Servo Drive Slave Information /IF • Drift compensation to Reference Clock Device Profiles Modular Devices – DC Control Unit Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 128 Register System Time

EtherCAT Basics Slave Structure • Registers: Physical Layer Device Model (ISO/OSI) – System Time Data Link Layer (0x0910:0x0917, small systems 0x0910:0x0913) Frame Structure Addressing Commands Memory/Registers • System Time SyncManager FMMU – Read access from both sides (EtherCAT and µC) Diagnosis Application Layer – Consistent access from µC State Machine (access to first byte saves an internal copy) Mailbox Mailbox Interface – Consistent access from EtherCAT EoE Ethernet CoE CANopen (within a single frame, internally latched with SOF) FoE File Access – Write access from EtherCAT starts the DC control SoE Servo Drive Slave Information /IF – ARMW command (auto increment read – multiple Device Profiles Modular Devices write) allows to read System Time of the reverence Drives clock and write it to all slave clocks within a single Distributed Clocks Device Description frame Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 129 DC – Propagation Delay Measurement (I)

EtherCAT Basics Slave Structure Physical Layer EtherCAT Node measures time difference between leaving and Device Model (ISO/OSI) Data Link Layer returning frame Frame Structure Addressing Commands Memory/Registers SyncManager FMMU Diagnosis Application Layer EtherCATvom Master Frame 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 130 DC – Propagation Delay Measurement (II)

EtherCAT Basics Slave Structure Physical Layer Propagation delays between any nodes can be computed Device Model (ISO/OSI) Data Link Layer Frame Structure Addressing Commands Memory/Registers SyncManager IPC FMMU Diagnosis Application Layer State Machine Mailbox .. DVI 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 131 Propagation Delay Measurement

EtherCAT Basics Slave Structure • Registers: Physical Layer Device Model (ISO/OSI) – Receive Time Port 0 (0x0900:0x0903) Data Link Layer – Receive Time Port 1 (0x0904:0x0907) Frame Structure Addressing – Receive Time Port 2 (0x0908:0x090B) Commands Memory/Registers – Receive Time Port 3 (0x090C:0x090F) SyncManager – System Time Delay (0x0928:0x092B) FMMU Diagnosis Application Layer State Machine • Write access to Receive Time Port 0 activates latch Mailbox – Latch local time of SOF (Start of Frame) Mailbox Interface EoE Ethernet – At EOF (End of Frame) SOF time is copied to Receive CoE CANopen Time Port X FoE File Access SoE Servo Drive • Receive Time Port X in local clock units (controlled) Slave Information /IF Device Profiles • SOF time of all frames are latched on all ports internally Modular Devices • Master reads all time stamps and calculates the delay times with Drives Distributed Clocks respect to the topology. Device Description • Individual delay time is written to register System Time Delay Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 132 Offset and Drift Compensation

EtherCAT Basics Slave Structure Physical Layer Same System Time in all devices Device Model (ISO/OSI) Data Link Layer Frame Structure Global System Time Individual Addressing e.g. by RTC or IEEE1588 System Time Offset Commands Reference: Jan 1 st 2000 M Memory/Registers ∆t S SyncManager IPC FMMU Diagnosis Application Layer State Machine S S Mailbox .. DVI Mailbox Interface EoE Ethernet CoE CANopen FoE File Access SoE Servo Drive SSSSS Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 133 Offset Compensation

EtherCAT Basics Slave Structure • Registers: Physical Layer Device Model (ISO/OSI) – System Time Offset Data Link Layer Frame Structure (0x0920:0x927, small systems 0x0920:0x0923) Addressing Commands Memory/Registers SyncManager • Difference between the Reference Clock and every slave FMMU Diagnosis device's clock is calculated by the master. Application Layer State Machine • The offset time is written to register System Time Offset Mailbox Mailbox Interface • Each slave calculates its local copy of the System time EoE Ethernet using its local time and the local offset value: CoE CANopen FoE File Access SoE Servo Drive • tLocal copy of System Time = tLocal time + tOffset Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 134 Drift Compensation – DC Control

EtherCAT Basics Slave Structure • Registers: Physical Layer Device Model (ISO/OSI) – System Time Data Link Layer (0x0910:0x0917, small systems 0x0910:0x0913) Frame Structure Addressing – System Time Offset Commands (0x0920:0x927, small systems 0x0920:0x0923) Memory/Registers SyncManager FMMU • ARMW command (auto increment read – multiple write) allows to Diagnosis Application Layer read System Time of the reverence clock and write it to all slave State Machine clocks within a single frame Mailbox Mailbox Interface EoE Ethernet • DC Control CoE CANopen FoE File Access – Write access to System Time compares SoE Servo Drive received Time with local time Slave Information /IF Device Profiles • ∆t = (t + t + t ) - t Modular Devices Local time Offset PropagationDelay Received Time Drives Distributed Clocks – If ( ∆t > 0) then decelerate local clock Device Description else if ( ∆t < 0) accelerate local clock Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 135 System Time Distribution

EtherCAT Basics Slave Structure Start of Frame (SOF) Write to Receive Time Port 0 Physical Layer Device Model (ISO/OSI) Add 9/10/11 Data Link Layer every 10ns Local Local Receive Time Frame Structure Clock Clock @ SOF Port 0-3 Addressing Commands Memory/Registers SyncManager FMMU Diagnosis Time Control Application Layer Loop State Machine Mailbox Write to System System Time Mailbox Interface Time register - + Offset + EoE Ethernet SyncSignal CoE CANopen generation System Time and FoE File Access System Time (local copy) Delay - LatchSignal SoE Servo Drive time stamping Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 136 Initialization of DCs

EtherCAT Basics Slave Structure • Initialization with Propagation Delay compensation Physical Layer 1. Master reads the DL Status register of all slaves and calculates the . Device Model (ISO/OSI) 2. Master sends a broadcast write to Receive Time Port 0 register (at least first byte). All slaves Data Link Layer latch the local time of the first preamble bit of this frame at all ports and at the ECAT Frame Structure Processing Unit. Some ESCs need the EtherCAT network to be free of frames before the Addressing broadcast write is sent. Commands 3. Master waits until the broadcast write frame has returned. Memory/Registers 4. Master reads all Receive Time Port 0-3 registers (depending on the topology and the Receive SyncManager Time ECAT Processing Unit register (0x0918:0x091F) which contains the upper 32 bits of the FMMU receive times. Diagnosis Application Layer 5. Master calculates individual propagation delays and writes them to System Time Delay State Machine registers of the slaves. Possible overruns of the 32 bit Receive Times have to be checked and Mailbox taken into account. Mailbox Interface 6. Master sets System Time Offset register of the Reference Clock so that the Reference Clock is EoE Ethernet bound to the master time. The offset for the Reference Clock is master time minus Receive CoE CANopen Time ECAT Processing Unit (local time) of the Reference Clock. FoE File Access 7. Master calculates System Time offsets for all DC slaves and writes them to the System Time SoE Servo Drive Offset registers. The offset of each slave is Receive Time ECAT Processing Unit from Slave Information /IF Reference Clock minus Receive Time ECAT Processing Unit from each DC slave. Device Profiles 8. For static drift compensation, the master sends many separate ARMW or FRMW drift Modular Devices compensation frames (e.g., 15,000 frames) to distribute the System Time of the Reverence Drives Clock to all DC slaves. Distributed Clocks 9. For dynamic drift compensation, the master sends ARMW or FRMW commands periodically to Device Description distribute the System Time of the Reverence Clock to all DC slaves. The rate of the drift Configuration Tool compensation commands depends on the acceptable maximum deviation. EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 137 SyncSignal Generation

PDI IRQ Latch0 / Latch1 EtherCAT Basics Sync0 / Sync1 Slave Structure • Output of the Sync unit can be used for Physical Layer Sync Unit Device Model (ISO/OSI) – Interrupt generation Latch Unit Data Link Layer – PDI Digital Output Update events DC Frame Structure Control Offset Addressing • Can be mapped to Commands System Time Memory/Registers – AL Event Request Register for Delay SyncManager PDI IRQ Distributed Clocks FMMU Diagnosis – SYNC0 and SYNC1 Application Layer • SyncSignals can be generated at a specific System Time State Machine Mailbox • Four Operation modes are supported: Mailbox Interface EoE Ethernet – Cyclic generation CoE CANopen – Single shot FoE File Access SoE Servo Drive – Cyclic acknowledge Slave Information /IF Device Profiles – Single shot acknowledge Modular Devices • The second SyncSignal (SYNC1) depends on SYNC0, it can be Drives Distributed Clocks generated with a predefined delay after SYNC0 pulses Device Description • Initiated alternatively from the EtherCAT master or slave Configuration Tool EtherCAT Master application side Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 138 Registers for SyncSignal Generation

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) Data Link Layer Register Address Name Description Frame Structure 0x0140[11:10] PDI Control Enable/Disable DC Units (power saving) Addressing 0x0151 Sync/Latch PDI Configuration Configuration of SYNC/LATCH[1:0] pins Commands Memory/Registers 0x0980.0 Cyclic Unit Control Assignment of cyclic function to EtherCAT or SyncManager PDI FMMU 0x0981 Activation Activation of cyclic function and SYNC pins Diagnosis 0x0982:0x0983 Pulse Length of SYNC signals Length of SYNC impulse length Application Layer State Machine 0x098E SYNC0 Status Status of SYNC0 signal Mailbox 0x098F SYNC1Status Status of SYNC1 signal Mailbox Interface 0x0990:0y0997 SYNC0 Start Time Start Time of cyclic operation EoE Ethernet 0x0998:0x099F NEXT SYNC1 Pulse Next Sync1 Pulse CoE CANopen FoE File Access 0x09A:0x09A3 SYNC0 Cycle Time Cycle Time of SYNC0 SoE Servo Drive 0x09A4:0x09A7 SYNC1 Cycle Time Cycle Time of SYNC1 Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 139 SYNC0 Signal Generation modes

EtherCAT Basics Start Time Slave Structure Activation SYNC0 Cycle Time Physical Layer Device Model (ISO/OSI) Cyclic generation Data Link Layer SYNC0 Frame Structure Addressing Single shot Commands SYNC0 Memory/Registers SyncManager FMMU Acknowlege Diagnosis Cyclic Acknowledge mode Application Layer SYNC0 State Machine Mailbox Acknowlege Mailbox Interface Single shot Acknowledge mode EoE Ethernet SYNC0 CoE CANopen FoE File Access SoE Servo Drive Slave Information /IF Pulse Length SYNC0 Cycle Time Device Profiles (0x09A0:0x09A3) Modular Devices of SYNC Signals Drives (0x0982:0x0983) > 0 = 0 Distributed Clocks > 0 Cyclic generation Single Shot Device Description Configuration Tool = 0 Cyclic Acknowledge* Single Shot Acknowledge* EtherCAT Master Standards&Implementation * Acknowledge by reading SYNC status register (0x098E, 0x098F) 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 140 SYNC1 Signal Generation modes

EtherCAT Basics Start Time Slave Structure Physical Layer SYNC1 Cycle Time < SYNC0 Cycle Time SYNC0 Cycle Time

Device Model (ISO/OSI) SYNC0 Data Link Layer SYNC1 Cycle Time Frame Structure Addressing SYNC1 Commands

Memory/Registers SYNC0 Cycle Time SYNC1 Cycle Time = SYNC0 Cycle Time SyncManager SYNC0 FMMU Diagnosis SYNC1 Cycle Time SYNC1 Cycle Time Application Layer SYNC1 State Machine Mailbox SYNC0 Cycle Time Mailbox Interface SYNC1 Cycle Time = 2*SYNC0 Cycle Time EoE Ethernet SYNC0

CoE CANopen SYNC1 Cycle Time SYNC 1 Cycle Time FoE File Access SYNC1 SoE Servo Drive Slave Information /IF SYNC1 Cycle Time > SYNC0 Cycle Time Device Profiles and SYNC0 Cycle Time Modular Devices SYNC1 Cycle Time < 2*SYNC0 Cycle Time Drives SYNC0 Distributed Clocks SYNC1 Cycle Time SYNC1 Cycle Time Device Description SYNC1 Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 141 Latch Functionality

EtherCAT Basics Slave Structure • The Latch Event unit supports time stamping of the system Physical Layer Device Model (ISO/OSI) time with two independent input signals Data Link Layer Frame Structure – LATCH0 and LATCH1 input signals are used Addressing (can be the same pins as for SYNC0 and SYNC1, ESC dependents) Commands Memory/Registers – Time Stamping of SyncManager events is possible SyncManager FMMU • Latch on positive and/or negative edge Diagnosis Application Layer • Single or continuous latch configurable State Machine Mailbox • The Latch Time register (0x09B0:0x09CF) contain the time Mailbox Interface EoE Ethernet stamps CoE CANopen FoE File Access – Acknowledge by reading the Latch Time register. SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 142 Registers for Latch Input Events

EtherCAT Basics Slave Structure Physical Layer Register Address Name Description Device Model (ISO/OSI) Data Link Layer 0x0140[11:10] PDI Control Enable/Disable DC Units (power saving) Frame Structure 0x0151 Sync/Latch PDI Configuration Configuration of SYNC/LATCH[1:0] pins Addressing 0x0980[5:4] Cyclic Unit Control Assignment of cyclic function to EtherCAT or Commands PDI Memory/Registers 0x09A8 Latch0 Control Latch unit configuration for Latch0 SyncManager 0x09A9 Latch1 Control Latch unit configuration for Latch1 FMMU Diagnosis 0x09AE Latch0 Status Latch status of Latch0 Application Layer 0x09AF Latch1 Status Latch status Latch1 State Machine 0x09B0:0x09B7 Latch0 Time Positive Edge Time stamp positive edge Latch0 Mailbox 0x09B8:0x09BF Latch0 Time Negative Edge Time stamp negative edge Latch0 Mailbox Interface EoE Ethernet 0x09C0:0x09C7 Latch1 Time Positive Edge Time stamp positive edge Latch1 CoE CANopen 0x09C8:0x09CF Latch1 Time Negative Edge Time stamp negative edge Latch1 FoE File Access EtherCAT Buffer Change Time stamp for ECAT SyncManager buffer 0x09F0:0x09F3 SoE Servo Drive Event Time change event Slave Information /IF Time stamp for PDI SyncManager buffer start Device Profiles 0x09F8:0x09FB PDI Buffer Start Event Time event Modular Devices Time stamp for PDI SyncManager buffer Drives 0x09FC:0x09FF PDI Buffer Change Event Time Distributed Clocks change event Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 143 Local Synchronization Modes in the Slaves

EtherCAT Basics Slave Structure • Free Run Physical Layer Device Model (ISO/OSI) – Slave’s application is not synchronized to EtherCAT Data Link Layer Frame Structure Addressing Commands • Synchronous with SM Event Memory/Registers SyncManager – Slave’s application is synchronized to the SM2 Event FMMU Diagnosis (if cyclic outputs are transmitted) or the SM3 Event (if Application Layer State Machine only cyclic inputs are transmitted) Mailbox Mailbox Interface EoE Ethernet CoE CANopen • Synchronous with SYNC Event FoE File Access SoE Servo Drive – Slave’s application is synchronized to the SYNC0 or Slave Information /IF SYNC1 Event Device Profiles Modular Devices • Normal Mode Drives Distributed Clocks • Optimized Mode Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 144 Free Run

Local Timer Event Local Timer Event 0x1C32.2 / 0x1C33.2 (Cycle Time)

1C32:5 / 1C33:5 (Min Cycle Time)

1C33:3 (Shift Time)

1C32:3 (Shift Time) 1C33:6 (Min Delay Time) 1C32:6 (Min Delay Time) (Hardware Delay) (Calc + Copy Inputs) (Copy + Calc Outputs) this value could be 0 like described in Normal DC Mode Outputs Valid Input Latch

30.05.2007 EtherCAT Communication 145 Synchronous to SM2/3 event

SM2/3 Event SM2/3 Event 0x1C32.2 / 0x1C33.2 (Cycle Time)

1C32:5 / 1C33:5 (Min Cycle Time)

Frame Frame 1C33:3 (Shift Time)

1C32:3 (Shift Time) 1C33:6 (Min Delay Time) 1C32:6 (Min Delay Time) (Hardware Delay) (Calc + Copy Inputs) (Copy + Calc Outputs) this value could be 0 like described in Normal DC Mode Outputs Valid Input Latch

30.05.2007 EtherCAT Communication 146 Normal DC mode

Sync0 Event Sync0 Event Register 0x9A0-0x9A3 (Cycle Time)

1C32:5 / 1C33:5 (Min Cycle Time)

Frame Frame 1C33:3 (Shift Time)

1C32:3 (Shift Time) 1C33:6 (Min Delay Time) (Hardware Delay) (Calc + Copy Inputs)

1C32:6 (Min Delay Time) Outputs Valid Input Latch (Copy + Calc Outputs) = 0

30.05.2007 EtherCAT Communication 147 Optimized DC mode

SM2/3 Event Sync0 Event SM2/3 Event Sync0 Event Register 0x9A0-0x9A3 (Cycle Time)

1C32:5 / 1C33:5 (Min Cycle Time)

Frame Frame 1C33:3 (Shift Time)

1C32:3 (Shift Time) 1C33:6 (Min Delay Time) 1C32:6 (Min Delay Time) (Hardware Delay) (Calc + Copy Inputs) (Copy + Calc Outputs) != 0

Outputs Valid Input Latch

30.05.2007 EtherCAT Communication 148 Device Description Overview

EtherCAT Basics Slave Structure • Device Description File in XML format Physical Layer Device Model (ISO/OSI) • One file suitable for a set of devices (from one Vendor) Data Link Layer Frame Structure Addressing • File contains information about: Commands Memory/Registers – Vendor SyncManager • Vendor ID, Name, Logo, … FMMU Diagnosis – Device groups Application Layer State Machine • Organization units to help configuration tools Mailbox – Device Mailbox Interface EoE Ethernet • Device Identity, Name, PDI type CoE CANopen FoE File Access – PDO Mapping SoE Servo Drive – FMMU / SyncManager Slave Information /IF Device Profiles • number and usage Modular Devices Drives Distributed Clocks • Schema is defined in “EtherCATInfo.xsd” Device Description Configuration Tool • Can be viewed with Browser, Text Editor or XML Editors EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 149 General Structure

EtherCAT Basics ID Slave Structure Physical Layer Name Device Model (ISO/OSI) Vendor Comment Data Link Layer Type Frame Structure Image Name Addressing Commands Vendor Spec Group Type Memory/Registers EtherCATInfo.xsd SyncManager Profile FMMU Fmmu Diagnosis Groups Application Layer Sm State Machine Su Mailbox Description Mailbox Interface RxPdo EoE Ethernet Devices TxPdo CoE CANopen FoE File Access Mailbox SoE Servo Drive Slave Information /IF Dc Device Profiles Modules Modular Devices Drives ESC Distributed Clocks Eeprom Device Description mantadory Configuration Tool Vendor Spec EtherCAT Master optional Standards&Implementation …. 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 150 Attributes Vendor, Groupes, Devices

EtherCAT Basics ID Type Slave Structure Name Vendor Name • Vendor Comment Physical Layer Groupe Type Device Model (ISO/OSI) Image Profile – vendor ID, vendor name EtherCATInfo.xsd Vendor Spec Fmmu Data Link Layer Sm Frame Structure – Bitmap image and information text Groups Su Addressing Description RxPdo TxPdo Commands Devices Mailbox Memory/Registers • Groups Dc SyncManager Modules FMMU – Device groups help configuration tool to sort the ESC ESC Diagnosis devices. Eeprom Application Layer Vendor Spec State Machine – Configuration tool may use three levels to sort …. Mailbox Mailbox Interface devices: vendor, group and device. EoE Ethernet CoE CANopen – At least one device group must be provided, each FoE File Access SoE Servo Drive device is assigned to one group Slave Information /IF Device Profiles • Devices Modular Devices – Device description shall contain Type, Name and Group Drives Distributed Clocks Type Device Description Configuration Tool – FMMU, SM, PDO, Mailbox and Eeprom are EtherCAT Master recommended Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 151 Attributes Profile

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) • Profile Data Link Layer Frame Structure – Profile Information Addressing Commands – Object Dictionary Memory/Registers SyncManager – Same Structure for CoE and SoE Dictionaries FMMU Diagnosis Application Layer State Machine • Separation of Object and Data Type descriptions Mailbox Mailbox Interface – Flat list of Objects EoE Ethernet CoE CANopen – All Objects derived from a Data Type FoE File Access SoE Servo Drive – ARRAY, RECORD (CoE) and Variable Data (SoE) Slave Information /IF Device Profiles defined as Data Types Modular Devices Drives – Data Type describes the complete data of an object Distributed Clocks Device Description exactly as for a “Complete Access” download or upload Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 152 Data Types and Objects

EtherCAT Basics Element „Profile“ Slave Structure Physical Layer Device Model (ISO/OSI) Element „Data Type“ Data Link Layer Frame Structure Addressing Commands Data Type Memory/Registers „STRING(20)“ SyncManager FMMU Diagnosis Application Layer State Machine Mailbox Mailbox Interface EoE Ethernet CoE CANopen Element „Object“ FoE File Access SoE Servo Drive Slave Information /IF Object „Device Name“ Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 153 XML and EEPROM

EtherCAT Basics Slave Structure Physical Layer Configuration Tool generates binary file from device Device Model (ISO/OSI) description to update EEPROM on slave Data Link Layer Frame Structure Addressing Commands Memory/Registers XML SyncManager FMMU Config Diagnosis Application Layer Tool State Machine Mailbox Mailbox Interface EoE Ethernet CoE CANopen FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Modular Devices 0110010001010… (*.bin) Drives EEPROM Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 154 EtherCAT Configuration Tool

EtherCAT Basics Slave Structure • Configure EtherCAT Slave devices Physical Layer Device Model (ISO/OSI) – Evaluate XML device description Data Link Layer Frame Structure – Evaluate EEPROM information – if online Addressing Commands • Generate network initialization commands Memory/Registers SyncManager – Information for the EtherCAT driver FMMU Diagnosis – Initialization commands correspond to State Machine Application Layer State Machine transitions Mailbox Mailbox Interface • Generates cyclic commands EoE Ethernet CoE CANopen – Information for the EtherCAT driver FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 155 Network Configuration

EtherCAT Basics Device Descriptions Slave Structure (XML) Physical Layer Device Model (ISO/OSI) Data Link Layer Frame Structure Addressing EtherCAT Commands Configuration Tool Memory/Registers SyncManager (Offline) FMMU Diagnosis Application Layer State Machine Configuration Configuration Mailbox Information (XML) XML Information (binary) Mailbox Interface General Exchange File Vendor specific EoE Ethernet Format CoE CANopen Format FoE File Access SoE Servo Drive Slave Information /IF EtherCAT Device Profiles E2PROM Modular Devices Master Driver Information Drives (Online) Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 156 EtherCAT Configuration Exchange Format

EtherCAT Basics Slave Structure • Vendor and Driver independent format Physical Layer Device Model (ISO/OSI) • Master Vendor must not imperatively develop an own Data Link Layer Frame Structure Configuration Tool Addressing Commands • Contains Memory/Registers SyncManager – initialization commands – per slave device FMMU Diagnosis – cyclic process data commands Application Layer State Machine – information about the mailboxes 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 157 EtherCAT Master

EtherCAT Basics Slave Structure • Configuration with help of an EtherCAT configuration XML Physical Layer Device Model (ISO/OSI) file Data Link Layer Frame Structure • Send and receive raw Ethernet frames from a network Addressing Commands adapter Memory/Registers SyncManager • Management of the EtherCAT slaves FMMU Diagnosis – Sending init commands defined in the XML file Application Layer State Machine • Mailbox Communication Mailbox Mailbox Interface – CANopen over EtherCAT protocol (CoE) EoE Ethernet CoE CANopen – Servo-Profile over EtherCAT protocol (SoE) FoE File Access SoE Servo Drive – Ethernet over EtherCAT protocol (EoE) Slave Information /IF Device Profiles – Filetransfer over EtherCAT protocol (FoE) Modular Devices Drives • Software-integrated switch functionality Distributed Clocks Device Description • Cyclic process data communication Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 158 What does an EtherCAT Master do?

EtherCAT Basics Slave Structure • Parse XML Hardware configuration file (initialization, state Physical Layer Device Model (ISO/OSI) machine, and process data mapping) Data Link Layer Frame Structure • Initialization of Fieldbus Addressing Commands • Runs State Machine Memory/Registers SyncManager • Interface to application FMMU Diagnosis • Interface to network driver Application Layer State Machine • Sends cyclic process data commands Mailbox Mailbox Interface • Sends mailbox commands EoE Ethernet CoE CANopen • Handles various protocols FoE File Access SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 159 EtherCAT Master Block Diagram

EtherCAT Basics Slave Structure Control Task Physical Layer Device Model (ISO/OSI) Data Link Layer Frame Structure Addressing Process Image Commands (XML) Memory/Registers SyncManager Network Description System FMMU Initialization Commands Configuration Diagnosis Process Image Tool XML Parser Application Layer XML State Machine Mailbox HDR Process Data Mailbox Interface HW Config EoE Ethernet Device Description Init Cmds CoE CANopen FoE File Access XML Online functions SoE Servo Drive Slave Information /IF EtherCAT Master Driver Device Profiles Modular Devices Drives EtherCAT Master Distributed Clocks Device Description Configuration Tool Standard Ethernet MAC EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 160 Prerequisites for EtherCAT Master (Real Time)

EtherCAT Basics Slave Structure • Hardware Physical Layer Device Model (ISO/OSI) • Standard network controller using DMA Data Link Layer Frame Structure – NO special plug in card needed Addressing Commands – Speed and Quality important Memory/Registers SyncManager • No switches or hubs required FMMU Diagnosis • Cache design, CPU Application Layer State Machine • Low jitter, x86 Dual Xeon < 2 µs Mailbox Mailbox Interface EoE Ethernet CoE CANopen • Software FoE File Access SoE Servo Drive • Realtime kernel Slave Information /IF Device Profiles • Configuration tool Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 161 EtherCAT Master Development (Real Time)

EtherCAT Basics Slave Structure 1. XML Parser functionality Physical Layer Device Model (ISO/OSI) 2. EtherCAT Master driver Data Link Layer Frame Structure – Interface to configuration tool Addressing Commands – State machine Memory/Registers necessary SyncManager – Interface to application FMMU Diagnosis – Interface to network card Application Layer State Machine – NIC Timing Interface Mailbox Mailbox Interface 3. Real Time Kernel EoE Ethernet CoE CANopen FoE File Access SoE Servo Drive 4. Hardware Configuration Tool Slave Information /IF Device Profiles – 3.rd party configuration tools can be used Modular Devices optional Drives as the configuration is provided to Distributed Clocks Device Description EtherCAT master in a common format Configuration Tool (XML) EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 162 Master Sample Code Structure

EtherCAT Basics Slave Structure Physical Layer Device Model (ISO/OSI) Data Link Layer XML Frame Structure EtherCAT File Parser Appl. Addressing Configuration Commands Tool Memory/Registers Process Image SyncManager FMMU EtherCAT Diagnosis Online Functions Master Driver (Sample) Application Layer State Machine Mailbox Ethernet Frames Mailbox Interface EoE Ethernet CoE CANopen TCP/IP NPF (based) FoE File Access SoE Servo Drive Protocol Driver Protocol Driver Slave Information /IF Device Profiles Modular Devices NDIS Drives Distributed Clocks Device Description Miniport Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 163 Master Sample Code Overview

EtherCAT Basics Slave Structure • Sample EtherCAT Master Communication Software Physical Layer Device Model (ISO/OSI) (including Source Code) Data Link Layer Frame Structure – Non Real Time Addressing Commands – Realized as Windows Application Program Memory/Registers SyncManager (MS Windows XP/2000) FMMU Diagnosis – Source Code MS C++ 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 164 Standards and References

EtherCAT Basics Slave Structure • Specification of EtherCAT has been done in the EtherCAT Physical Layer Device Model (ISO/OSI) Technology Group (ETG) Data Link Layer Frame Structure Addressing Commands • Specifications available at www.EtherCAT.org Memory/Registers SyncManager – XML File Style sheet FMMU Diagnosis – Datasheets of ESC, ... Application Layer State Machine – Modular Device Profile Mailbox Mailbox Interface – Reports of ETG TC meetings EoE Ethernet CoE CANopen FoE File Access SoE Servo Drive • International standardization efforts Slave Information /IF Device Profiles Modular Devices Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 165 Standards and References

EtherCAT Basics Slave Structure •EtherCAT is part of different international Physical Layer Device Model (ISO/OSI) standardization efforts Data Link Layer Frame Structure Standard Title Status Remarks Addressing Commands IEC/PAS Real Time Ethernet control automation PAS Memory/Registers 62407 technology (ETHERCAT) SyncManager IEC 61158 Digital data communication for measurement Type 12: FMMU and control – Fieldbus for use in industrial EtherCAT Specification Diagnosis control systems Application Layer State Machine Part 1: Overview and guidance CDV Mailbox Part 2: Physical Layer service definition and CDV Mailbox Interface protocol specification EoE Ethernet CoE CANopen Part 3: Data Link Layer service definition CDV FoE File Access Part 4: Data Link Layer protocol specification CDV SoE Servo Drive Slave Information /IF Part 5: Application Layer service definition CDV Device Profiles Part 6: Application Layer protocol CDV Modular Devices specification Drives Distributed Clocks Device Description Configuration Tool EtherCAT Master PAS : Public available standard CDV : Committee draft for vote Standards&Implementation CDV : Committee draft for vote 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 166 Standards and References

EtherCAT Basics Slave Structure Standard Title Status Remarks Physical Layer IEC 61784 Digital data communication for measurement Device Model (ISO/OSI) and control Data Link Layer Frame Structure Part 1: Profile sets for continuous and discrete CDV Addressing manufacturing relative to fieldbus use in Ed2.0 Commands industrial control systems Memory/Registers Part 2: Additional profiles for ISO/IEC 8802-3 CDV CPF12: EtherCAT SyncManager based communication networks in real-time Ed1.0 FMMU applications Diagnosis Application Layer IEC 61800 Adjustable speed electrical power drive State Machine systems Mailbox Part 7-1: Generic interface and use of profiles CDV Part 7: Mailbox Interface for power drive systems – Interface definition Drive Profiles EoE Ethernet CoE CANopen Part 7-2: Generic interface and use of profiles CDV FoE File Access for power drive systems – Profile specifications SoE Servo Drive Part 7-3: Generic interface and use of profiles CDV Mapping Slave Information /IF for power drive systems – Mapping of profiles EtherCAT to Device Profiles to network technologies CANopen DS402 Modular Devices and SERCOS Drives Distributed Clocks Device Description Configuration Tool CPF : Communication profile EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 167 Standards and References

EtherCAT Basics Slave Structure Standard Title Status Remarks Physical Layer ISO 15745 Industrial automation systems and integration - Ed 1 CANopen Device Model (ISO/OSI) - Open systems application integration Data Link Layer framework Frame Structure Addressing Part 4 Amd 2: Profiles for TCP, PRF Amd Mapping Commands EtherCAT and EtherCAT to Memory/Registers CANopen DS301 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 PRF Amd : : Proof of a new International Standard, Amendment EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 168 IEC 61158

EtherCAT Basics Slave Structure • Digital data communication for measurement and control – Physical Layer Device Model (ISO/OSI) Fieldbus for use in industrial control systems Data Link Layer Frame Structure Addressing Commands • The communication standard Memory/Registers SyncManager FMMU Diagnosis • EtherCAT is named Type 12 in IEC 61158 Application Layer State Machine (no brand names allowed) Mailbox Mailbox Interface • Transformation of the to a EoE Ethernet common model 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 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 169 IEC 61158 – DL/AL services and protocols

EtherCAT Basics Slave Structure Physical Layer Users Implementers Device Model (ISO/OSI) Data Link Layer Frame Structure Addressing AL Services AL Protocol Commands Part 5 in IEC 61158 Part 6 in IEC 61158 Memory/Registers SyncManager • Model and Concepts • Syntax definition and Coding FMMU • Data type definitions • Application Relationship Diagnosis • Application Objects Procedures • State Machines Application Layer • Service description State Machine • Communication Management Mailbox Mailbox Interface EoE Ethernet CoE CANopen FoE File Access DL Services DL Protocol SoE Servo Drive Part 3 in IEC 61158 Part 4 in IEC 61158 Slave Information /IF • Model and Concepts • Coding Device Profiles • Service description • Medium Access Modular Devices • Register Description • State Machines Drives (DL objects) Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 170 IEC 61800-7

EtherCAT Basics Slave Structure EtherCAT is Part of the drives standard in Annex A and D Physical Layer Device Model (ISO/OSI) IEC 61800 Parts 1 to 6 Adjustable speed electrical power drive systems IEC TR 62390 Data Link Layer Abstract Device profile guideline Frame Structure models Addressing IEC 61800-7 Generic interface and use of profiles for power drive systems Commands Memory/Registers Generic IEC 61800-7-1 Interface definition SyncManager PDS FMMU interface Annex A: Annex B: Annex C: Annex D: Diagnosis Mapping to Mapping to Mapping to Mapping to Mapping to Application Layer solutions CiA402 CIP PROFIdrive SERCOS State Machine (profiles) Mailbox IEC 61800-7-2 Profile specifications Mailbox Interface EoE Ethernet Annex A: Annex B: Annex C: Annex D: CoE CANopen Profile Profile Profile Profile FoE File Access Drive CiA402 CIP PROFIdriv SERCOS profiles e SoE Servo Drive Slave Information /IF IEC 61800-7-3 Mapping of profiles to network technologies Device Profiles Mapping to Modular Devices network Annex A Annex B Annex C Annex D Drives technologies Distributed Clocks Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to Mapping to SERCOS SERCOS ETHERNET EtherCAT Device Description CANopen EtherCAT Powerlink DeviceNet ControlNet EtherNet/IP PROFIBUS PROFINET I + II III Configuration Tool EtherCAT Master 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 Standards&Implementation interface. Use of the trade name SERCOS interface requires permission of the trade name holder. 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 171 ESC Overview

EtherCAT Basics Slave Structure • Available ESCs: Physical Layer Device Model (ISO/OSI) – FPGA Data Link Layer Frame Structure – IP Core Addressing Commands – ASIC Memory/Registers SyncManager • Criteria: FMMU Diagnosis – Features: Application Layer State Machine • Number/Type of Ports (MII, EBUS) Mailbox Mailbox Interface • PDI Type (functionality, speed) EoE Ethernet CoE CANopen • RAM FoE File Access SoE Servo Drive • DCs, Number of SyncManager, FMMUs Slave Information /IF Device Profiles •… Modular Devices Drives • Needed Quantity, Flexibility in relation to price Distributed Clocks Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 172 Step by Step Implementation

EtherCAT Basics Slave Structure • Step 1: Physical Layer Device Model (ISO/OSI) • Slave Evaluation Kit Workshop Data Link Layer Frame Structure Addressing Step 2: Commands Memory/Registers Setup of a small EtherCAT System SyncManager with Master, I/O and Evaluation FMMU Diagnosis Board. Application Layer State Machine Mailbox Step 3: Mailbox Interface Build Lab wiring between Evaluation EoE Ethernet CoE CANopen Kit and Standard-Hardware (e.g.) FoE File Access with 16Bit Microcontroller SoE Servo Drive Slave Information /IF Device Profiles Modular Devices Step 4: Drives Distributed Clocks Start SW-Project with Slave Sample Device Description µC Code Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 173 Step by Step Implementation

EtherCAT Basics Slave Structure • Step 5: Physical Layer Device Model (ISO/OSI) EtherCAT Slave • Download Slave Sample Code in Data Link Layer Target Hardware and set System Frame Structure Application Software Addressing into Operation Commands ecatappl Memory/Registers SyncManager foeappl FMMU coeappl Step 6: Diagnosis

Application Layer emcy Test implementation for PDO- und State Machine Mailbox-Transfer Mailbox ecatfoe Mailbox Interface ecatcoe EtherCAT Hardware-Design EoE Ethernet Slave Sample Code Sample Slave ecatslv mailbox CoE CANopen FoE File Access SoE Servo Drive mcihw Step 7: Slave Information /IF Device Profiles Software-Design with EtherCAT Modular Devices EtherCAT Drives Slave Slave Sample Code for existing Controller Distributed Clocks Fieldbus SW-Architecture Device Description Configuration Tool EtherCAT Master Standards&Implementation 30.05.2007 EtherCAT Communication © Copyright by Beckhoff, 2007 174