PROFINET Device  v1.04.00
Connect to PLC - CODESYS on RevPi

Introduction

The following sections describe the steps to configure a project that contains one PLC that implements PROFINET Controller and the SITARA AM64x based PROFINET device.
In the setup described in the diagram below, a CODESYS (https://www.codesys.com/) IEC 61131 development and runtime system is used with a industrial RevPi Connect hardware (https://revolution.kunbus.com/) by KUNBUS GmbH.

CODESYS Installation

The CODESYS development system is after registration available for download free of charge from the CODESYS Store.
Please consult the system requirements in the CODESYS Store for the development PC.
It is recommended to install the full package. For the CODESYS runtime on the KUNBUS RevPi hardware, the CODESYS Control for Raspberry Pi MC SL is required.
Without a valid license, the CODESYS runtime including the fieldbus functionality will execute for one hour and then exit.
To install the runtime package the CODESYS development system must be started with administrative rights.
Installation is performed from within the CODESYS Package Manager. It is recommended to install the multi-core version.

After the package is installed, the CODESYS runtime system has to be installed on the RevPi hardware. From the menu system select Tools → Update Raspberry Pi

Creating a CODESYS Project

Start the CODESYS development system and create a new standard project

Select CODESYS Control for Raspberry Pi MC SL (3S - Smart Software Solutions GmbH) as device and the programming language of your choice.

The development system creates the project structure and populates the structure of the device tree.

Before configuring the PROFINET network, the matching device description file has to be installed to the CODESYS device repository.
Navigate to Tools → Device Repository in the menu system and install the file TI AM64X.R5F Simple.xml which is part of the distribution.

Setup a PROFINET Network

Scan for a Gateway Device and select connected RevPi.

Add an EtherNet Interface and select the Port connected to the PROFINET Network.

Continue to add a PROFINET Controller to this Ethernet Interface.

Once complete you can enter Online mode and start your application.
This only starts the PROFINET Controller from where it is possible to scan for connected PROFINET devices.

Scan for Device and add to Project

Provided device description has been installed earlier, the scan process will identify the PROFINET device.

Set a Station Name and an IP Address, the device can now be copied to the project.

Finally exit Online mode, re-enter Online mode to download the new project structure, and start the application.

All devices should now be running.
Now you are free can implement your program.