All Projects → zengfr → Easymodbus4j

zengfr / Easymodbus4j

Licence: apache-2.0
easymodbus4j是一个高性能和易用的 Modbus 协议的 Java 实现,基于 Netty 开发,可用于 Modbus协议的Java客户端和服务器开发, A high-performance and ease-of-use implementation of the Modbus protocol written in Java netty support for modbus 4 mode..

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Easymodbus4j

Netty Learning Example
🥚 Netty实践学习案例,见微知著!带着你的心,跟着教程。我相信你行欧。
Stars: ✭ 2,146 (+1963.46%)
Mutual labels:  iot, netty
Fuxa
Web-based Process Visualization (SCADA/HMI/Dashboard) software
Stars: ✭ 262 (+151.92%)
Mutual labels:  iot, modbus
Oshmi
SCADA HMI for substations and automation applications.
Stars: ✭ 180 (+73.08%)
Mutual labels:  iot, modbus
Jetlinks Community
JetLinks 基于Java8,Spring Boot 2.x ,WebFlux,Netty,Vert.x,Reactor等开发, 是一个全响应式的企业级物联网平台。支持统一物模型管理,多种设备,多种厂家,统一管理。统一设备连接管理,多协议适配(TCP,MQTT,UDP,CoAP,HTTP等),屏蔽网络编程复杂性,灵活接入不同厂家不同协议等设备。实时数据处理,设备告警,消息通知,数据转发。地理位置,数据可视化等。能帮助你快速建立物联网相关业务系统。
Stars: ✭ 2,405 (+2212.5%)
Mutual labels:  iot, netty
Iot push
基于netty+mqtt3.1.1+springboot+jdk8 实现的 mqtt 服务端跟客户端
Stars: ✭ 353 (+239.42%)
Mutual labels:  iot, netty
Actorcloud
Open-source IoT Platform
Stars: ✭ 138 (+32.69%)
Mutual labels:  iot, modbus
Ohsce
PHP HI-REL SOCKET TCP/UDP/ICMP/Serial .高可靠性PHP通信&控制框架SOCKET-TCP/UDP/ICMP/硬件Serial-RS232/RS422/RS485 AND MORE!
Stars: ✭ 206 (+98.08%)
Mutual labels:  iot, modbus
Iot Technical Guide
🐝 IoT Technical Guide --- 从零搭建高性能物联网平台及物联网解决方案和Thingsboard源码分析 ✨ ✨ ✨ (IoT Platform, SaaS, MQTT, CoAP, HTTP, Modbus, OPC, WebSocket, 物模型,Protobuf, PostgreSQL, MongoDB, Spring Security, OAuth2, RuleEngine, Kafka, Docker)
Stars: ✭ 2,334 (+2144.23%)
Mutual labels:  iot, modbus
Plc4x
PLC4X The Industrial IoT adapter
Stars: ✭ 317 (+204.81%)
Mutual labels:  iot, modbus
Socket Mqtt
基于Netty+MQTT的高性能推送服务框架。支持普通Socket、MQTT、MQTT web socket协议。非常方便接入上层业务实现推送业务。
Stars: ✭ 314 (+201.92%)
Mutual labels:  iot, netty
Blynk Server
Blynk is an Internet of Things Platform aimed to simplify building mobile and web applications for the Internet of Things. Easily connect 400+ hardware models like Arduino, ESP8266, ESP32, Raspberry Pi and similar MCUs and drag-n-drop IOT mobile apps for iOS and Android in 5 minutes
Stars: ✭ 8 (-92.31%)
Mutual labels:  iot, netty
Hslcommunication
An industrial IoT underlying architecture framework, focusing on the underlying technical communications and cross-platform, cross-language communication functions, to achieve a variety of mainstream PLC data reading and writing, to achieve modbus of various protocols read and write, and so on, to support the rapid construction of industrial upper computer software, configuration software, SCADA software, factory mes system, To help enterprise Industry 4.0 take-off, to achieve intelligent manufacturing, smart factory goals. The main PLC contains Siemens, Mitsubishi, Omron, Panasonic, Modbus, AB-PLC, Redis
Stars: ✭ 816 (+684.62%)
Mutual labels:  iot, modbus
Iotclient
这是一个物联网设备通讯协议实现客户端,将会包括主流PLC通信读取、ModBus协议、Bacnet协议等常用工业通讯协议。本组件终身开源免费,采用最宽松的MIT开源协议,您可以随意修改和商业使用(商业使用请做好评估和测试)。
Stars: ✭ 311 (+199.04%)
Mutual labels:  iot, modbus
Groza
开源物联网平台 - 物联网解决方案的设备管理,数据收集,处理
Stars: ✭ 364 (+250%)
Mutual labels:  iot, netty
Thingsboard
Open-source IoT Platform - Device management, data collection, processing and visualization.
Stars: ✭ 10,526 (+10021.15%)
Mutual labels:  iot, netty
Awtrix1.0
(Outdated) Smart RGB Matrix Clock
Stars: ✭ 99 (-4.81%)
Mutual labels:  iot
Dapeng Soa
A lightweight, high performance micro-service framework
Stars: ✭ 101 (-2.88%)
Mutual labels:  netty
Wifimeshraspberrypi
Workshop to create a sensor application over a WiFi Mesh network
Stars: ✭ 99 (-4.81%)
Mutual labels:  iot
Mainflux
Industrial IoT Messaging and Device Management Platform
Stars: ✭ 1,341 (+1189.42%)
Mutual labels:  iot
Home Assistant Configuration
My Home Assistant Config. For more Information visit ->
Stars: ✭ 102 (-1.92%)
Mutual labels:  iot

