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
Modbus Register Map
Port 1 — Smart Light (BNI IOL-812-205-K037)
Port 2 — Laser / Photo-electric Sensor (BOS R254K-UUI-LH10-S4)
Port 3 — Condition Monitoring Sensor (BCM R15E-001-DI00-01,5-S4)
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 usableREAL value in OpenPLC, we need to:
- Read the High Word and Low Word from two consecutive registers
- Byte-swap them (Big-Endian → Little-Endian word order)
- 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. Theloop() 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
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
vPLC3.zip
Resources
Canva presentation
Key notes