Skip to main content

General

The configuration of EtherCAT modules is based on the device description files for the used master and slave devices and can be adapted in the project in configuration dialogs. In order to make sure that the simplest and most error-free use possible, we recommend for standard applications that you enable the option for the Automatic Configuration of the master so that the majority of the configuration settings are done automatically.

Requirements

The Npcap driver is required when using EtherCAT devices with a CODESYS Control Win. The Npcap software is included in the Wireshark setup, for example. After installing the driver or inserting a USB network adapter, Windows needs to be restarted so that the adapters can be selected.

Important

This note is valid only for CODESYS versions through SP18.

Install the WinPCap software.

By default, Npcap is also installed with the Wireshark installation. You need to disable this option in the Wireshark setup because Npcap must not be installed on the system.

When using CODESYS Control RTE, WinPCap or Npcap is not required. You have to replace the default network driver in the Windows Device Manager with a special CODESYS driver. For more details, see the help for the CODESYS Control RTE runtime.

You also have to enable the respective runtime components in the file CODESYSControl_User.cfg.

  • Component.<subsequent number>=CmpEt100Drv

    Available for Intel Pro 100

  • Component.<subsequent number>=CmpEt1000Drv

    Available for Intel Pro 1000

  • Component.<subsequent number>=CmpRTL81x9Mpd

    Available for RTL8139.

  • Component.<subsequent number>=CmpRTL8169Mpd

    Available for Realtek RTL8169 or RTL8168 (PCIe version))

Tip

You can also enable the runtime components in the configuration dialog of the CODESYS Control RTE.

For more information, see: CODESYS Control RTE V3

EtherCAT Device Tree

EtherCAT Topology

In addition to the line and tree topology, CODESYS also supports the EtherCAT star topology. Special EtherCAT branches (a 2-port EtherCAT junction in the example) are required for the configuration of an EtherCAT star topology. A modular EtherCAT star can be created by using of multiple branches. As a result, individual devices or complete EtherCAT lines can be connected with the branches. An EtherCAT branch is identified by the _ecad_icon_junction.png sign.

_ecat_ethercat_topo.png

Optional devices

The Optional devices function can be used for variable hardware configurations. At the start of the stack, the system checks whether optional devices are available. If the devices are not found, then they are deactivated automatically. However, the devices can also be activated at a later date if, for example, it is a device at the end of the network line. On the other hand, if the Automatically restart slaves option is selected, then the activated devices are automatically switched to "operational", thereby activating the process data.

Tip

The bus cycle task is set in the general PLC settings.

Access to the EtherCAT configuration by the application takes place via instances of the EtherCAT Master and the EtherCAT Slaves. When the EtherCAT Master or the EtherCAT Slaves are inserted as objects into a project, instances are created automatically for the master and slaves which can be addressed in the application program. For example, a restart, a stop, or a status check of the EtherCAT device can be performed from the application.

The library IODrvEtherCAT provides function blocks for reading and writing individual parameters, even during bus operation. An example for the writing and reading of SDOs with CAN via EtherCAT is provided in CODESYS Forge.