cloudVirtual PLC interfacing with IO-Link Master

In this article, you will learn about vPLC integration with IO-Link master via MODBUS TCP/IP for real time vibration monitoring and signaling

Real-Time Vibration Monitoring with Smart Signaling via Modbus TCP/IP


What This Project Does

In this project, we use a reComputer running OpenPLC runtime (vPLC) to:

  • Read real-time vibration data (X, Y, Z axes + temperature) from a Balluff condition monitoring sensor

  • Detect objects using a laser photo-electric sensor

  • Drive a Balluff Smart Light as a visual signal output

  • All sensor communication happens through a Balluff IO-Link Master over Modbus TCP/IP


System Architecture

The vPLC connects to the IO-Link Master as a Modbus TCP Client, polling sensor data every scan cycle.


Modbus Register Map

🟢 Port 1 — Smart Light (BNI IOL-812-205-K037)

Register No.
PLC Register
Function

1117

QW0

Smart Light State

1118

QW1

Mode

1120 ~ 1124

QW3 ~ QW7

Seg1 ~ Seg5


🔵 Port 2 — Laser / Photo-electric Sensor (BOS R254K-UUI-LH10-S4)

Register No.
PLC Register
Function

1201

IW10

Object Detection


🟠 Port 3 — Condition Monitoring Sensor (BCM R15E-001-DI00-01,5-S4)

Register No.
PLC Register
Function

1300

IW0

Status

1301 ~ 1302

IW1 ~ IW2

X-VRMS

1303 ~ 1304

IW3 ~ IW4

Y-VRMS

1305 ~ 1306

IW5 ~ IW6

Z-VRMS

1307 ~ 1308

IW7 ~ IW8

Temp.


Converting Modbus Words to REAL Float Values

The Balluff condition monitoring sensor sends each float value (e.g., X-VRMS) split across 2 x 16-bit Modbus registers in Big-Endian format.

To get a usable REAL value in OpenPLC, we need to:

  1. Read the High Word and Low Word from two consecutive registers

  2. Byte-swap them (Big-Endian → Little-Endian word order)

  3. Reassemble into a 32-bit IEEE 754 float using memcpy

📐 Byte Swap Example

C++ Function Block (Custom OpenPLC Extension)

This logic runs inside a C++ Function Block registered in OpenPLC. The loop() function executes every scan cycle.

⚠️ Key insight: Simply casting the INT values to REAL will give you garbage. The byte swap is mandatory because Balluff uses Big-Endian word ordering, while OpenPLC/x86 is Little-Endian.

C++ Print Code Function Block


Main Program


Hardware Used

Component
Model

Edge Computer (vPLC host)

Seeed reComputer

IO-Link Master

Balluff BNI00L3

Smart Light

Balluff BNI IOL-812-205-K037

Laser / Photo-electric Sensor

Balluff BOS R254K-UUI-LH10-S4

Condition Monitoring Sensor

Balluff BCM R15E-001-DI00-01,5-S4

PLC Runtime

OpenPLC Runtime v3 (vPLC)


Source Code

🔗 Source files for this project are available in the following zip file or you can access it here: https://editor.autonomylogic.com/?project_id=cmmtfduw800hd07n3kzotofxv

file-archive
5KB
archive

🔗 Resources

Key notes

♥️ Work With Me

I regularly test industrial automation and IIoT devices. If you’d like me to review your product or showcase it in my courses and YouTube channel:

📧 Email: [email protected] or drop me a message on LinkedInarrow-up-right

Last updated