Beckhoff ADS-over-MQTT a communication extension that allows the standard Automation Device Specification (ADS) protocol to run over instead of traditional TCP/IP . This enables secure, publisher/subscriber-based communication for TwinCAT systems, making it highly effective for IoT and cloud-integrated industrial applications. Key Features & Capabilities Media Independence: ADS-over-MQTT leverages the MQTT protocol as a built-in transport layer, allowing ADS applications to benefit from a decentralized communication pattern. Enhanced Security: It natively supports Transport Layer Security (TLS) , ensuring that industrial data remains protected during transmission across external networks. Unified Topic Structure: Devices use a standardized topic structure on the message broker based on their AMS Net ID , ensuring organized and predictable data routing. Ease of Integration: It is transparent to end-user applications; standard ADS commands (Read, Write) still work as intended, but are routed via MQTT. Typical Implementation Workflow Quick Start - Beckhoff Information System - English
Bridging the Gap: Implementing Beckhoff ADS over MQTT for Modern IIoT Architectures Introduction In the world of industrial automation, two protocols dominate very different niches. On one side, we have TwinCAT ADS (Automation Device Specification) , Beckhoff’s high-performance, real-time-capable protocol used for communication between TwinCAT modules and external applications. On the other side, we have MQTT (Message Queuing Telemetry Transport) , the lightweight, publish/subscribe network protocol that has become the de facto standard for the Internet of Things (IoT) and Industry 4.0. Connecting these two worlds—supervisory control and data acquisition (SCADA) and cloud analytics—is a common challenge. The phrase "Beckhoff ADS over MQTT" refers to the architectural pattern of bridging the real-time, deterministic world of PLCs to the scalable, asynchronous world of IoT messaging. This article explores why , how , and best practices for implementing ADS communication over MQTT.
Part 1: Understanding the Fundamentals What is Beckhoff ADS (Automation Device Specification)? ADS is a protocol layer within the TwinCAT system. It allows any ADS-enabled device (PLC, HMI, Drive, or even a third-party software) to read/write variables and invoke methods on another device. It is connection-oriented , uses AMS NetId addressing, and is incredibly fast for local networks. However, ADS struggles with high-latency networks, firewalls, and internet routing. What is MQTT? MQTT is a publish/subscribe protocol that runs over TCP/IP. A client connects to a central broker (e.g., Mosquitto, EMQX, HiveMQ). The client can publish data to a topic (e.g., factory/line1/temperature ) or subscribe to topics to receive data. It is lightweight, uses minimal bandwidth, handles intermittent connectivity gracefully, and is firewall-friendly (typically port 1883 or 8883 for TLS). The Core Problem: Why not just use ADS directly?
Firewalls & NAT: ADS uses dynamic ports (e.g., 48898 for router notifications) which are impossible to route over the internet securely. Cloud Latency: ADS expects low-jitter, low-latency responses (milliseconds). Cloud APIs can take seconds. Scalability: A single SCADA system can handle 100 ADS devices, but 10,000 IoT sensors publishing to a broker is easier with MQTT. Data Volume: ADS is chatty. MQTT allows for batching and edge filtering. beckhoff ads over mqtt
Part 2: Architectural Patterns for ADS over MQTT There is no "native" ADS-over-MQTT protocol. Instead, engineers use a gateway pattern . Here are the three most common architectures. Pattern 1: The Edge Gateway (OPC UA to MQTT) Most common for existing Beckhoff systems.
How it works: A Beckhoff PLC runs ADS. A separate edge device (Raspberry Pi, industrial PC, or even a Docker container) runs an OPC UA client to read ADS data via TwinCAT OPC UA Server. That edge device then maps the OPC UA nodes to MQTT topics. Pros: No code changes on the PLC. Uses standard TwinCAT features. Cons: Requires an OPC UA license and additional hardware.
Pattern 2: Native TwinCAT 3 Library (Tc2_MQTT) Best for new projects. serializes it (JSON
How it works: Beckhoff provides the TF6701 (TwinCAT 3 IoT Communication) and the Tc2_MQTT library. This allows you to write Structured Text (ST) or C++ code inside the PLC that directly connects to an MQTT broker. Data flow: PLC reads an internal ADS variable ( GVL.temperature ), serializes it (JSON, CBOR, or plain text), and calls FB_MQTT_Publish . The data travels from the PLC’s Ethernet port directly to the broker. Pros: No middleman. Low latency. One device. Cons: Consumes PLC processing power. Requires understanding of TLS certificates on a PLC.
Pattern 3: Cloud Connector / Database Bridge A hybrid approach for historians.
How it works: An industrial middleware (e.g., Node-RED, Telegraf, Azure IoT Edge) uses an ADS driver to poll the PLC. It then forwards the data to an MQTT broker, often with buffering and data shaping. Example: Node-RED running the node-red-contrib-ads package reads MAIN.bFanStatus every second and publishes it to factory/fan/status . or plain text)
Part 3: Step-by-Step Implementation (Using TwinCAT 3 and Mosquitto) Let’s build a simple proof of concept using Pattern 2 (Tc2_MQTT) . Prerequisites
TwinCAT 3 (Build 4024 or later) TF6701 – TwinCAT 3 IoT Communication (licensed) An MQTT broker (e.g., Mosquitto running on 192.168.0.100 ) A Beckhoff PLC with an accessible Ethernet port.
Запросить товар