Page tree

You need the CODESYS programming environment version 3.5 in order to be able to use Raspberry. You can download this free of charge from the CODESYS store

http://store.codesys.com/engineering/codesys.html

Subsequently, you need the package CODESYS Control for Raspberry Pi SL from the CODESYS store, which you can then install directly via CODESYS (Tools → Package Manager → Install...):

https://store.codesys.com/codesys-control-for-raspberry-pi-sl.html

 

Please restart CODESYS after installing this package.

What needs to be installed on the Pi itself?

If you don't have an image, it can be downloaded from http://www.raspberrypi.org/downloads. You then have to flash it to the SD card.

Activation of SSH

If you already use the Raspberry Pi for other things, you can of course continue to use your existing image.

The CODESYS PLC is installed via the following menu item:

The Raspberry Pi must be located in the same network as the CODESYS PC from which the installation is executed.

You can now scan the Raspberry Pi in your network. All the Raspberry Pi devices in this network appear in the scan.

 

Login data

User name:  pi
Password:   raspberry

The Debian package from the store download is now installed on the Raspberry Pi and the PLC is also started directly. The message Update finished in the window Messages -> RaspberryPI indicates a successful installation.  

After that you can use the Raspberry Pi directly with CODESYS. To do this, open one of the sample projects:

C:\Users\<user_name>\CODESYS Control for Raspberry PI\<version>\Examples\Webvisu.project

Please update the device via the context menu (right mouse button) so that it matches the current PLC version on the Raspberry Pi.

Subsequently, set the Compiler Version and the Visualization Profile to the latest version via Project → Project Settings....

Now you can scan the Raspberry Pi in CODESYS under the Communication Settings of the Device. Log in with Online → Login and start the application with Debug → Start.  

When the webvisu project is running, you can call and display the webvisu of the project in a browser with the link http://<raspberrypi_ip_address>:8080/webvisu.htm.




You can use the following fieldbuses / features with the Raspberry Pi:

  • EtherCAT master
  • Profinet controller / Profinet device
  • Modbus TCP / master, slave
  • Modbus RTU / master, slave
  • Ethernet/IP scanner and adapter
  • CANopen over EL6751 gateway terminal

Pi-specific features:

  • Address PiCAM from the PLC
  • PiFace (8 inputs / 8 outputs via SPI)
  • I2C
  • Address GPIO
  • Control RC servos via SoftMotion and PLCopen function blocks
  • further example for i2C – analog input / temperature measurement
  • and much more…


Here is a first-steps video for this:
https://www.youtube.com/watch?v=6FPf3RHWyeU

Example – EtherCAT and SoftMotion:
http://www.youtube.com/watch?v=GFN9T_cXLEU

Example – RC servos:
http://www.youtube.com/watch?v=oDha-2y3pH4

You can also get useful information from our forum: You can also find libraries and devices from other CODESYS Raspberry Pi users here:
http://forum-de.codesys.com/viewforum.php?f=18&sid=372d536cd6b0615779d94f49e3d27d46 
http://forum.codesys.com/viewforum.php?f=21&sid=847359a6c4f57dd5f6f63d96fbab291b 

The forum FAQ is also very helpful for this:
http://forum.codesys.com/viewforum.php?f=22