011 - Using Codesys as Soft-SPS

Introduction

The following Chapters describe the Usage of a Raspberry Pi as Software SPS in combination with the SoM as Client.

Prerequisites and Topology

You’ll need:

Option 1 shows the usage of the Raspberry as Soft SPS and an seperate SoM Eval Kit as a device. Option 2 uses the Raspberry as Soft SPS and in Combination with a SoM-Adaptershield also as Application Controller.

Option 1: Raspberry Pi as Soft SPS and seperate SoM EVAL Kit as Device
Option 2: Raspberry Pi as Soft SPS and in combination with SoM Adapterhield as Application Controller and Device

Setup of a new Project

  1. Create a new “Standard project” with the device “CODESYS Control for Raspberry Pi”.

  2. Change to tab “Raspberry Pi” [1], choose the right Configuration [2] and Install CODESYS Runtime Package on the Raspberry Pi [3].

  3. Choose the Tab “Devices” [4], double click “Device” [5] in the Explorer on the left side. “Scan Network” [6] and Choose the Raspberry Pi [7] as Gateway.

After a Reboot of the Raspberry Pi, the CODESYS Runtime Package will start automaticly.

SoM as Profinet Device

  1. Open “Tools”->”Device Repository…” and select “Install”. Choose the appropriate GSD, e.g. GSDML-V2.4-portGmbH-irj45-20211007.xml. Select “Close” after installing succesfully.

  2. Click Right on “Device” and Select “Add Device”, Choose “Fieldbusses”->”Profinet IO”->”Ethernet Adapter”->”Ethernet” [1], Apply with “Add Device”.

  3. Click Right on “Ethernet (Ethernet)” and also add PN-Controller: “Fieldbusses”->”Profinet IO”->”Profinet IO Master”->”PN-Controller”.

  4. Click Right on “PN_Controller (PN-Controller)” and also add Device: “Fieldbusses”->”Profinet IO”->”Profinet IO Slave”->”port”->”2-port Device” [2].

  5. Double Click on the Device “Ethernet (Ethernet)” [3] and select the appropriate Network Interface [4] connected with the SoM on the Raspberry Pi.

     

  6. Log into the Raspberry Pi [5] and start the application with “Start”.

Please make sure to apply a valid IP setup.

Start the appropriate application on the Application Controller (e.g. Raspberry Pi or STM32F429ZI connected per SPI to the SoM) and the device should be able to communicate per Profinet with the CODESYS Runtime on the Raspberry Pi.