当前位置:网站首页>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).
边栏推荐
- Clone undirected graph [bfs accesses each edge but not only nodes]
- Label Troubleshooting: unable to open the marked image
- 8 software engineering environment
- vim插件管理器vim-plug安装方法
- mysql 死锁
- Solr基础操作10
- [review and Book delivery] 6 interesting R language projects for beginners
- How long will it take to open a mobile account? In addition, is it safe to open a mobile account?
- Solr basic operation 16
- Serpentine matrix (array simulates direction, D represents turning)
猜你喜欢

分布式任务调度 ElasticJob demo

云原生爱好者周刊:炫酷的 Grafana 监控面板集合

This PMP Exam (June 25), some people are happy and others are worried. That's why

C MDI open subform to remove automatically generated menu bar

云呐|固定资产系统管理,nc系统管理固定资产在哪里

项目一:部署 LAMP ecshop电商平台

JS的初步语法

Vulnhub target -moriartycorp

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

单位固定资产怎么管理,行政单位的固定资产应该怎么管理
随机推荐
label问题排查:打不开标注好的图像
MySQL基础2
[QNX Hypervisor 2.2用户手册]6.2.2 Guest与Host之间通信
[graduation season 𞓜 advanced technology Er] employees who have worked for seven years do not want you to take another detour
Will the flush SQL CDC parallelism affect the order? Generally, only 1 can be set for data synchronization.
leetcode 416. Partition Equal Subset Sum 分割等和子集(中等)
[review and Book delivery] 6 interesting R language projects for beginners
Solr基础操作15
Summarize Flink runtime architecture in simple terms
DOM 知识点总结
云呐|固定资产信息系统管理,信息化固定资产管理
Solr基础操作9
IDEA工具快捷键的使用
How long will it take to open a mobile account? In addition, is it safe to open a mobile account?
Statistical query of SQL Server database
克隆無向圖[bfs訪問每條邊而不止節點]
Cloud native enthusiast weekly: cool collection of grafana monitoring panels
Solr basic operation 8
Solr basic operation 10
Three postures of anti CSRF blasting