easymodbus4j运行效果图截屏

easymodbus4j

easymodbus4j是一个高性能和易用的 Modbus 协议的 Java 实现,基于 Netty 开发,可用于 Modbus协议的Java客户端和服务器开发. easymodbus4j A high-performance and ease-of-use implementation of the Modbus protocol written in Java netty support for modbus 8 mode client/server and master/slave.

easymodbus4j 特点:
1、Netty NIO high performance高性能.
2、Modbus Function sync/aync 同步/异步非阻塞。
3、Modbus IoT Data Connector Supports工业物联网平台IoT支持。
4、支持Modbus TCP\Modbus RTU protocol两种通信协议.
5、灵活架构,支持8种生产部署模式,自由组合,满足不同生产要求.
6、通用组件包,支持高度自定义接口.
7、完全支持Modbus TCP 4种部署模式: TCP服务器master,TCP客户端slave,TCP服务器slave,TCP客户端master。
8、完全支持Modbus RTU 4种部署模式: RTU服务器master,RTU客户端slave,RTU服务器slave,RTU客户端master。
9、友好的调试以及日志支持bit\bitset\byte\short\int\float\double。
10、Supports Function Codes:
Read Coils (FC1)
Read Discrete Inputs (FC2)
Read Holding Registers (FC3)
Read Input Registers (FC4)
Write Single Coil (FC5)
Write Single Register (FC6)
Write Multiple Coils (FC15)
Write Multiple Registers (FC16)
Read/Write Multiple Registers (FC23)

#Example Project Code in https://github.com/zengfr/easymodbus4j

Repositories Central Sonatype Mvnrepository easymodbus4j

artifactId/jar:
easymodbus4j-core.jar   	Modbus protocol协议
easymodbus4j-codec.jar  	Modbus 通用编码器解码器
easymodbus4j.jar        	Modbus General/Common公共通用包
easymodbus4j-client.jar 	Modbus client客户端
easymodbus4j-server.jar 	Modbus server服务器端
easymodbus4j-extension.jar  Modbus extension扩展包 ModbusMasterResponseProcessor/ModbusSlaveRequestProcessor interface
快速开发Quick Start:
第一步step1 ,import jar:
maven:
<dependency>
<groupId>com.github.zengfr</groupId>
<artifactId>easymodbus4j-client</artifactId>
<version>0.0.5</version>
</dependency>
<dependency>
<groupId>com.github.zengfr</groupId>
<artifactId>easymodbus4j-server</artifactId>
<version>0.0.5</version>
</dependency>
<dependency>
<groupId>com.github.zengfr</groupId>
<artifactId>easymodbus4j-extension</artifactId>
<version>0.0.5</version>
</dependency>

第二步step2, implement handler:
2.1 if master 
      实现implement ResponseHandler接口 see easymodbus4j-example:ModbusMasterResponseHandler.java 
  or 实现implement ModbusMasterResponseProcessor 接口 use new ModbusMasterResponseHandler(responseProcessor); 
  
