CODESYS is a development environment in accordance with IEC 61131-3 for programming industrial automation systems. Users can create automation projects, configure hardware and develop control applications using various programming languages such as ladder logic, structured text and function block diagrams.

The Revolution Pi Library for CODESYS allows the integration of RevPi devices in CODESYS. The RevPi is therefore a modular and powerful microcontroller for automation tasks. It can be used as a soft PLC in networks that use fieldbus and industrial Ethernet protocols. With CODESYS WebVisu, visualizations can be created and displayed platform-independently in common web browsers. Separate HMI software is not required.

For information on CODESYS, see

CODESYS Licensing #

For the permanent operation of the CODESYS Development System you need a paid license. Without a valid license, your CODESYS project runs on the RevPi device in demo mode and ends automatically after a runtime of two hours. The demo mode can be used as often as required.

Which license you need depends on certain parameters of your project, e.g. number of inputs and outputs, required fieldbus, required additional products or project size. If the project parameters change, you can purchase suitable upgrade licenses.

For detailed guidance on licensing, see Application-based Licenses.

Important
The CODESYS license can get lost.

If the license has not been backed up, it may get lost, for example, after a new image is installed or in the case of a corrupted file system.

▷ Save the license for CODESYS outside of your RevPi device so that it is still available to you.

Note

A CODESYS license is bound to your RevPi device when it is activated. You can activate and deactivate it only on the same device.

Setting up the System #

Compatible Software
Note

The CODESYS Software is available in 32- and 64-bit versions. It has to correspond to the bit version of your RevPi Image. You can retrieve the bit version of the RevPi Image from the terminal of the RevPi device using the command getconf LONG_BIT. From the RevPi Bookworm Image onwards, only a 64-bit version is available.

For information on the RevPi Image, see

Compatible RevPi Devices
Installing Software

▷ Download the CODESYS Development System to your PC.

▷ Install the CODESYS Development System on your PC.

▷ Download the software package CODESYS Control for Linux ARM or CODESYS Control for Linux ARM64 to your PC.

▷ Install the software package in the CODESYS Development System.

▷ Download the software package Revolution Pi Library for CODESYS to your PC.

▷ Install the software package in the CODESYS Development System.

Note

The software package Revolution Pi Library for CODESYS contains the driver and various CODESYS project files with simple applications as examples that you can experiment with.

See also CODESYS Tutorials.

Connecting CODESYS to the RevPi Device

✓ The RevPi device is connected to the network.

▷ Establish a connection with the RevPi using the CODESYS Deploy Tool. To do this, you need to identify the IP address. The login credentials can be found on the sticker on the side of the housing of the RevPi device.

Deploy Contrl S

▷ Install the software package CODESYS Control for Linux ARM/64 via the CODESYS Deploy Tool on the RevPi device.

Creating a Project Including RevPi Devices #

Creating a RevPi Base Module #

When you add devices to the project, a list of potential RevPi base modules is displayed.

▷ Select your RevPi base module and add it.

Add Base Module

Adding a RevPi Expansion Module #

Certain RevPi expansion modules can be connected to the RevPi base modules of the RevPi Connect and RevPi Core series on the right and left side. See also Rules for the Arrangement of Devices.

Adding a RevPi I/O Module

According to the physical arrangement of the RevPi expansion modules of your system, these are added to the project tree via the objects piBridgeLeft and piBridgeRight.

piBridgeLeft-Right

▷ Select the RevPi I/O module and add it.

Add Expansion Module
Adding a RevPi Gateway

RevPi Gateways are added to the project tree via the PiBridgeEnd object. PiBridgeEnd is a virtual termination of the PiBridge, which indicates the end of the RevPi expansion modules.

▷ Select the RevPi Gateway and add it.

Add Gateway
Adding a RevPi Con Module

RevPi Con modules are added to the project tree via the PiBridgeRight object.

▷ Select the RevPi Con module and add it.

revpi codesy add con module
Adding a Virtual Device

The Virtual Device can be used to exchange data between CODESYS and other external applications such as Node-RED. For this, the space provided for this purpose in the process image is used via a virtual interface. The Virtual Device is added to the project tree via the piBridgeVirtual object.

▷ Add the Virtual Device.

revpi codesy add virtual
Note

RevPi devices are already created in the projects in the supplied sample files. You can use them to get started working with RevPi and CODESYS. See also CODESYS Tutorials.

Configuration #

Note

CODESYS and PiCtory cannot be used in parallel for configuration. An existing configuration via PiCtory will be overwritten by a configuration via CODESYS.

The virtual devices OPC UA Server and MQTT Client can only be used via PiCtory.

The RevPi devices are configured in the CODESYS Development System in the device configuration. Here, variables can be assigned to the I/O channels and certain values can be defined in tabular structures.

▷ Select the RevPi device in the device tree.

❯ The device configuration window opens.

revpi codesys config aio

▷ Enter variables in the Mapping tab.

▷ Set values in the Parameter tab.

When loading a project on the RevPi device, the values are mapped automatically.

Type and use of the parameters and configurable values of the RevPi devices, see:

Configuration Base Modules
Configuration I/O Modules
Configuration RevPi Gateway

The following assignments are defined for the ModuleState byte in the device configuration:

Value Status

0x00

Physically offline

0x01

Physically connected but no communication

0x02

Standy/Ready (PreOp)

0x03

Cyclic data exchange active (Op)

Config Gateway

If the ModuleState is offline, CODESYS displays the status No driver found for the RevPi Gateway:

No Driver Found

If the RevPi Gateway is in PreOp and Op state or is physically connected, this is displayed in green in the device tree:

gateway running

CODESYS Tutorials #