
Most industrial controllers speak proprietary protocols. A Siemens PLC speaks S7. A Beckhoff speaks ADS. A Rockwell speaks EtherNet/IP. If your application needs to read data from all three, you traditionally need three vendor-specific SDKs, three sets of documentation, and three integration codepaths.
PLC4X replaces that with one library and one API. You write your application once against the PLC4X API, swap out a connection string to talk to a different PLC type, and the library handles the protocol translation. It speaks the PLC's native protocol directly — no OPC-UA server required on the PLC side, no middleware, no gateway device.
Developed under the Apache Software Foundation since 2017, graduated to Top-Level Project in 2019.
PLC4X is a library, not a standalone application. You embed it in your software — a custom data collector, a Kafka Connect pipeline, an Apache StreamPipes adapter, or an Eclipse BaSyx data provider.
The core abstraction is a PlcConnection. You open a connection with a protocol-specific URL (s7://192.168.1.10/0/1 for a Siemens S7-1500, modbus-tcp://192.168.1.20 for Modbus), then read or write tags using a common API regardless of the underlying protocol. The library handles connection management, protocol encoding/decoding, and type conversion.
Protocol support varies by language. Java has the most drivers (15+). Go, Python, and C are catching up but currently support fewer protocols — check the compatibility matrix on the PLC4X website before committing to a non-Java implementation.
PLC4X reads data directly using the PLC's native protocol, which typically offers lower latency than going through an OPC-UA server layer. On many PLCs, the OPC-UA server is an afterthought — an application running on the same CPU that internally uses the native protocol anyway. PLC4X cuts out that intermediary. This matters for time-sensitive data collection at sub-second intervals.
PLC4X is a library — you add it as a dependency, not install it as a service.
Java (Maven):
<dependency>
<groupId>org.apache.plc4x</groupId>
<artifactId>plc4j-driver-s7</artifactId>
<version>0.12.0</version>
</dependency>
Minimal read example:
try (PlcConnection conn = PlcDriverManager.getDefault()
.getConnectionManager()
.getConnection("s7://192.168.1.10/0/1")) {
PlcReadResponse response = conn.readRequestBuilder()
.addTagAddress("temp", "%DB1.DBD0:REAL")
.build().execute().get();
float temperature = response.getFloat("temp");
}
If you don't want to write code, the Kafka Connect adapter lets you stream PLC data into Kafka by writing a JSON config file — no custom application needed. StreamPipes also uses PLC4X under the hood, providing a no-code UI on top.
StreamPipes uses PLC4X as its connectivity layer for S7, Modbus, and other PLC protocols. PLC4X handles the low-level protocol communication while StreamPipes provides the visual pipeline editor and analytics on top.
BaSyx uses PLC4X as a data provider component for bridging PLC protocols into the Asset Administration Shell world.