当前位置:网站首页>Modbus TCP RTU protocol chart
Modbus TCP RTU protocol chart
2022-06-30 00:25:00 【WX_ LW】
MODBUS TCP
Read register request | Serial number | significance | Bytes taken | Byte storage format |
1 | Transaction ID | 2 Bytes | High byte first | |
2 | Protocol identification | 2 Bytes | High byte first | |
3 | length | 2 Bytes | High byte first | |
4 | element ID | 1 Bytes | 0x00-0xff | |
5 | Function code | 1 Bytes | 0x03 | |
6 | Start register address | 2 Bytes | High byte first | |
7 | Number of registers | 2 Bytes | High byte first |
Read register Respond | Serial number | significance | Bytes taken | Byte storage format |
1 | Transaction ID | 2 Bytes | High byte first | |
2 | Protocol identification | 2 Bytes | High byte first | |
3 | length | 2 Bytes | High byte first | |
4 | element ID | 1 Bytes | 0x00-0xff | |
5 | Function code | 1 Bytes | 0x03 | |
6 | Data length | 1 Bytes | Number of registers *2 | |
7 | data | Number of registers *2 Bytes | Every register High byte first |
Write a single register request | Serial number | significance | Bytes taken | Byte storage format |
1 | Transaction ID | 2 Bytes | High byte first | |
2 | Protocol identification | 2 Bytes | High byte first | |
3 | length | 2 Bytes | High byte first | |
4 | element ID | 1 Bytes | 0x00-0xff | |
5 | Function code | 1 Bytes | 0x10 | |
6 | Register address | 2 Bytes | High byte first | |
7 | Register value | 2 Bytes | High byte first |
Write a single register Respond | Serial number | significance | Bytes taken | Byte storage format |
1 | Transaction ID | 2 Bytes | High byte first | |
2 | Protocol identification | 2 Bytes | High byte first | |
3 | length | 2 Bytes | High byte first | |
4 | element ID | 1 Bytes | 0x00-0xff | |
5 | Function code | 1 Bytes | 0x10 | |
6 | Register address | 2 Bytes | High byte first | |
7 | Register value | 2 Bytes | High byte first |
Write more than one register request | Serial number | significance | Bytes taken | Byte storage format |
1 | Transaction ID | 2 Bytes | High byte first | |
2 | Protocol identification | 2 Bytes | High byte first | |
3 | length | 2 Bytes | High byte first | |
4 | element ID | 1 Bytes | 0x00-0xff | |
5 | Function code | 1 Bytes | 0x10 | |
6 | Start register address | 2 Bytes | High byte first | |
7 | Number of registers | 2 Bytes | High byte first | |
8 | Data length | 1 Bytes | Number of registers *2 | |
9 | data | Number of registers *2 Bytes | Every register High byte first |
Write more than one register Respond | Serial number | significance | Bytes taken | Byte storage format |
1 | Transaction ID | 2 Bytes | High byte first | |
2 | Protocol identification | 2 Bytes | High byte first | |
3 | length | 2 Bytes | High byte first | |
4 | element ID | 1 Bytes | 0x00-0xff | |
5 | Function code | 1 Bytes | 0x10 | |
6 | Start register address | 2 Bytes | High byte first | |
7 | Number of registers | 2 Bytes | High byte first |
Erroneous return | Serial number | significance | Bytes taken | Byte storage format |
1 | Transaction ID | 2 Bytes | High byte first | |
2 | Protocol identification | 2 Bytes | High byte first | |
3 | length | 2 Bytes | High byte first | |
4 | element ID | 1 Bytes | 0x00-0xff | |
5 | Function code | 1 Bytes | Request function code +0x80 | |
6 | Error code | 1 Bytes | See the table for its code |
Error code | Error code | significance |
0x01 | This function code is not supported | |
0x02 | Transboundary | |
0x03 | The number of registers is out of range | |
0x04 | Read write error |
MODBUS RTU
Read register request | Serial number | significance | Bytes taken | Byte storage format |
1 | Slave device address | 1 Bytes | 0x00-0xff | |
2 | Function code | 1 Bytes | 0x03 | |
3 | Start register address | 2 Bytes | High byte first | |
4 | Number of registers | 2 Bytes | High byte first | |
5 | CRC Check code | 2 Bytes | Low bytes first |
Read register Respond | Serial number | significance | Bytes taken | Byte storage format |
1 | Slave device address | 1 Bytes | 0x00-0xff | |
2 | Function code | 1 Bytes | 0x03 | |
3 | Data length | 1 Bytes | Number of registers *2 | |
4 | data | Number of registers *2 Bytes | Every register High byte first | |
5 | CRC Check code | 2 Bytes | Low bytes first |
Write a single register request | Serial number | significance | Bytes taken | Byte storage format |
1 | Slave device address | 1 Bytes | 0x00-0xff | |
2 | Function code | 1 Bytes | 0x10 | |
3 | Start register address | 2 Bytes | High byte first | |
4 | Register value | 2 Bytes | High byte first | |
5 | CRC Check code | 2 Bytes | Low bytes first |
Write a single register Respond | Serial number | significance | Bytes taken | Byte storage format |
1 | Slave device address | 1 Bytes | 0x00-0xff | |
2 | Function code | 1 Bytes | 0x10 | |
3 | Start register address | 2 Bytes | High byte first | |
4 | Register value | 2 Bytes | High byte first | |
5 | CRC Check code | 2 Bytes | Low bytes first |
Write more than one register request | Serial number | significance | Bytes taken | Byte storage format |
1 | Slave device address | 1 Bytes | 0x00-0xff | |
2 | Function code | 1 Bytes | 0x10 | |
3 | Start register address | 2 Bytes | High byte first | |
4 | Number of registers | 2 Bytes | High byte first | |
5 | Data length | 1 Bytes | Number of registers *2 | |
6 | data | Number of registers *2 Bytes | Every register High byte first | |
7 | CRC Check code | 2 Bytes | Low bytes first |
Write more than one register Respond | Serial number | significance | Bytes taken | Byte storage format |
1 | Slave device address | 1 Bytes | 0x00-0xff | |
2 | Function code | 1 Bytes | 0x10 | |
3 | Start register address | 2 Bytes | High byte first | |
4 | Number of registers | 2 Bytes | High byte first | |
5 | CRC Check code | 2 Bytes | Low bytes first |
Erroneous return | Serial number | significance | Bytes taken | Byte storage format |
1 | Slave device address | 1 Bytes | 0x00-0xff | |
2 | Function code | 1 Bytes | Request function code +0x80 | |
3 | Error code | 1 Bytes | See the table for its code | |
4 | CRC Check code | 2 Bytes | Low bytes first |
Error code | Error code | significance |
0x01 | This function code is not supported | |
0x02 | Transboundary | |
0x03 | The number of registers is out of range | |
0x04 | Read write error |
MODBUS RTU Function code
below “ coil ”,“ register ” In fact, they are “ Bit variable ”,“16 Bit variable ”.
Function code | significance |
0x01 | Read the coil |
0x02 | Read discrete input |
0x03 | Read holding register |
0x04 | Read input register |
0x05 | Write a single coil |
0x06 | Write a single register |
0x0F | Write multiple coils |
0x10 | Write multiple registers |
Modbus RTU And Modbus TCP Read instruction comparison
MBAP Headline | Address code | function code | register Address | register Number | CRC check | |
RTU | nothing | 01 | 03 | 01 8E | 00 04 | 25 DE |
TCP | 00 00 00 00 00 06 00 | nothing | 03 | 01 8E | 00 04 | nothing |
The meaning of the directive : The slave address code is 01(TCP The protocol unit flag is 00) Module 0x18E(01 8E) Register address start reading (03) four (00 04) register .
Modbus RTU And Modbus TCP Write instruction comparison
MBAP Headline | Address code | function code | register Address | register Number | data length | Text | CRC check | |
RTU | nothing | 01 | 10 | 01 8E | 00 01 | 02 | 00 00 | A8 7E |
TCP | 00 00 00 00 00 09 00 | nothing | 10 | 01 8E | 00 01 | 02 | 00 00 | nothing |
The meaning of the directive : The slave address code is 01(TCP The protocol unit flag is 00) Module 0x18E(01 8E) Register address start writing (10) One (00 01) register , The specific data length is 2 Bytes (02), The content of data body is 00 00(00 00).
边栏推荐
- 字节、字、双字 关系
- Vulnhub靶机-MoriartyCorp
- MySQL foundation 3
- About SQL: create a view_ XB view, whose function is ① to delete views with duplicate names before creating them ② to display the number of male and female students in this class in the XSB table, and
- [review and Book delivery] 6 interesting R language projects for beginners
- 俞敏洪:我的退与进;架构师必须了解的5种最佳软件架构模式;Redis夺命52连问|码农周刊VIP会员专属邮件周报 Vol.096
- MySQL基础篇1
- Solr基础操作6
- Solr basic operations 7
- IO stream summary
猜你喜欢

