This tutorial demonstrates how to run a PROFINET I/O-Controller on the RevPi Connect and exchange data with the KUNBUS Gateway PROFINET IRT Slave.

Prerequisites #

Hardware #

✓ 1 RevPi Connect+
✓ 1 RevPi Gateway Profinet IRT Slave

For detailed instructions about how to set up your system, see Getting Started.

Software #

✓ CODESYS Development System installed on your PC
✓ Proneta installed on your PC

To ensure a compatible system with suitable software, see Software Compatibility.

Overview #

The application writes:

  • [0,1,2..15] to the first 16 Bytes of the output slot (kunbus_gw_9).

  • [16,17…​31] to the first 16 Bytes of the PROFINET IRT Gateway process image output area.

Step 1: Configuration #

Network Configuration #

  • RevPi Connect:

▷ Configure the eth1 interface for PROFINET in /etc/dhcpcd.conf with the following settings:

# Example static IP configuration:
interface eth1
static ip_address=192.168.0.11/24
  • Gateway PROFINET IRT Slave:

▷ Configure the KUNBUS Gateway PROFINET IRT Slave station name as kunbus-gw and IP as 192.168.0.15 using Proneta.

For detailed instructions refer to Manual RevPi Gateway PROFINET IRT.

Proneta

Graphical overview of the PROFINET network:

Proneta

Step 2: Configuring the PROFINET Network in CODESYS #

  • Scanning for Devices:

▷ Open the PROFINET Controller (PN_Controller) interface.

CODESYS

▷ Execute the Scan for Devices operation to identify the KUNBUS Gateway PROFINET IRT Slave.

  • Adding Device:

▷ Use the Copy All Devices to Project option to add the I/O device to the CODESYS device tree.

▷ Alternatively, manually add the KUNBUS-GW-ProfiNet module in the CODESYS device tree.

CODESYS

The following figure shows the CODESYS device tree overview of the example.

CODESYS

Step 3: Mapping Process Data #

  • Input Process Data:

▷ Map the process data for the input slot (kunbus_gw_1) as follows:
Input Bytes: First 16 Bytes.

CODESYS
  • Output Process Data:

▷ Map the process data for the output slot (kunbus_gw_9) as follows:
Output Bytes: First 16 Bytes.

CODESYS

Step 4: Testing the Configuration #

  • Running the application:

▷ Deploy and execute the application on the RevPi Connect.

  • Verifying data exchange:

▷ Check the input and output process image areas of the KUNBUS Gateway PROFINET IRT Slave using diagnostic tools like CODESYS or Siemens Proneta.

Note
  • Ensure the IP address and station name of the Gateway match the configuration in Proneta.

This setup enables seamless data exchange between the RevPi Connect and the KUNBUS Gateway PROFINET IRT Slave.