Add a device

Add an EtherCAT device to your application’s bus with the ECAT tool, using a digital I/O module as the example.

Your application talks to its drives and I/O modules over EtherCAT. This page walks you through adding one device to the application’s EtherCAT configuration with the ECAT tool. The example is a Beckhoff EP2316-0003 digital I/O module, added in a domainA domain is a group of EtherCAT devices whose data Motorcortex exchanges together. Each domain can be simulated or switched off on its own. of its own next to the devices the application already has. Click a domain for more.

Before you start

  • An application is deployed and running on the controller: see Deploy an application.
  • You have an EtherCAT device and a controller with an EtherCAT port: a Generic Control Case (GCC), an industrial PC or a Raspberry Pi. A virtual machine has no EtherCAT port to connect a device to.

Connect the device’s EtherCAT input to the controller’s EtherCAT port, or to the last device already on the bus. On a GCC, your PC goes into the ENET port and the EtherCAT cable into ECAT1.

Open the ECAT tool and connect

The ECAT tool runs in your browser and reads and writes the EtherCAT configuration on the controller, so it needs a connection first.

  1. Log in to motorcortex.io with your Email and Password, and press Log in. No account yet? Register first.

  2. In the sidebar, under Tools, click Ecat. The ECAT tool opens in a new browser tab.

  3. Open the main menu ( ) at the top left and choose Connection.

    ECAT tool main menu, opened from the gear button at the top left, with Connection at the top of the list
  4. In Host, enter controller_ip_addressThe IP address of your controller. In most cases 192.168.2.100.. Leave TLS on and the Request and Receive ports as they are, unless your controller was set up with other ports. Fill in Username and Password only if your controller asks for a log-in.

    Connection dialog: host 192.168.2.100 with TLS switched on, Request port 5568, Receive port 5567, empty username and password, and the Confirm button
  5. Press Confirm.

Fetch the current configuration

Start from the configuration the controller runs now, so you add to it instead of replacing it.

  1. Press Fetch at the top right. The Domains list on the left fills with the domains and devices of the configuration on the controller.

  2. Check the GCC domain. It holds the safety I/O of the Generic Control Case: the EK1914 and the EL6910. On a GCC, keep it as it is. On any other controller these devices are not on your bus: switch the domain off with its checkbox ( , Include in Ethercat Message). Leave the other domains as they are.

Add a domain and the device

Your own devices go into a domain of their own. That way you can simulate them or switch them off without touching the rest of the bus.

  1. Press (Add Domain) next to Domains.

    ECAT tool after Fetch: the Domains list with domain GCC and its devices EK1914-01 and EL6910-01, and the plus button next to Domains
  2. Click the new domain, which is called Untitled, and give it a Name such as IO. Leave Simulation off: this domain talks to a real device.

  3. In the new domain, press (Add Devices) next to Devices.

  4. On the From Scan tab, press Scan Bus. The list shows every device on the bus, by its position.

    Add Devices dialog, From Scan tab, after a bus scan: EK1914 at position 0, EL6910 at position 1, EK1110 at position 2, and the EP2316-0003 at position 3, which is ticked
  5. Tick only your new module. The devices before it, on a GCC the EK1914, the EL6910 and the EK1110 extension, belong to the existing setup; leave them unticked.

Load the device description

The scan tells the tool which device it found, but not which data the device exchanges. That is in the device’s ESI fileAn ESI (EtherCAT Slave Information) file is an XML file from the device’s supplier. It describes the device: its identity, its process data and its settings. : with it, the tool fills in the device’s PDOsA PDO (process data object) is a block of values a device exchanges with the controller every cycle. The rxPDO carries data to the device, such as outputs; the txPDO carries data from it, such as inputs. for you. motorcortex.io keeps ESI files for many devices in its ESI Database.

  1. Still in the Add Devices dialog, tick Apply ESI from database and confirm. Then press Add Devices.

  2. Click the new device and open its rxPDO and txPDO tabs. The module’s output channels are in the rxPDO, its input channels in the txPDO.

  3. Are the tabs empty? Then the database has no ESI file for this device. Open the device’s Settings tab and press Upload ESI file to load the file from the device’s supplier.

Deploy the configuration

  1. Press Deploy at the top right. The button shows Completed when the controller has the new configuration.

The application exchanges data with real devices only when it runs in production mode. In simulation mode it uses simulated values instead. The mode is set in the config package: see Mode in config.json.

If a device’s own memory is too small for its description, you can load that description from a file instead: see Custom SII firmware.

The module is on the bus now, but nothing in the application reads its inputs or sets its outputs yet. To use a channel, link it to a Motorcortex parameter: see I/O devices in Configure your application. For servo drives, see CiA402 drives.