PLC setup (hardware configuration), with examples for Beckhoff TwinCAT and Codesys. This is part of the YRCP-MP4P EtherCAT quick start guide.
Allthough EtherCAT is supported by many PLC vendors this quick start guide is limited to the setup of the YRCP-MP4P in Beckhoff TwinCAT 3 and Codesys.
ESI files
Only use the ESI files supplied by Yaskawa Europe.
- Download the latest files here .
- Unzip the files.
Beckhoff TwinCAT 3
Install ESI file
- Copy the downloaded ESI file into the corresponding folder of your TwinCAT
installation (e.g.
C:\Program Files (x86)\Beckhoff\TwinCAT\3.1\Config\Io\EtherCAT).
Add slave
- Add the YRCP-MP4P slave to the EtherCAT network by scanning: EtherCAT master »right mouse button » Scan
- Alternatively, add it manually: EtherCAT master »right mouse button » Add New Item
- Type “YRCP” in the search field to find it quickly.

Search for the YRCP-MP4P slave. - Select the device and click OK to add it to the EtherCAT network.

YRCP-MP4P slave added to the network.
Slave settings
Double click on the slave to open the settings.
The default settings in tab General and EtherCAT should fit most applications. Adjust them to your needs.
The minimum IO cycle for the device is 1 ms.
IO size
For the available IO sizes, see Configurations in the General section .
Open the Process Data tab.
By default, the slave is configured for
128bIO and other PDOs are disabled. The disabling of other PDOs prevents selecting an illegal combination of PDOs (which would result in a non supported IO size).After clicking on
OutputsorInputsin the Sync Manager window, you can change its PDO selection in the PDO Assignment (0x1C12) window.
After selecting Outputs, the PDO selection can be adjusted. By unselecting the
128b(default), all PDOs become enabled. Now you select the PDO (or combination of PDOs) which fits your needs. In this example we will set the IO size to32b.Select PDO
16#1614for32boutput, and select PDO16#1A14for32binput.
IO size of 32 bytes.
Leave the PDO assignment checkbox activated.
Make sure to set the same IO size for Inputs and Outputs.
Available PDOs:
| Size | Output PDO | Input PDO |
|---|---|---|
| 2 byte | 16#1610 | 16#1A10 |
| 4 byte | 16#1611 | 16#1A11 |
| 8 byte | 16#1612 | 16#1A12 |
| 16 byte | 16#1613 | 16#1A13 |
| 32 byte | 16#1614 | 16#1A14 |
| 64 byte | 16#1615 | 16#1A15 |
| 128 byte | 16#1616 | 16#1A16 |
| Byte 0–199 | 16#1617 | 16#1A17 |
| Byte 200–255 | 16#1618 | 16#1A18 |
| Byte 200–399 | 16#1619 | 16#1A19 |
| Byte 400–435 | 16#161A | 16#1A1A |
| Byte 400–511 | 16#161B | 16#1A1B |
| Byte 0–253 | 16#161C | 16#1A1C |
| Byte 254–439 | 16#161D | 16#1A1D |
Some (larger) IO sizes require a combination of PDOs. The allowed combinations are defined by the ESI file.
For example, to build the 436b data packet for MotoLogix, the following PDOs
must be selected:
| Byte 0-199 | Byte 200-399 | Byte 400–435 | |
|---|---|---|---|
| Output | 16#1617 | 16#1619 | 16#161A |
| Input | 16#1A17 | 16#1A19 | 16#1A1A |
IO mapping
Create PLC variables of the chosen size, and tie them to IO addresses:
VAR // using byte array aIoFromRobot AT %IB1000: ARRAY [0..31] OF BYTE; // Inputs aIoToRobot AT %QB1000: ARRAY [0..31] OF BYTE; // Outputs END_VARIn the tree, select the input area » right mouse button » Change Link…

Change link for input area. Select all array members of the
aIoFromRobotPLC variable by clicking the first one followed by the last one (while keeping shift pressed).
Link inputs to PLC variable. Now repeat this process for mapping the outputs. In the tree, select the output area » right mouse button » Change Link…

