ModBus协议-功能码-0x17

23 (0x17) Read/Write Multiple registers  This function code performs a combination of one read operation and one write operation in a single MODBUS transaction. The write operation is performed before the read.Holding registers are addressed starting at zero. Therefore holding registers 1-16 are addressed in the PDU as 0-15.The request specifies the starting address and number of holding registers to be read as well as the starting address, number of holding registers, and the data to be written. The byte count specifies the number of bytes to follow in the write data field. The normal response contains the data from the group of registers that were read. The byte count field specifies the quantity of bytes to follow in the read data field.


ModBus协议-功能码-0x17_第1张图片

Here is an example of a request to read six registers starting at register 4, and to write three registers starting at register 15: 

ModBus协议-功能码-0x17_第2张图片


ModBus协议-功能码-0x17_第3张图片

你可能感兴趣的:(ModBus协议)