GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - digitalpetri/modbus: Modbus TCP, Modbus TCP Security, Modbus RTU on Serial, and Modbus RTU on TCP for Java 17+.

BranchesTags
Open more actions menu

Latest commit

 

History

272 Commits
272 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
.github
.github
 
 
config/checkstyle
config/checkstyle
 
 
docs/user
docs/user
 
 
modbus-serial
modbus-serial
 
 
modbus-tcp
modbus-tcp
 
 
modbus-tests
modbus-tests
 
 
modbus
modbus
 
 
.git-blame-ignore-revs
.git-blame-ignore-revs
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
CLAUDE.md
CLAUDE.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

digitalpetri Modbus

Maven Central

digitalpetri Modbus is a Java 17 client and server library for Modbus TCP, Modbus TCP Security (TLS), Modbus RTU over serial, and Modbus RTU over TCP. It provides typed request and response PDUs, pluggable transports and codecs, and both synchronous and asynchronous client operations.

Reading holding registers from a Modbus TCP device looks like this:

var transport = NettyTcpClientTransport.create(cfg -> cfg.setHostname("10.0.0.100"));
var client = ModbusTcpClient.create(transport);

try (var ignored = client.open()) {
  var response = client.readHoldingRegisters(1, new ReadHoldingRegistersRequest(0, 2));
  System.out.println("register bytes: " + HexFormat.of().formatHex(response.registers()));
}

Installation and modules

Most applications depend on the transport module they use; Maven brings in the core modbus module transitively.

Module Use it for
modbus Core client/server APIs, PDUs, framing, services, and transport interfaces
modbus-tcp Netty transports for Modbus TCP, TCP with TLS, and RTU over TCP
modbus-serial jSerialComm transports for Modbus RTU over a serial port

For a Modbus TCP application:

<dependency>
  <groupId>com.digitalpetri.modbus</groupId>
  <artifactId>modbus-tcp</artifactId>
  <version>2.2.0</version>
</dependency>

See Installation and modules for serial coordinates, Java requirements, and module details.

Transport capabilities

Transport Client Server TLS
Modbus TCP Yes Yes Optional mutual TLS
Modbus RTU over serial Yes Yes No
Modbus RTU over TCP Yes Yes Optional mutual TLS

See the feature and transport matrix for typed function-code, raw-PDU, and broadcast support.

Documentation

The documentation index lists every how-to, concept, and reference page.

Common tasks:

  • Read and write over Modbus TCP
  • Communicate over serial RTU
  • Secure a Modbus TCP client with TLS
  • Expose data over Modbus TCP
  • Configure timeouts and reconnection
  • Troubleshoot communication

Concepts and reference:

  • Start with the Modbus mental model if the relationship among data areas, unit IDs, PDUs, and transports is unfamiliar.
  • Use Addressing, unit IDs, and data before translating a device manual into requests.
  • Browse the API reference links for generated Javadocs.

License

digitalpetri Modbus is licensed under the Eclipse Public License 2.0.

About

Modbus TCP, Modbus TCP Security, Modbus RTU on Serial, and Modbus RTU on TCP for Java 17+.

Topics

javamodbusmodbus-rtumodbus-securitymodbus-serialmodbus-tcpmodbus-tls

Resources

Readme
EPL-2.0 license
Activity
Custom properties

Stars

867 stars

Watchers

32 watching

Forks

255 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.