当前位置:网站首页>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).
边栏推荐
- [advanced C language] string and memory function (II)
- leetcode 416. Partition equal subset sum partition equal subset sum (medium)
- Sword finger offer II 035 Minimum time difference
- MySQL基础2
- TP5 query and and or condition nesting
- vsftp 与 TFTP 与 samba 与 nfs 复习
- 关联性——典型相关分析
- Mysql Duplicate entry ‘xxx‘ for key ‘xxx‘
- Sword finger offer II 037 Asteroid collision
- Finding a job in 2022 is the "last lesson" for graduates
猜你喜欢
![[advanced C language] address book implementation](/img/e6/8a51d519d31ec323cf04c59a556325.png)
[advanced C language] address book implementation

Three postures of anti CSRF blasting

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

Finding a job in 2022 is the "last lesson" for graduates

关联性——典型相关分析

IDEA工具快捷键的使用

vsftp 与 TFTP 与 samba 与 nfs 复习

Several simple queries of SQL Server database

There is no web-based development for the reward platform. Which is suitable for native development or mixed development?

JS的初步语法
随机推荐
[graduation season 𞓜 advanced technology Er] employees who have worked for seven years do not want you to take another detour
Project 1: deploy lamp ECSHOP e-commerce platform
JS draw polar color gradient
[advanced C language] file operation (II)
中小企业签署ERP合同时,需要注意这几点
leetcode-1. 两数之和
Solr基础操作6
SOFARegistry 源码|数据同步模块解析
MySQL Foundation 2
DOM 知识点总结
There is no web-based development for the reward platform. Which is suitable for native development or mixed development?
Automatic integration: yescomusa, an overseas cross-border e-commerce, cooperates with cloud expansion to realize one-stop Automation Service
固定资产管理系统多少钱,固定资产管理系统价格
01背包问题
Vulnhub靶机-MoriartyCorp
Events in JS
leetcode 416. Partition Equal Subset Sum 分割等和子集(中等)
Mysql:sql overview and database system introduction | dark horse programmer
Solr基础操作14
Cloud native enthusiast weekly: cool collection of grafana monitoring panels