云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 01 Modbus Data Struture

01 Modbus Data Struture

  • 62 次阅读
  • 3 次下载
  • 2025/5/2 21:40:22

Modbus DataStructure

Author: Fengbing References:

Read Coil Status (FC=01) .................................................................................................................. 1 Read Input Status (FC=02) ............................................................................................................... 2 Read Holding Registers (FC=03) ....................................................................................................... 3 Read Input Registers (FC=04) ........................................................................................................... 4 Force Single Coil (FC=05) .................................................................................................................. 5 Preset Single Register (FC=06) ......................................................................................................... 6 Force Multiple Coils (FC=15) ............................................................................................................ 7 Preset Multiple Registers (FC=16) .................................................................................................... 8 Modbus ASCII vs Modbus RTU ......................................................................................................... 9 Modbus TCP/IP .............................................................................................................................. 13 Exception Responses...................................................................................................................... 16

0 | Page

Read Coil Status (FC=01)

Request

This command is requesting the ON/OFF status of discrete coils # 20 to 56 from the slave device with address 17. 11 01 0013 0025 0E84

11: The Slave Address (17 = 11 hex) 01: The Function Code (read Coil Status)

0013: The Data Address of the first coil to read. (Coil 20 - 1 = 19 = 13 hex) 0025: The total number of coils requested. (coils 20 to 56 = 37 = 25 hex) 0E84: The CRC (cyclic redundancy check) for error checking. Response

11 01 05 CD6BB20E1B 45E6

11: The Slave Address (17 = 11 hex) 01: The Function Code (read Coil Status)

05: The number of data bytes to follow (37 Coils / 8 bits per byte = 5 bytes) CD: Coils 27 - 20 (1100 1101) 6B: Coils 35 - 28 (0110 1011) B2: Coils 43 - 36 (1011 0010) 0E: Coils 51 - 44 (0000 1110)

1B: 3 space holders & Coils 56 - 52 (0001 1011) 45E6: The CRC (cyclic redundancy check).

The more significant bits contain the higher coil variables. This shows that coil 36 is off (0) and 43 is on (1). Due to the number of coils requested, the last data field1B contains the status of only 5 coils. The three most significant bits in this data field are filled in with zeroes.

1 | Page

Read Input Status (FC=02)

Request

This command is requesting the ON/OFF status of discrete inputs # 10197 to 10218 from the slave device with address 17. 11 02 00C4 0016 BAA9

11: The Slave Address (17 = 11 hex) 02: The Function Code (read Input Status)

00C4: The Data Address of the first input to read. (10197 - 10001 = 196 = C4 hex) 0016: The total number of coils requested. (197 to 218 = 22 = 16 hex) BAA9: The CRC (cyclic redundancy check) for error checking. Response

11 02 03 ACDB35 2018

11: The Slave Address (17 = 11 hex) 02: The Function Code (read Input Status)

03: The number of data bytes to follow (22 Inputs / 8 bits per byte = 3 bytes) AC: Discrete Inputs 10204 -10197 (1010 1100) DB: Discrete Inputs 10212 - 10205 (1101 1011)

35: 2 space holders & Discrete Inputs 10218 - 10213 (0011 0101) 2018: The CRC (cyclic redundancy check).

The more significant bits contain the higher Discrete inputs. This shows that input 10197 is off (0) and 10204 is on (1). Due to the number of inputs requested, the last data field 35 contains the status of only 6 inputs. The two most significant bits in this data field are filled in with zeroes.

2 | Page

Read Holding Registers (FC=03)

Request

This command is requesting the content of analog output holding registers # 40108 to 40110 from the slave device with address 17. 11 03 006B 0003 7687

11: The Slave Address (17 = 11 hex)

03: The Function Code (read Analog Output Holding Registers)

006B: The Data Address of the first register requested. (40108-40001 = 107 = 6B hex) 0003: The total number of registers requested. (read 3 registers 40108 to 40110) 7687: The CRC (cyclic redundancy check) for error checking. Response

11 03 06 AE41 5652 4340 49AD

11: The Slave Address (17 = 11 hex)

03: The Function Code (read Analog Output Holding Registers)

06: The number of data bytes to follow (3 registers x 2 bytes each = 6 bytes) AE41: The contents of register 40108 5652: The contents of register 40109 4340: The contents of register 40110

49AD: The CRC (cyclic redundancy check).

3 | Page

搜索更多关于: 01 Modbus Data Struture 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

Modbus DataStructure Author: Fengbing References: Read Coil Status (FC=01) .................................................................................................................. 1 Read Input Status (FC=02) ............................................................................................................... 2 Read Holding

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com