New versions of the CODESYS software or the RevPi I/O Driver may introduce changes that require adjustments to existing installations, configurations, or projects.

This page provides instructions for adjustments required in addition to installing the new version when changing versions.

Migrating to RevPi I/O Driver Version 3.0.0.0 #

RevPi I/O Driver V3.0.0.0 introduces changes that require existing projects to be migrated manually to the new driver version.

The migration procedure described here preserves the existing project file. It is recommended for larger projects with extensive configurations, WebVisu pages, multiple tasks, or complex program logic.

For smaller projects, we recommend recreating the project based on the new driver version.

See also Release Notes.

Changes as of Version 3.0.0.0
Previous New Action

RevPi I/O modules are integrated into the base device.

RevPi I/O modules are independent devices.

RevPi I/O modules must be manually re-added.

Library name: IoDrvKunbusRevPiBridge

Library name: IoDrvRevPi

Remove old libraries

The following project components can be carried over unchanged in the existing project:

  • Task configuration

  • Application POUs and program logic

  • I/O mapping and module parameters

  • Fieldbus configuration

  • CODESYS WebVisu pages

  • Additional libraries

Prerequisites

✓ CODESYS Development System V3.5 SP22 is installed

RevPi I/O Driver for CODESYS V3.0.0.0 is installed on the CODESYS Development System

Creating a Reference Copy

▷ Create a copy of your project file.

▷ Open this copy in CODESYS in development mode.

▷ Do not update either the compiler version or the device in this copy. It will serve as a reference later.

Updating the Project Environment

▷ Create a second copy of your project file.

▷ Open this copy in CODESYS in development mode.

▷ In the project environment, update the compiler version to 3.5.22.0.

▷ Set all available updates to the latest version.

Updating Devices

▷ Update the RevPi base module in the device tree to version 3.0.0.0.

❯ The previously integrated RevPi I/O modules are removed from the project.

▷ Re-add the required RevPi I/O modules from the device catalog.

▷ Transfer the I/O mapping and module parameters from the reference copy to the project.

Updating Libraries

▷ Open the Library Manager in the device tree.

▷ Remove all references to older driver versions.

❯ Only the driver library IoDrvRevPi 3.0.0.0 should remain in the Library Manager.

Note

Using an older driver version together with the new version results in a compiler error.

Updating the Runtime

▷ Update the Runtime on the RevPi device to CODESYS Control Linux ARM 64 bit V4.18.0.0 or higher.

❯❯ The project can now be compiled and downloaded to the RevPi.

Setting Up the CODESYS Runtime as a Non-Root User #

As of CODESYS Control for Linux ARM64 V4.21, the codesyscontrol service no longer runs as root, but under its own system user codesyscontrol.

On RevPi devices with the operating system image RevPi Bookworm or higher, additional permissions and settings are required so that CODESYS can continue to access the RevPi I/O Driver and the PiCtory configuration.

The revpi-codesyscontrol-nonroot-fix.sh script automatically makes the necessary adjustments:

  • It sets up access to /dev/piControl0 for codesyscontrol,

  • creates a symbolic link to the PiCtory configuration config.rsc, and

  • restarts the CODESYS Runtime and checks the RevPi I/O Driver to apply the changes.

Note

Without these adjustments, the initialization of the RevPi I/O Driver fails. CODESYS is then unable to access the RevPi process image.

Prerequisites

RevPi Bookworm or higher is installed on the RevPi.

✓ CODESYS Control for Linux ARM64 V4.21 or higher is installed.

✓ If the PiCtory configuration is to be used by CODESYS: The Revolution Pi system is configured in PiCtory.

Transferring the Script to the RevPi

Download the script to your PC.

▷ Log in to the RevPi via a terminal.

▷ Copy the script to the RevPi, e.g. via SCP:

scp revpi-codesyscontrol-nonroot-fix.sh pi@<IP address>:~

Alternatively, you can transfer the script to the RevPi using a USB flash drive.

Running the Script

▷ Make the script executable:

chmod +x revpi-codesyscontrol-nonroot-fix.sh

▷ Run the script with root privileges:

sudo ./revpi-codesyscontrol-nonroot-fix.sh

❯ If the configuration is successful, the following message, among others, is output:

[OK] IoDrvUpdateConfiguration Success! — driver is running correctly

❯ It is also confirmed that the process is running under the user codesyscontrol:

[OK] codesyscontrol is running as 'codesyscontrol' — non-root confirmed

❯❯ CODESYS can now access the RevPi I/O Driver and the PiCtory configuration under the user codesyscontrol.

Troubleshooting
Message Action

[WARN] codesyscontrol is running as root

Check whether the service needs to be restarted or the package needs to be reinstalled.

[WARN] IoDrvUpdateConfiguration Success! not found

Check whether a CODESYS application is loaded and the RevPi I/O Driver is initialized correctly.

[WARN] Target _config.rsc not found

Check whether a PiCtory configuration is saved.

[INFO] No CODESYS application deployed yet

Load an application from the CODESYS Development System onto the RevPi.

Further Resources #