ModBus协议-功能码-0x04

本文详细介绍了Modbus功能码04用于读取远程设备中连续输入寄存器的方法。解析了请求和响应PDU的具体内容,包括起始地址、寄存器数量及数据排列方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

04 (0x04) Read Input Registers

This function code is used to read from 1 to 125 contiguous input registers in a remote device.The Request PDU specifies the starting register address and the number of registers. In the PDU Registers are addressed starting at zero. Therefore input registers numbered 1-16 are
addressed as 0-15.The register data in the response message are packed as two bytes per register, with the binary contents right justified within each byte. For each register, the first byte contains the high order bits and the second contains the low order bits.


The contents of input register 9 are shown as the two byte values of 00 0A hex, or 10 decimal.



Tx:01 04 00 08 00 01
Rx:01 04 02 00 0A

Tx分析
01 从机地址
04 功能码
00 08 起始地址
00 01 输入寄存器数量
Rx分析
01 从机地址
04 功能码
02 字节数
00 0A 输入寄存器

0x08 = 0
0x01 = 1
[9] 00 0A




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值