Home About us Support Partners SIGN UP NOW
Data acquisition

Data Acquisition

Data acquisition is the process of collecting and measuring electrical or physical phenomena such as voltage, current, temperature, pressure, or sound with sensors, instruments, and other devices. It is a critical component in modern industrial automation, enabling the collection and analysis of data to optimize processes, ensure safety, and improve efficiency.

Most of the machines will have these interfaces connected to the Programming Logic Control (PLC) Unit. The PLC will be having support for the interfacing protocols like Modbus, OPCUA , Profinet, Profibus, Ethernet, IO Link and FANUC. These protocols have standard data transfer means which can be interfaced to collect these information without incorporating physical sensors or interface.

When integrated with MQTT (Message Queuing Telemetry Transport), data acquisition becomes even more powerful. MQTT is a lightweight messaging protocol designed for low-bandwidth, high-latency, and unreliable networks, making it ideal for IoT and industrial applications. By utilizing MQTT, data from various sources can be transmitted efficiently and reliably to a central system or cloud platform. This enables real-time monitoring, remote control, and data analytics, facilitating smarter decision-making and operational improvements. MQTT's publish/subscribe model ensures scalability and flexibility, allowing for seamless integration of multiple data acquisition devices and systems.

In this guide, we'll explore how to acquire data from Programmable Logic Controllers (PLCs), analog I/O, digital I/O, and integrate with a plain TCP server.

Challenges of Data Acquisition: IT & OT Integration

Integrating IT and OT systems for data acquisition involves addressing differences in data handling and communication. IT systems focus on data processing and analytics, while OT systems are geared towards real-time operational control. This disparity can complicate the process of translating and harmonizing data from various sources. Effective integration requires overcoming these differences by standardizing data formats and protocols, ensuring that data from both IT and OT environments is accurately captured and utilized. Implementing robust data management strategies helps bridge the gap, enabling efficient data flow and seamless interaction between systems.

IT & OT Integration

Architecture for data acquisition
using MQTT

The diagram below illustrates a typical architecture for data acquisition using MQTT via Modbus from PLC, analog I/O, digital I/O, and integration with a plain TCP server. This setup highlights how various components interact to ensure efficient data collection and transmission.

Data acquisition architecture

Common Architecture for Data Acquisition
Using MQTT Broker

In this architecture, the PLC communicates with various protocols enabled devices. Analog I/O Devices and Digital I/O Devices send data to the Data Acquisition Module, which processes and converts the data from analog and digital I/O devices. The TCP Client receives data from a plain TCP server. The Modbus Client, Data Acquisition Module, and TCP Client then publish the collected data to the MQTT Broker. MQTT Subscribers, such as applications, monitoring dashboards, or cloud platforms, subscribe to the relevant MQTT topics to receive real-time data.

This architecture provides a clear and scalable framework for integrating various data sources and ensuring real-time data transmission and monitoring via MQTT.

Data acquisition from PLC via Modbus

Data acquisition from PLCs using the Modbus protocol is a widely adopted method in industrial automation. Modbus is a communication protocol that allows for easy exchange of data between devices. By leveraging MQTT for data transport, we can achieve efficient and scalable data communication

Setting up Modbus on PLCs

To initiate the integration of Modbus with PLCs, follow the steps below:

Enable Modbus Server on the PLC
  • Access the PLC's configuration software (e.g., Siemens TIA Portal, Delta WPLSoft, Mitsubishi GX Works).
  • Enable the Modbus server functionality within the PLC's settings.
Connecting to PLC
  • Establish a connection to the PLC using Modbus TCP/IP or Modbus RTU, depending on your network infrastructure and PLC model.
  • Configure network settings such as IP addresses and ports to ensure proper communication.
Configuring Modbus:
  • Set up the Modbus client on your data acquisition device.
  • Define the registers and data points you wish to read from the PLC.
  • Map these registers to specific data types based on your application requirements.
MQTT Integration
  • Utilize an MQTT broker to facilitate data transmission.
  • Publish the acquired data to the MQTT topics dedicated to real-time monitoring and analysis.

Setting up Modbus with various PLCs

Here are the integration steps for Modbus with various PLCs.

Siemens PLC Integration

In Siemens TIA portal :

  • Enable the Modbus TCP/IP server functionality.
  • Configure Ethernet settings and define Modbus data points.
  • Establish a connection from your Modbus client device to the PLC using the configured IP address and port.

Delta PLC Integration

Using Delta WPLSoft :

  • Enable Modbus RTU or Modbus TCP communication modes.
  • Specify Modbus parameters such as baud rate and slave address.
  • Ensure proper network configuration and establish connectivity with your Modbus client.

Mitsubishi PLC Integration