2.2 if slave 
    实现implement RequestHandler接口 see easymodbus4j-example:ModbusSlaveRequestHandler.java 
 or 实现implement ModbusSlaveRequestProcessor 接口 use new ModbusSlaveRequestHandler(reqProcessor); 

第三步step3, select one master/slave client/server mode:
modbusServer = ModbusServerTcpFactory.getInstance().createServer4Master(port, responseHandler);
modbusClient = ModbusClientTcpFactory.getInstance().createClient4Slave(host,port, requestHandler);

modbusClient = ModbusClientTcpFactory.getInstance().createClient4Master(host, port, responseHandler);
modbusServer = ModbusServerTcpFactory.getInstance().createServer4Slave(port, requestHandler);

modbusServer = ModbusServerRtuFactory.getInstance().createServer4Master(port, responseHandler);
modbusClient = ModbusClientRtuFactory.getInstance().createClient4Slave(host,port, requestHandler);

modbusClient = ModbusClientRtuFactory.getInstance().createClient4Master(host, port, responseHandler);
modbusServer = ModbusServerRtuFactory.getInstance().createServer4Slave(port, requestHandler);

第四步step4:
4.1 how to send a request ? to send data
Thread.sleep(3*1000);// sleep 3s before,when client or server open connection is async;
Channel  channel =  client.getChannel());
Channel  channel =  server.getChannelsBy(...));
ChannelSender sender = ChannelSenderFactory.getInstance().get(channel);
ChannelSender sender2 = new ChannelSender(channel,unitId,protocolIdentifier);
sender.readCoils(...)
sender.readDiscreteInputs(...)
sender.writeSingleRegister(...)

4.2 how to process request/response? to receive data
see code in processResponseFrame mothod in  ModbusMasterResponseHandler.java or ModbusMasterResponseProcessor.java
public void processResponseFrame(Channel channel, int unitId, AbstractFunction reqFunc, ModbusFunction respFunc) {
		if (respFunc instanceof ReadCoilsResponse) {
			ReadCoilsResponse resp = (ReadCoilsResponse) respFunc;
			ReadCoilsRequest req = (ReadCoilsRequest) reqFunc;
			//process business logic for req/resp
		}
};
4.3 how to get response to byteArray for custom decode by yourself?
see code in processResponseFrame mothod in  ModbusMasterResponseHandler.java or ModbusMasterResponseProcessor.java
public void processResponseFrame(Channel channel, int unitId, AbstractFunction reqFunc, ModbusFunction respFunc) {
		if (respFunc instanceof ReadDiscreteInputsResponse) {
			ReadDiscreteInputsResponse resp = (ReadDiscreteInputsResponse) respFunc;
			byte[] resutArray = resp.getInputStatus().toByteArray();
		}
};	
4.4 how to show log? 
see ModbusMasterResponseHandler.java in example project.
ModbusFrameUtil.showFrameLog(logger, channel, frame);

4.5 how to custom a client/server advance by yourself?
ModbusChannelInitializer modbusChannelInitializer=...;
ModbusServerTcpFactory.getInstance().createServer4Master(port,modbusChannelInitializer);

#Example Project Code example1 example3

other example1 other example3

Example run startup:
1、unzip file easymodbus4j-example-0.0.5-release.zip.
2、for modbus master mode:open autosend.txt file in dir or autosend.txt rsourcefile in easymodbus4j-example-0.0.5.jar 
3、for modbus master mode:edit autosend.txt file
4、start startup.bat.
5、you also can edit *.bat for modbus master/salve mode: .
说明:
1、解压缩zip文件到文件夹
2、java程序 运行不了 则安装jdk8.
3、解压后8个bat文件  对应TCP/RTU 服务器master,客户端slave,服务器slave,客户端master 8种模式.
4、Master模式 可以设置autosend.txt文件,定时发送读写请求。
5、记事本打开bat文件可以编辑相关参数,如定时延时发送时间以及详细日志开关。

capture运行效果图截屏: easymodbus4j运行效果图截屏1 easymodbus4j运行效果图截屏2 easymodbus4j运行效果图截屏3 easymodbus4j运行效果图截屏4

capture运行效果图截屏: easymodbus4j运行效果图截屏1 easymodbus4j运行效果图截屏2 easymodbus4j运行效果图截屏3 easymodbus4j运行效果图截屏4

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].