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

193 Commits
193 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
.github/workflows
.github/workflows
 
 
config/checkstyle
config/checkstyle
 
 
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

Maven Central

A modern, performant, easy to use client and server implementation of Modbus, supporting:

  • Modbus TCP
  • Modbus TCP Security (Modbus TCP with TLS)
  • Modbus RTU on Serial
  • Modbus RTU on TCP

Quick Start Examples

Modbus TCP Client

var transport = NettyTcpClientTransport.create(cfg -> {
  cfg.setHostname("172.17.0.2");
  cfg.setPort(502);
});

var client = ModbusTcpClient.create(transport);
client.connect();

ReadHoldingRegistersResponse response = client.readHoldingRegisters(
    1,
    new ReadHoldingRegistersRequest(0, 10)
);

System.out.println("Response: " + response);
byte[] responsePdu = client.sendRaw(1, new byte[] {(byte) 0x5A, 0x00, 0x01});

Modbus RTU on Serial Client

var transport = SerialPortClientTransport.create(cfg -> {
  cfg.setSerialPort("/dev/ttyUSB0");
  cfg.setBaudRate(115200);
  cfg.setDataBits(8);
  cfg.setParity(SerialPort.NO_PARITY);
  cfg.setStopBits(SerialPort.TWO_STOP_BITS);
});

var client = ModbusRtuClient.create(transport);
client.connect();

client.readHoldingRegisters(
    1,
    new ReadHoldingRegistersRequest(0, 10)
);

System.out.println("Response: " + response);

Maven

Modbus TCP

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

Modbus Serial

<dependency>
    <groupId>com.digitalpetri.modbus</groupId>
    <artifactId>modbus-serial</artifactId>
    <version>2.1.4</version>
</dependency>

Features

Supported Function Codes

Code Function Client Server
0x01 Read Coils ✅ ✅
0x02 Read Discrete Inputs ✅ ✅
0x03 Read Holding Registers ✅ ✅
0x04 Read Input Registers ✅ ✅
0x05 Write Single Coil ✅ ✅
0x06 Write Single Register ✅ ✅
0x0F Write Multiple Coils ✅ ✅
0x10 Write Multiple Registers ✅ ✅
0x16 Mask Write Register ✅ ✅
0x17 Read/Write Multiple Registers ✅ ✅
  • raw/custom PDUs on Modbus/TCP with MBAP framing, transaction correlation, and raw TCP server hooks
  • broadcast messages on Modbus/RTU
  • pluggable codec implementations
  • pluggable transport implementations

License

Eclipse Public License - v 2.0

About

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

Resources

Readme
License
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

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.