Some of Stef's Stuff

Setup of CODESYS soft-PLC for an industrial automation setup with an EtherCAT master running on Raspberry Pi.

Setup Raspberry PI

You need a Raspberry PI with Raspbian up and running. If not, download the Raspbian image and install it on an SD card following the official installation guide

You should be able to connect to your PI and, if on a Raspberry PI 3, you should have the onboard WiFi set up so it can be used for the CODESYS – Raspberry PI communication while the wired LAN will be used for the connection to the EtherCAT slave. See:

NOTE

Setup CODESYS and Raspberry Pi device

CODESYS configuration and the device description files

The CODESYS runtime can be configured to run as the master in an EtherCAT network. To interact with the devices connected on the network the EtherCAT master must know their details. This is achieved by adding the devices to the CODESYS project device tree via their descriptor files. Some “slaves” are alread know by CODEYS, as they’re distributed with the software, but in general the desciptor file for a particular device (or a family of them) is provided by the manufacturer in the form of an XML file that can be imported in CODESYS

The list of the device known by CODESYS can be accessed from Tools > Device Manager

Beckhoff EtherCAT coupler and IO modules

Beckhoff EK1100 EtherCAT Coupler

Beckhoff EL1008 – 8x Digital Input

Beckhoff EL2008 – 8x Digital Output

The XML description files of the EtherCAT modules from Beckhoff EK1100 webpage (select XML device description from the tree on the left and then right click and Save link as… on the archive file – around 15MB ).

The archive contains the descriptors for all the Beckhoff hardware including EKxxxx, EL1xxx and EK2xxx.

2 thoughts on “CODESYS on Raspberry Pi and EtherCAT”

I am trying to implement Ethercat Master on Pi3 and my desired slave description is not included in the codesys database.But I have xml file description of my device. How can I import xml file in the codesys while configuring master ?

Hi Ans,
assuming you’re in CODESYS 3.5, go to the menu “Tools > Device Repository…” and click on the “Install…” button. Select the XML file containing the description of your device and it will be added to the database.