Change link for output area. Select all array members of the
aIoToRobotPLC variable by clicking the first one followed by the last one (while keeping shift pressed).
Link outputs to PLC variable.
Codesys
Install ESI file
- Import the downloaded ESI file into Codesys:
menu Tools » Device Repository » Install

YRCP-MP4P added to the device repository.
Add slave
- Add the YRCP-MP4P slave to the EtherCAT network: EtherCAT master » right mouse button » Add Device
- Type “YRCP” in the search field to find it quickly.

Search for the YRCP-MP4P slave. - Select the device and click Add Device to add it to the EtherCAT network.

YRCP-MP4P slave added to the network.
Slave settings
Double click on the slave to open the settings.
The default settings in tab General should fit most applications. Adjust them to your needs.
The minimum IO cycle for the device is 1 ms.
IO size
For the available IO sizes, see Configurations in the General section .
- Open the Process Data tab.
- By default, the slave is configured for
128bIO and other PDOs are disabled. The disabling of other PDOs prevents selecting an illegal combination of PDOs (which would result in a non supported IO size). - By unselecting the
128bones all PDOs become enabled. Now you select the PDO (or combination of PDOs) which fits your needs:
Overview (partly) of available PDOs.
In this example we will set the IO size to 32b.
- Select PDO
16#1614for32boutput. - Select PDO
16#1A14for32binput.
IO size of 32 bytes.
Make sure to set the same IO size for Inputs and Outputs.
Available PDOs:
| Size | Output PDO | Input PDO |
|---|---|---|
| 2 byte | 16#1610 | 16#1A10 |
| 4 byte | 16#1611 | 16#1A11 |
| 8 byte | 16#1612 | 16#1A12 |
| 16 byte | 16#1613 | 16#1A13 |
| 32 byte | 16#1614 | 16#1A14 |
| 64 byte | 16#1615 | 16#1A15 |
| 128 byte | 16#1616 | 16#1A16 |
| Byte 0–199 | 16#1617 | 16#1A17 |
| Byte 200–255 | 16#1618 | 16#1A18 |
| Byte 200–399 | 16#1619 | 16#1A19 |
| Byte 400–435 | 16#161A | 16#1A1A |
| Byte 400–511 | 16#161B | 16#1A1B |
| Byte 0–253 | 16#161C | 16#1A1C |
| Byte 254–439 | 16#161D | 16#1A1D |
Some (larger) IO sizes require a combination of PDOs. The allowed combinations are defined by the ESI file.
For example, to build the 436b data packet for MotoLogix, the following PDOs
must be selected:
| Byte 0-199 | Byte 200-399 | Byte 400–435 | |
|---|---|---|---|
| Output | 16#1617 | 16#1619 | 16#161A |
| Input | 16#1A17 | 16#1A19 | 16#1A1A |
IO mapping
There are multiple ways of mapping fieldbus IO to PLC variables. One way is to use IO addresses, and tie the PLC variables to these addresses.
Open the EtherCAT I/O Mapping tab.
Set the address for each PDO. In this example, we start at addresss
1000for both input and output:
IO address set for each PDO. ImportantIn case of multiple PDOs for inputs/outputs: make sure there are no gaps in the addressing.
Create PLC variables of the chosen size and point them to the chosen start addresses for input and output:
VAR // using byte array aIoFromRobot AT %IB1000: ARRAY [0..31] OF BYTE; // Inputs aIoToRobot AT %QB1000: ARRAY [0..31] OF BYTE; // Outputs END_VARAlternatively, you can create your own data types (of the same size) and use those for the mapping:
VAR // using your custom data types (size must match to the set IO size) aIoFromRobot AT %IB1000: myInputDataType; // Inputs aIoToRobot AT %QB1000: myOutputDataType; // Outputs END_VAR
Tips
No items yet.
Troubleshooting
No items yet.