1. 程式人生 > >ModBus協議-功能碼-0x06

ModBus協議-功能碼-0x06



06 (0x06) Write Single Register
This function code is used to write a single holding register in a remote device.The Request PDU specifies the address of the register to be written. Registers are addressed starting at zero. Therefore register numbered 1 is addressed as 0. The normal response is an echo of the request, returned after the register contents have been written.

Tx:01 06 00 01 00 03
Rx:01 06 00 01 00 03

Tx分析
01 從機地址
06 功能碼
00 01 起始地址
00 03 暫存器數值
Rx分析
01 從機地址
06 功能碼
00 01 起始地址
00 03 暫存器數值

0x01 = 1
[1] 3