Skip to main content

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)


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 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


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

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: rajvir@codeandcompile.com or drop me a message on LinkedIn