PLCNext Tutorials and Code

plcnext_tutorials

Documentation and Code for PLCNext

Versions used in this repository:

  • AXC F 2152 Controller running firmware 25.0.3

  • PLCNext Engineer 2025.9

  • sdk version 2025.0

Credits: Alexander Minor, Fall Internship 2025

Examples

##

Name

Description

01

SimpleIOReadWrite

Control the IO of the controller in a real-time cpp program

02

NoEngineerHelloWorld

Create a cpp real-time program that uses logging and deploy it to the controller withouth using PLCNext Engineer

03

RestCommunication

Uses a cpp real-time program to read and write IO from the controller and also makes it available to the rest interface, through which it also receives commands to set the output.

04

MqttCommunication

Read the IO from the PLCNext starter kit, sends it over MQTT to a broker using the IIot Library by PlcNext.

05

GrpcRemoteCommunication

How to read and write controller data remotely using grpc. An example using the command-line tool grpcurl and python is provided.

06

GrpcLocalCommunication

How to read and write controller data localy using grpc running on python on the controller itself. Employs a podman container to use python.

07

OpcUaCommunication

Read controller data remotely by connecting to the OPC UA server of the controller. An example using the program UaExpert is provided.

08

ToasterOven

An extensive example project utilizing ladder logic, cpp real-time programs, the rest interface, and remote grpc.

General Ressources

Tutorials

Installation & Setup on Linux

How to install all dependencies and tools necessary to work with plcnext. All the steps are valid for ubuntu linux.

PLCNext Technology Toolchain (plcncli)

Download the right version from here

Run the executable:

/bin/sh PLCnext_Toolchain_2024.6.sh

Press q and then y to accept the license.

Move the folder to /opt and link the file:

sudo ln -sf /opt/PLCnext_Toolchain/plcncli /usr/bin/plcncli

Test if plcncli is accessible:

plcncli --version

PLCNext SDK (for AXC F 2125)

Download axcf2152 2025.0.3 sdk from here (Pick the right version and operating system under Software)

Navigate to where the download got saved and run:

chmod a+x axcf2152-linux_sdk-2025.0.3-25.0.3.99.sh
sudo mkdir -p 
sudo mkdir /opt/pxc/2025.0 -p
sudo chown $USER:$USER /opt/pxc/ -R

Install the sdk with plcncli:

plcncli install sdk --path axcf2152-linux_sdk-2025.0.3-25.0.3.99.sh -d /opt/pxc/2025.0

Connect AXC F 2125 on Linux

When plugging the controller directly into the computer via ethernet while using Wifi for internet:

Find Device Name of Ethernet:

nmcli device

Create connection:

nmcli con add con-name "plc-con" ifname <device name> type ethernet

Configure connection:

nmcli con modify plc-con ipv6.method disabled
nmcli con modify plc-con ipv4.method shared ipv4.addresses 192.168.1.1/24

Enable and test connection:

nmcli con up plc-con
ping 192.168.1.10 (address of controller)
ping github.com (Check if internet works)

Installation & Setup on Windows

How to install all dependencies and tools necessary to work with plcnext. All the steps are tested on Windows 11.

Install PLCNext Engineer

Download from here

Install plcncli

Download from here

Install sdk for AXC F 2152

Download axcf2152 2025.0.3 sdk from here (Pick the right version and operating system under Software)

Install and setup Eclipse (when working on cpp projects)

Follow instructions from here and here

Connect AXC F 2125 on Windows

Connecting to the controller via ethernet:

  • https://www.realpars.com/blog/plcnext-engineer

  • https://www.realpars.com/blog/phoenix-contact-plcnext