This project supports the installation of the Codesys Control Runtime on a Raspberry Pi to enable the development and running of Industrial applications according to the IEC 61131-3 standard. Codesys already has a dedicated Runtime package for Raspberry pi called the CODESYS Control for Raspberry Pi SL
but there is no free or trial version unlike the rest of the Runtime packages, meaning that you would have to buy it before using it.
However, there is also a another Linux based Runtime package called CODESYS Control for Linux SL
that can be installed and used on a Raspberry Pi which does not require a licence to develop applications (Unlicensed version allows you to test your application for two hours). This however does not come with the features that are contained in the dedicated package for Raspberry PI. Such features include ready to use devices for different buses and IO devices such SPI, I2C and many others
So, this project focuses on the installation and usage of the CODESYS Control for Linux SL
. The instrutions in this project cover the manual installation method, meaning that files are transfered and installed manuaaly on the Raspberry Pi. We will also attempted to write our own device description files for deifferent IO devices
Download the Control Runtime Package file form here: https://store.codesys.com/en/codesys-control-for-linux-arm-sl-1.html
Use the Codesys installer to install the package file on your local computer. (Watch video below for help)
Locate the Folders whee the pacake files have been installed and transfer the following files to your Raspberry Pi. The x.x.x.x
represent the Runtime version and will depend on the version you have downloaded.
- The
codesyscontrol_linuxarm_4.1.0.0_armhf.deb
located in the \<USER>\CODESYS Control for Linux ARM SL\Delivery folder - The
codemeter-lite_7.20.4402.501_armhf.deb
located in the \<USER>\CODESYS Control for Linux ARM SL\Dependency folder - The
codesysedge_edgearmhf_4.11.0.0_armhf.deb
located in the \<USER>\CODESYS Edge Gateway for Linux\Delivery\edgearmhf folder
From your Raspberry, follow the following steps
-
Unpack the Debian package by running the following command:
$ ar -x codesyscontrol_linuxarm_4.1.0.0_armhf.deb
. This will create three files namely:control.tar.gz
data.tar.gz
debian-binary
We are only interested in the
data.tar.gz
-
Unpack the data.tar.gz file. Create a new folder for this beforehand with the following commands:
- $
mkdir data
- $
tar -xf data.tar.gz -C data
In the data folder, you should have three new folders inside namely,
ect
,opt
,usr
andvar
- $
-
Copy the individual directory contents to the respective root directories of the Rapsberry Pi:
Navigate to the
data/
folder and run the following commands$ sudo cp -r etc/* /etc
$ sudo cp -r opt/* /opt
$ sudo cp -r usr/* /usr
$ sudo cp -r var/* /var
-
Change config file previllages and add the
codesysuser
group to the system$ sudo chmod a+rw /etc/CODESYSControl.cfg
$ sudo chmod a+rw /etc/CODESYSControl_User.cfg
$ groupadd codesysuser
-
Unpack the Debian Codemeter package by running the following command:
$ codemeter-lite_7.20.4402.501_armhf.deb
. This will create three files namely:control.tar.gz
data.tar.gz
debian-binary
We are only interested in the
data.tar.gz
-
Unpack the data.tar.gz file. Create a new folder for this beforehand with the following commands:
- $
mkdir data
- $
tar -xf data.tar.gz -C data
In the data folder, you should have three new folders inside namely,
ect
,lib
,usr
andvar
- $
-
Copy the individual directory contents to the respective root directories of the Rapsberry Pi:
Navigate to the
data/
folder and run the following commands$ sudo cp -r etc/* /etc
$ sudo cp -r lib/* /lib
$ sudo cp -r usr/* /usr
$ sudo cp -r var/* /var
-
Run the following post installation commands
$ sudo udevadm trigger -vn --subsystem-match=usb --attr-match=idVendor=064f | xargs -rn1 -d\\n udevadm trigger -b
$ sudo mkdir -p "/etc/systemd/system/multi-user.target.wants/"
$ sudo ln -sT /lib/systemd/system/codemeter.service /etc/systemd/system/multi-user.target.wants/codemeter.service
-
Unpack the Debian edge gateway package by running the following command:
$ ar -x codesysedge_edgearmhf_4.11.0.0_armhf.deb
. This will create three files namely:control.tar.gz
data.tar.gz
debian-binary
We are only interested in the
data.tar.gz
-
Unpack the data.tar.gz file. Create a new folder for this beforehand with the following commands:
- $
mkdir data
- $
tar -xf data.tar.gz -C data
In the data folder, you should have three new folders inside namely,
ect
,opt
,usr
andvar
- $
-
Copy the individual directory contents to the respective root directories of the Rapsberry Pi:
Navigate to the
data/
folder and run the following commands$ sudo cp -r etc/* /etc
$ sudo cp -r opt/* /opt
$ sudo cp -r usr/* /usr
$ sudo cp -r var/* /var
-
Change previllages for the gateway config file```
$ chmod a+rw /etc/Gateway.cfg
- Codemeter:
$ sudo /usr/sbin/CodeMeterLin
- Runtime:
$ sudo /etc/init.d/codesyscontrol start
- Edge gateway:
$ sudo /etc/init.d/codesysedge start