Starting with CODESYS on the Raspberry Pi

NOTE THIS POST IS OUT OF DATE. Please see starting-with-codesys-on-raspberry-pi

I’ve finally decided to give CODESYS a try on the Raspberry PI. This post tracks what I had to do to get CODESYS functioning, I’ll post more on sample projects in the future.

First of all, my setup: I’m running a fresh install of Windows 8.1 x64 in a virtual machine hosted on vmware Fusion on a Macbook Pro. I have a Raspberry Pi 2 connected by ethernet on my local network, the virtual machine is bridged so that it is on the same subnet as the Raspberry Pi. I am using an 8Gb SanDisk Ultra microSDHC card.

Installing CODESYS on Windows

I downloaded CODESYS V3.5 SP6 Patch 3 from CODESYS download area (You need to register, but then the download is free). I then ran the installer accepting all defaults.

CODESYS on the Raspberry PI

CODESYS for the Raspberry PI is available as a free download from the CODEYS store, again you have to register to get access, and again this is free. I downloaded, and unzipped it to give me a folder with the following content.

Installation basically consists of two parts, firstly updating the CODESYS IDE with a package to add support for the Raspberry Pi, and secondly loading a runtime image onto an SDCard. 

Installing the package

I launched CODESYS V3.5 SP6 Patch 3 from the link on the windows desktop, selected the Standard environment when prompted. I then launched the Package Manager from Tools/PackageManager… I then selected Install… and browsed to the CODESYS_Control_for_Raspberry_PI package,

I then accepted the license agreement and all defaults

(Take a note of the target directory), Allow UAC to make changes.
I clicked Finish

Then clicked Close before exiting CODESYS.

Loading the Image

Following the advice in the product data sheet I downloaded and installed Win32diskimager 0.9.5 from I plugged the microSDHC card into an SDCard carrier and then plugged this into a USB SDCard reader (The internal SDXC slot on my MacBook is not recognised by vmware Fusion, see vmware kb1035825). I then launched Win32DiskImager, and browsed to codesysrasp35620.img in the directory I had previously unzipped, selected device G: which corresponds to the SDCard, and clicked Write.

Programming the card took a few minutes, I then clicked Exit. Using Windows Explorer I was able to see the content of the SDCard,

still using Windows Explorer I right clicked on the device and selected Eject, before physically removing the card from the reader.

I then plugged the card into my Raspberry Pi and powered it on. Notice in the startup messages
codesyscontrol started
At the login prompt I entered the default credentials, username pi, password raspberry.
I chose at this point to expand the filesystem to fill the available space on the card, so at the command prompt
sudo raspi-config

I selected the option to Expand Filesystem, then tabbed to Finish and rebooted.

Testing the Installation

I launched CODESYS V3.5 SP6 Patch 3 and then from the Start Page selected New Project…

I selected the default type of a Standard project gave it a name and clicked OK.

I then selected the Device and programming language I wished to use.
This created a project with this content below

I then double clicked the Device (CODESYS Control for Raspberry Pi) which brought up the Communications Settings tab for the device.

I selected Scan Network, this found the device, which I selected and then clicked OK.

Now we are connected to the Raspberry Pi. 


  • Categories

  • Tags