Codesys 3.5.16.10 Runtime on a Beckhoff CX-5130

Codesys 3.5.16.10 Runtime on a Beckhoff CX-5130

This is a guide on how to install Codesys 3.5.16.10 runtime, and possible also previous versions, on a Beckhoff CX-5130 Industrial PC.

Download the runtime and package from codesys.com where you need the CODESYS Control RTE SL (for Beckhoff CX) files. This zip contains both the runtime for the PLC, drivers for the EtherCat bus and the package for the Codesys IDE Development System V3.

Read the short introduction in the document: “First Steps for RTE on CX2xxx.pdf” that is in the zip file, for additional questions consult the manual in CODESYSControlRTEV3_Manual.pdf.

I used a CX-5130-0150 controller, 0150 which means it comes with Windows 10 and without a pre-installed TwinCat license.

On the CX-5130 controller, run the installation of the runtime environment by either installing CODESYS Control RTE 3.5.16.10.exe or CODESYS Control RTE 64 3.5.16.10.exe depending on if you want a 32- og 64-bit installation.

Codesys Control RTE 64 3.5.16.10

Setting up the number of physical cores in your CPU is the most important, the other options about persistent variables, NVRAM, SRAM and UPS can be changed later on, so just go with the default setting.

CPU physical core setting

Pay attention to not run the runtime and start the PLC, until you have the CX5000 backbone driver installed, it should install automatically with the runtime installation file. EtherCAT will not work without this driver.

Codesys Control RTE running on the CX-5130

When installation is done, check out the settings of the runtime in the tray bar. Here you can set it to automatically start upon reboot. Remember to set up a static IP address if you use that, or write down the DHCP given address so you can use that in the IDE.

Reboot the controller.

The Beckhoff CX-5130 test setup

In the Codesys 3.5.16.10 Development System V3 on your engineering PC, it is now time to make a new project. This guides your through a completely new installation of the IDE, making a project, connect the controller, find the hardware and definitions.

Start a new empty project and add a device. Choose the Codesys Control RTE CX x64 or the one that corresponds to the runtime you installed on your Beckhoff CX controller.

Selecting the correct controller for the new device in project

Double click on the new device and type in the IP address and press enter. Here I can verify that it is the correct device name and target version corresponding to what we installed prior.

Communication settings

To add the EtherCAT I/O modules sitting on the controller, we need to add a new device, a EtherCAT internal master.

Adding a EtherCAT master

Double click the new EtherCAT internal master to point it to the correct source address, click the browse button.

Configuring the EtherCAT master

In the list of possible network adapters, we can see the two ethernet ports at the front of the controller, X000 and X000, do not use those. As the third option we can see the CX5000 driver that was installed on the controller, this also confirms that the installation of the driver on the controller was successful.

Network interface of the EtherCAT master

Right click the EtherCAT internal master and select “Scan for devices…”

Scan for EtherCAT devices

The list of scanned I/O modules returns a lot of errors, but it corresponds to the 14 modules I have on the controller. The device descriptions for the EtherCAT modules is missing in the Codesys IDE device repository.

EtherCAT I/O modules that was found

These device descriptions are available from the different manufacturers of the EtherCAT hardware you are installing. In this case we down these files from Beckhoff website as shown with red boxes.

Downloading Beckhoff EtherCAT device description configuration files

In the menu “Tools -> Device Repository” you can now install the downloaded device descriptions. I chose to install all of the ELxxxx descriptions.

Installing device descriptions

Press the “Scan Devices” button to rescan the bus and have it discover the modules with the correct descriptions.

Scanning the EtherCAT bus with device descriptions installed shows all correctly

It is now possible to download the project to the controller and set it in run mode, here we can see by the cyclkic green icon that the EtherCAT task is being executed and from the statistics that it is running without errors.

Everything works and is executed with the CX-5130 in run mode

Now you can sit back, fetch some more coffee and start programming your Beckhoff CX controller with the Codesys IDE.

2 comments on “Codesys 3.5.16.10 Runtime on a Beckhoff CX-5130

Leave a Reply

Your email address will not be published. Required fields are marked *