[Holiday Notice] Please be informed that our office will be closed on September 16 in observance of a public holiday. Kindly note that all orders placed after 12:00 PM (GMT +8) on September 13 will be processed on September 17. Thank you for your understanding, and we apologize for any inconvenience caused.
Getting Started with IRIV PiControl and CODESYS

Getting Started with IRIV PiControl and CODESYS

Introduction

In this multi-part tutorial, we will explore using Cytron IRIV PiControl with CODESYS. This includes the software installation and methods to interact with the IRIV PiControl’s digital input, digital output, and analog input. 

 

 

What is CODESYS? 

CODESYS is a development and runtime system used for programming and controlling industrial automation devices and systems. It is a popular software platform for the development of programmable logic controllers(PLCs) and other automation devices. CODESYS stands for "Controller Development System" and provides a comprehensive set of tools for creating, configuring, and debugging control applications. It is widely used in various industries, including manufacturing, energy, transportation, and building automation. 

With CODESYS, engineers can develop control applications using the IEC 61131-3 standard, which defines five programming languages: ladder diagram (LD), functional block diagram (FBD), structured text (ST), instructional list (IL), and sequential function chart (SFC). These languages allow for the implementation of complex control logic, data handling, and communication tasks. Moreover, the CODESYS development environment includes an integrated development environment (IDE), that enables programmers to write and organize their code, as well as debug and simulate the control application before deploying it to the target hardware. 

One of the key features of CODESYS is its platform independence. It supports a wide range of hardware platforms from various manufacturers, allowing engineers to write code that can be deployed on different devices without significant modifications. This flexibility makes it easier to develop and maintain control applications for different automation systems.

 

Hardware

To complete all 6 parts of this tutorial, we will need the following hardware:

  1. Cytron IRIV PiControl

  2. Momentary push button with integrated LED

  3. 3.3V and 5.0V DC source

  4. 24V DC Power Supply

  5. 22AWG Hook Up Wire

 

To complete this part of the tutorial, we will need only:

  1. Cytron IRIV PiControl

 

Software

For the software part, first, we need to download and install CODESYS. The software can be downloaded here. The installation process is quite straightforward. Just follow the on-screen instructions. 

 

While waiting for CODESYS to install, power up your IRIV PiControl and connect it to the same network that your computer running CODESYS is connected to. 

 

Once the installation process is completed, launch CODESYS. 

 

 

The first time you launched CODESYS, the application will look like this

 

 

The next thing that we need to do is to install the CODESYS control for the Raspberry Pi package.

Go to Tools --> CODESYS Installer

 

 

In the CODESYS Installer window, click on the Browse tab, then type "raspberry" into the search field. Then choose CODESYS Control for Raspberry Pi and click the install button.

 

NOTE: At the time of writing this tutorial (July 2024), it is recommended to use CODESYS Control for Raspberry Pi version 4.11.0.0

 

 

A confirmation window will pop up and click the "OK" button.

 

 

Next, a new window will pop up. Tick the "I accept the license agreement" and click continue.

 

 

Next, a new window will pop up asking to close the CODESYS.exe. Close the CODESYS and click the OK button.

 

 

Wait until the installation process completes and click the OK button.

 

 

Now relaunch CODESYS and go to Tools --> Update Raspberry Pi

 

 

In the following window go to the Raspberry Pi tab, key in the following parameters, and click the install.

Username: pi

Password: raspberry

IP address: the target IP address

CODESYS Runtime Package: x.x.x.x (raspberry, armhf)

 

 

If you are unsure of the IP address, can click the scan button as shown in the figure above to obtain the IP address. 

In the scan window, click the Rescan button to obtain the IP address.

 

 

Once the Install button is pressed, a configure runtime window will appear.

Take note if the selection is Multicore 64-bit or Multicore 32-bit. This will be important later when starting a new project. 

Click Close.

 

 

If you get this error that “CODESYS Edge Gateway for Linux” is not being installed, click Yes

 

 

Once it's completed, a message will shown in the messages window, stating that "codesyscontrol started". Which indicates that the process was successful.

 

Hardware Components