Setup PLC

    6 minutes   deGroot  

PLC setup (hardware configuration), with examples for Beckhoff TwinCAT and Codesys. This is part of the YRCP-MP4P EtherCAT quick start guide.

Note

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

Important

Only use the ESI files supplied by Yaskawa Europe.

  1. Download the latest files here .
  2. Unzip the files.

Beckhoff TwinCAT 3

Install ESI file

  1. 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

  1. Add the YRCP-MP4P slave to the EtherCAT network by scanning: EtherCAT master »right mouse button » Scan
  2. Alternatively, add it manually: EtherCAT master »right mouse button » Add New Item
  3. Type “YRCP” in the search field to find it quickly.
    twincat-search-YRCP-MP4P
    Search for the YRCP-MP4P slave.
  4. Select the device and click OK to add it to the EtherCAT network.
    twincat-slave-added
    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.

Note

The minimum IO cycle for the device is 1 ms.

IO size

For the available IO sizes, see Configurations in the General section .

  1. Open the Process Data tab.

  2. By default, the slave is configured for 128b IO 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).

  3. After clicking on Outputs or Inputs in the Sync Manager window, you can change its PDO selection in the PDO Assignment (0x1C12) window.

    twincat-select-outputs
    After selecting Outputs, the PDO selection can be adjusted.

  4. 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 to 32b.

  5. Select PDO 16#1614 for 32b output, and select PDO 16#1A14 for 32b input.

    twincat-process-data-32b
    IO size of 32 bytes.

Note

Leave the PDO assignment checkbox activated.

Important

Make sure to set the same IO size for Inputs and Outputs.

Available PDOs:
SizeOutput PDOInput PDO
2 byte16#161016#1A10
4 byte16#161116#1A11
8 byte16#161216#1A12
16 byte16#161316#1A13
32 byte16#161416#1A14
64 byte16#161516#1A15
128 byte16#161616#1A16
Byte 0–19916#161716#1A17
Byte 200–25516#161816#1A18
Byte 200–39916#161916#1A19
Byte 400–43516#161A16#1A1A
Byte 400–51116#161B16#1A1B
Byte 0–25316#161C16#1A1C
Byte 254–43916#161D16#1A1D
Note

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-199Byte 200-399Byte 400–435
Output16#161716#161916#161A
Input16#1A1716#1A1916#1A1A

IO mapping

  1. 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_VAR
    
  2. In the tree, select the input area » right mouse button » Change Link…

    twincat-input-mapping1
    Change link for input area.

  3. Select all array members of the aIoFromRobot PLC variable by clicking the first one followed by the last one (while keeping shift pressed).

    twincat-input-mapping2
    Link inputs to PLC variable.

  4. Now repeat this process for mapping the outputs. In the tree, select the output area » right mouse button » Change Link…

    twincat-output-mapping1
    Change link for output area.

  5. Select all array members of the aIoToRobot PLC variable by clicking the first one followed by the last one (while keeping shift pressed).

    twincat-output-mapping2
    Link outputs to PLC variable.

Codesys

Install ESI file

  1. Import the downloaded ESI file into Codesys: menu Tools » Device Repository » Install
    codesys-import-YRCP-MP4P
    YRCP-MP4P added to the device repository.

Add slave

  1. Add the YRCP-MP4P slave to the EtherCAT network: EtherCAT master » right mouse button » Add Device
  2. Type “YRCP” in the search field to find it quickly.
    codesys-search-YRCP-MP4P
    Search for the YRCP-MP4P slave.
  3. Select the device and click Add Device to add it to the EtherCAT network.
    codesys-slave-added
    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.

Note

The minimum IO cycle for the device is 1 ms.

IO size

For the available IO sizes, see Configurations in the General section .

  1. Open the Process Data tab.
  2. By default, the slave is configured for 128b IO 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).
  3. By unselecting the 128b ones all PDOs become enabled. Now you select the PDO (or combination of PDOs) which fits your needs:
    codesys-process-data-none
    Overview (partly) of available PDOs.

In this example we will set the IO size to 32b.

  1. Select PDO 16#1614 for 32b output.
  2. Select PDO 16#1A14 for 32b input.
    codesys-process-data-32b
    IO size of 32 bytes.
Important

Make sure to set the same IO size for Inputs and Outputs.

Available PDOs:
SizeOutput PDOInput PDO
2 byte16#161016#1A10
4 byte16#161116#1A11
8 byte16#161216#1A12
16 byte16#161316#1A13
32 byte16#161416#1A14
64 byte16#161516#1A15
128 byte16#161616#1A16
Byte 0–19916#161716#1A17
Byte 200–25516#161816#1A18
Byte 200–39916#161916#1A19
Byte 400–43516#161A16#1A1A
Byte 400–51116#161B16#1A1B
Byte 0–25316#161C16#1A1C
Byte 254–43916#161D16#1A1D
Note

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-199Byte 200-399Byte 400–435
Output16#161716#161916#161A
Input16#1A1716#1A1916#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.

  1. Open the EtherCAT I/O Mapping tab.

  2. Set the address for each PDO. In this example, we start at addresss 1000 for both input and output:

    codesys-io-mapping
    IO address set for each PDO.

    Important

    In case of multiple PDOs for inputs/outputs: make sure there are no gaps in the addressing.

  3. 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_VAR
    
  4. Alternatively, 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.

Pages built with Hugo - 28 Oct 2025 16:37 CET