Modbus TCP学习笔记

  1. 功能码列表:

0x01 读线圈状态(Read Coils)

0x02 读离散输入状态(Read Discrete Inputs )

0x03 读保持寄存器(Read Holding Registers )

0x04 读输入寄存器(Read Input Registers)

0x05 写单线圈(Write Single Coil )

0x06 写单寄存器(Write Single Register)

0x07 读取异常状态(限串行线)(Read Exception Status (Serial Line only) )

0x08 通信系统诊断(限串行线)(Diagnostics (Serial Line only) )

0x09-0x0A无

0x0B 获取串行通信事件计数器(Get Comm Event Counter (Serial Line only) )

0x0C 获取串行通信事件日志 ( Get Comm Event Log (Serial Line only) )

0x0D-0x0E无

0x0F 写多个线圈(Write Multiple Coils)

0x10 写多个寄存器(Write Multiple registers)

0x11 报告服务器ID(仅串行线)(Report Server ID (Serial Line only) )

0x12-0x13无

0x14 读文件记录(Read File Record )

0x15 写文件记录(Write File Record)

0x16 带屏蔽字写入寄存器(Mask Write Register )

0x17 读/写多个寄存器(Read/Write Multiple registers)

0x18 读取先进先出(FIFO)队列(Read FIFO Queue)

0x19-0x2A无

0x2B 封装接口传输(Encapsulated Interface Transport .)

  1. 分主站,从站,主站是客户端,从站是服务端。启动时先启动从站(服务端),然后主站再连上从站,获取信息。

  2. Device and Modbus 地址表(最大地址看设备)

|----------------|----------------|-------------------|----------|------------|-----------------|
| Device address | Modbus address | Description | Function | R/W | Comments |
| 1...10000 | address-1 | Coils(outputs) | 01 | Read/Write | 05 and 15 |
| 10001...20000 | address-10001 | Discrete Inputs | 02 | Read | |
| 40001...50000 | address-40001 | Holding Registers | 03 | Read/Write | 06,16,22 and 23 |
| 30001...40000 | address-30001 | Input Registers | 04 | Read |

相关推荐
ljt27249606616 分钟前
Compose笔记(五十九)--BadgedBox
android·笔记·android jetpack
优选资源分享16 分钟前
维克日记 v1.5.0:本地隐私日记工具
笔记·实用工具·本地日记
雷工笔记24 分钟前
MES学习笔记之MES系统的作用和定位及与SCADA的关系
大数据·笔记·学习
c***937726 分钟前
Spring Security 官网文档学习
java·学习·spring
韩曙亮28 分钟前
【人工智能】AI 人工智能 技术 学习路径分析 ③ ( NLP 自然语言处理 )
人工智能·pytorch·学习·ai·自然语言处理·nlp·tensorflow
雷工笔记30 分钟前
MES学习笔记之MES常见的类别
笔记·学习
丝斯201139 分钟前
AI学习笔记整理(20)—— AI核心技术(深度学习4)
人工智能·笔记·学习
love530love40 分钟前
【笔记】重建 Stable Diffusion WebUI 虚拟环境实录
人工智能·windows·笔记·python·stable diffusion·aigc·虚拟环境
我的xiaodoujiao1 小时前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 28--开源电商商城系统项目实战--封装注册页面
python·学习·测试工具·pytest
遇到困难睡大觉哈哈1 小时前
Harmony os——ArkTS 高性能编程实践 – 速查笔记
笔记·harmonyos·鸿蒙