With Mitsubishi GX works :

  • Enable Modbus protocol (RTU or TCP) and configure communication settings.
  • Define Modbus data mapping and setup network parameters.
  • Establish a reliable connection between the PLC and your Modbus client device.

Allen-Bradley PLC Integration:

Using Allen-Bradley Studio 5000:

  • Configure Modbus communication via third-party modules or add-ons compatible with Modbus TCP/IP.
  • Defix ne data structures and tags within Studio 5000 for Modbus communication.
  • Ensure proper configuration of Ethernet/IP settings and establish connectivity with your Modbus client.

Connecting Analog I/O Devices:

Interface your analog sensors with a data acquisition module.

Ensure proper calibration and signal conditioning.

Data Conversion:

Convert the analog signals to digital using an ADC (Analog-to-Digital Converter).

Scale and format the data for transmission.

MQTT Integration:

Publish the digital data to MQTT topics.

Enable real-time data monitoring and control through MQTT subscribers.

Data acquisition from Analog I/O

Analog I/O devices are crucial for capturing real-world signals, such as temperature, pressure, and flow rates. Acquiring data from these devices involves converting analog signals to digital values that can be processed and transmitted.

Data acquisition from Digital I/O

Digital I/O devices provide binary signals (on/off) used for monitoring and control in various applications. Data acquisition from digital I/O involves reading the state of digital inputs and controlling digital outputs.

Connecting Digital I/O Devices:

  • Interface your digital sensors or actuators with a data acquisition module.
  • Configure the digital inputs and outputs.

Data Processing:

  • Read the state of digital inputs.
  • Control the state of digital outputs based on application requirements.

MQTT Integration:

  • Publish the state of digital inputs and outputs to MQTT topics.
  • Enable real-time monitoring and control through MQTT subscribers.

Integration with Plain TCP Server

Integrating data acquisition systems with a plain TCP server provides flexibility and interoperability. TCP/IP is a fundamental protocol suite for network communication, enabling seamless data exchange between devices.

Data Transmission:

  • Transmit acquired data over the TCP connection.
  • Ensure reliable data transfer with appropriate error handling mechanisms.

Establishing a TCP Connection:

  • Set up a TCP server to receive data.
  • Configure the data acquisition device as a TCP client.

MQTT Integration:

  • Publish the received data to MQTT topics.
  • Leverage MQTT's advantages for real-time data distribution and scalability.

Implementing Data Acquisition

Implementing data acquisition methods like Modbus, MQTT, and additional protocols across various platforms and languages is crucial for robust IoT and industrial automation solutions. Here, we explore libraries, examples, cross-platform considerations, and best practices for seamless integration.

Modbus data acquisition libraries
and examples

Modbus is a widely used communication protocol in industrial automation for connecting electronic devices. It facilitates reliable data exchange between control systems and devices such as PLCs.

Python:

pyModbusTCP, Example

Compatible with Windows, Linux (Ubuntu), and Raspberry Pi.

Java

j2mod, Example

Runs on Windows and Linux platforms.

JavaScript

Modbus-serial, Example

Supports Windows, Linux, and Raspberry Pi.

ESP32 (Microcontroller)

ESP32 Modbus RTU, Example

Designed for ESP32, compatible with ESP IDF.


MQTT Data Acquisition Libraries & Examples

MQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol ideal for IoT applications. It enables efficient communication between devices, ensuring reliable data transmission even in constrained networks.

Python:

paho-mqtt, Example

Compatible with Windows, Linux (Ubuntu), and Raspberry Pi.

JavaScript (Node.js):

mqtt.js, Example

Runs on Windows, Linux, and Raspberry Pi.

ESP32 (Microcontroller):

PubSubClient, Example

Optimized for ESP32 platform, compatible with Arduino IDE.

Swift (iOS):

CocoaMQTT, Example

Developed for iOS/macOS environments.

OPC-UA Data Acquisition Libraries
and Examples:

OPC-UA (Open Platform Communications Unified Architecture) is a standardized communication protocol for industrial automation. It enables secure and reliable data exchange between machines, ensuring interoperability and scalability across different platforms.

Python:

FreeOpcUa, Example

Works on Windows, Linux, and Raspberry Pi.

C#

OPC UA .NET Standard Library, Example

Compatible with Windows and Linux environments.

Node.js:

node-opcua, Example

Supports Windows and Linux platforms.

Arduino (ESP32/ESP8266):

Arduino OPC-UA Library, Example

Conclusion

Incorporating data acquisition for MQTT via Modbus from PLC, analog I/O, digital I/O, and integrating with a plain TCP server offers a robust solution for industrial automation and monitoring. By leveraging these methods, you can achieve real-time data visibility, improved operational efficiency, and enhanced decision-making capabilities.

Lets Get Started

Looking to optimize your industrial data management & monitoring?

Reach out today to discover how we can help streamline your processes and enhance operational efficiency.