EtherCAT® Protocol Library


The EtherCAT Library® provides all required services for a compliant communication according to the CAN application layer over EtherCAT (CoE). It facilitates easy and fast development of EtherCAT® Slave devices. The functional range can be extended by additional modules. Access to the hardware is carried out via a hardware abstraction layer. These drivers are available for selected hardware, including port’s FPGA solution, which is available for Altera Nios® II and Xilinx MicroBlaze™. The FPGA solution can also be used for other Industrial Ethernet Protocols, e.g. Ethernet POWERLINK, EtherNet/IP and PROFINET. An uniform user interface makes it easy to implement different protocols.


The EtherCAT Library® is based on ground of CAN application layer over EtherCAT (CoE). It provides the most importand services specified therein.

It is completely written in ANSI-C and can be compiled with every ANSI-C compliant compiler.

With the standard version of the EtherCAT Library® all services are provided for development of full-featured EtherCAT® Slave devices

Additional services (e.g. FoE - File Access over EtherCAT, EoE - Ethernet over EtherCAT) are provided by means of extension modules.

All hardware specific parts are decoupled from the EtherCAT Library® protocol stack through a defined driver interface. This provides easy adaptation to different hardware platforms.

The user application communicates with the EtherCAT Library® through function calls and call-back functions. Configuration and scaling of the EtherCAT Library® is done with the help of the EtherCAT® Design Tool, which is delivered as EtherCAT® Design Tool light version for free. Use this tool to tailor the EtherCAT Library® optimally for available application resources. Besides the creation of the object directory all settings for the hardware can be done in an easy manner with it.


The EtherCAT Library® consists of a hardware independent and a hardware dependent part that communicate with message queues. The hardware dependent part consists of controlling software for the EtherCAT® driver and timer functions.

The application communicates only with the hardware independent part of the EtherCAT Library®. That way it is possible to exchange drivers without any influence on the functionality of the application. The initialization of EtherCAT® services is done with function calls within the application. During the execution of the application the EtherCAT Library® executes all necessary communication tasks autonomously and informs the application about successful received EtherCAT® messages with the help of callback functions.

The EtherCAT library from port supports the "Distributed-Clocks" functionality. This provides an identical clock time for all EtherCAT devices in the network.Communication requests from other devices as well

necessary periodical tasks and time out monitoring is handled within the EtherCAT Library®. All requests are proved for correctness (access rights, data types etc.). The application is notified after completion of the communication and occurrence of failures, respectively, through service oriented callback functions. In these callback functions appropriate actions can be carried out by the application.

The object directory is designed to contain references to the variables in the user application. Consequently it is possible to take over variables from an existing software without any changes in the object dictionary. The high degree of scalability of the EtherCAT Library® is of particular importance for devices with limited resources. On one hand, this is achieved by the modularity in individual service groups, and on the other hand, through the use of compiler directives in the respective modules. Thus, the code size is proportional to the utilized EtherCAT® services.

Delivery of the EtherCAT Library® comprises different example programs that describe the usage of the various EtherCAT Library® services. All examples contain a complete implementation of a EtherCAT Library® device including the object directory as well as application code. These are ready to be compiled and run.

The source code is documented in detail. And there are a reference manual and a printed user manual.

The EtherCAT Library® is constantly improved and adopted to customer requirements. In order to keep up with the latest version of the EtherCAT Library® port provides its customers an update service.

For development, test and initial operation of EtherCAT® devices port provides a comprehensive tool chain. The creation of the object directory is simplified with the EtherCAT® Design Tool (EtherCAT® Design Tool Light version belongs to the scope of delivery).

The EtherCAT® Design Tool is available for the creation of the object directory, the electronic data sheet (EDS file in XML format) and for the documentation of the device in HTML or text format.

Besides the communication objects several application objects in different device profiles are also specified in EtherCAT®. These definitions guarantee a defined behavior of the corresponding device class and enable the interchangeability of EtherCAT® devices. Device profiles can be easily created by use of the EtherCAT® Design Tool.