The esd electronics EtherCAT Slave Stack offers an easy-to-use API which supports building complex EtherCAT Slave applications and devices. It is available as a compiled library or as source code (ANSI-C).
Easy and Fast EtherCAT Slave Device Development
- The source code is developed in ANSI-C, optimized for embedded targets with respect to performance and resource usage.
- An API-based programming interface provides a clear separation between application and stack which makes follow-up modifications to an updated stack revision or different hardware an easy task.
- The software also supports a dynamic object dictionary, which can be modified during runtime.
Services for EtherCAT Compliant Communication acc. to IEC and Mailbox Protocols Supported
- In combination with an EtherCAT Slave Controller (ECS) all services for an EtherCAT compliant communication are provided according to IEC 61158/ETG.1000.
- Support for CoE, EoE, FoE, and VoE mailbox protocols.
Easily Operated Application Programming
- All protocol complexity and hardware dependency is hidden: The developer can concentrate on application development which significantly reduces the time to market.
- The API supports multiple ESC by one application.
- Source code version is based on a well-defined Hardware Abstraction Layer (HAL) to adapt the stack to the target hardware with as little effort as possible.
EtherCAT - Ethernet for Control Automation Technology
EtherCAT - Ethernet for Control Automation Technology - is an open high performance Ethernet-based fieldbus system. The development goal of EtherCAT was to apply Ethernet to automation applications which require short data update times (also called cycle times) with low communication jitter (for synchronization purposes) and low hardware costs.
Typical automation networks are characterized by short data length per node, typically less than the minimum payload of an Ethernet frame. Using one frame per node per cycle therefore leads to low bandwidth utilization and thus to poor overall network performance. EtherCAT therefore takes a different approach, called "processing on the fly".
With EtherCAT, the Ethernet packet or frame is no longer received, then interpreted and copied as process data at every node. The EtherCAT slave devices read the data addressed to them while the telegram passes through the device. Similarly, input data are inserted while the telegram passes through. The frames are only delayed by a fraction of a microsecond in each node, and many nodes - typically the entire network - can be addressed with just one frame.
The EtherCAT protocol is optimized for process data and is transported directly within the standard IEEE 802.3 Ethernet frame using Ethertype 0x88a4. It may consist of several sub-telegrams, each serving a particular memory area of the logical process images that can be up to 4 gigabytes in size. The data sequence is independent of the physical order of the nodes in the network; addressing can be in any order. Broadcast, multicast and communication between slaves are possible and must be done by the master device. If IP routing is required, the EtherCAT protocol can be inserted into UDP/IP datagrams. This also enables any control with Ethernet protocol stack to address EtherCAT systems.
Using full-duplex Ethernet physical layers, the EtherCAT slave controllers close an open port automatically and return the Ethernet frame if no downstream device is detected. Slave devices may have two or more ports. Due to these features EtherCAT can support almost any physical topology such as line, tree or star. The bus or line structure known from the fieldbusses thus also becomes available for Ethernet. Also possible is the combination of line and branches or stubs: any EtherCAT device with three or more ports can act as junction, no additional switches are required. The classic switch-based Ethernet star topology can be used either with switches configured to forward traffic directly between ports, or with special slave devices: the switches are then located between the network master and the slave devices. The special slave device (remember standard slave devices don't have a MAC address) assembly attached to one switch port together forms an EtherCAT segment, which is either addressed via its MAC address or via port based VLANs. Since 100BASE-TX Ethernet physical layer is used, the distance between any two nodes can be up to 100 m (300 ft). Up to 65535 devices can be connected per segment. If an EtherCAT network is wired in ring configuration (requires two ports on the master device), it can provide cable redundancy.
For synchronization a distributed clock mechanism is applied, which leads to very low jitters of significantly less than 1 µs even if the communication cycle jitters, which is equivalent to the IEEE 1588 Precision Time Protocol standard. Therefore EtherCAT does not require a special hardware in the master device and can be implemented in software on any standard Ethernet MAC, even without dedicated communication coprocessor.
The typical process of establishing a distributed clock is initiated by the master by sending a broadcast to all slaves to a certain address. Upon reception of this message, all slaves will latch the value of their internal clock twice, once when the message is received and once when it returns (remember EtherCAT has a ring topology). The master can then read all latched values and calculate the delay for each slave. This process can be repeated as many times as required to reduce jitter and average out values. Total delays are calculated for each slave depending on their position in the slave-ring and will be uploaded to an offset register. Finally the master issues a broadcast read/write on the system clock, which will make the first slave the reference clock and forcing all other slaves to set their internal clock appropriately with the now known offset.
To keep the clocks synchronized after initialization, the master or slave must regularly send out the broadcast again to counter any effects of speed difference between the internal clocks of each slave. Each slave should adjust the speed of their internal clock or implement an internal correction mechanism whenever they have to adjust.
The system clock is specified as a 64 bit counter with a base unit of 1 ns starting at January 1, 2000, 0:00.
The device profiles describe the application parameters and the functional behaviour of the devices including the device class-specific state machines. For many device classes, fieldbus technology already offers reliable device profiles, for example for I/O devices, drives or valves. EtherCAT supports both the CANopen device profile family as well as the drive profile known as the SERCOS drive profile. Since the application view does not change when migrating from CANopen or SERCOS, this assists users and device manufacturers alike.