剑指 Offer II 037. 小行星碰撞

Five key elements of the data center

EB-5 immigration in the United States reappears to be positive, and the reauthorization policy of the regional center is suspended

Cloud native enthusiast weekly: cool collection of grafana monitoring panels

HDCP Paring

Three postures of anti CSRF blasting

@ConfigurationProperties使用不当引发的bug

有流量,但没有销售?增加网站销量的 6 个步骤

Mysql Duplicate entry ‘xxx‘ for key ‘xxx‘

SSH key disclosure (module B competition topic) -- Application Service Vulnerability scanning and utilization
随机推荐
[advanced C language] string and memory function (II)
mysql 死锁
Label Troubleshooting: unable to open the marked image
MySQL basics 1
中小企业签署ERP合同时,需要注意这几点
Sword finger offer II 037 Asteroid collision
leetcode 416. Partition equal subset sum partition equal subset sum (medium)
Can't recognize the original appearance
Solr基础操作14
Solr基础操作11
How to seamlessly transition from traditional microservice framework to service grid ASM
网络方向哪个发展更好?数据通信工程师学习路线分享
【服装软件】服装出产办理体系选型的准则有哪些?
[advanced C language] dynamic memory management
数据中台的五个关键要素
MySQL高级篇2
Fine grained identification, classification, retrieval data set collation
VIM plug in manager VIM plug installation method
Cloner un Graphe non recté [bfs accède à chaque bord et pas seulement aux noeuds]
MySQL foundation 2