MODBUS Functions • 173Description of the MODBUS FunctionsWAGO-I/O-SYSTEM 750ETHERNET TCP/IP6.3.11 Function Code FC23 (Read/Write multiple registers)This function performs a combination of a read and write operation in a singlerequest. The function can write the new data to a group registers, and thenreturn the data of a different group.RequestThe reference numbers (addresses) are zero-based in the request message;therefore, the first register is at address 0.The request message specifies the registers to read and write. The data is sentas 2 bytes per register.Example: The data in register 3 is set to value 0x0123, and values 0x0004 and0x5678 are read out of the two registers 0 and 1.Byte Field name ExampleByte 0, 1 Transaction identifier 0x0000Byte 2, 3 protocol identifier 0x0000Byte 4, 5 length field 0x000FByte 6 Unit identifier 0x01 not usedByte 7 MODBUS function code 0x17Byte 8-9 reference number for read 0x0000Byte 10-11 Word count for read (1-125) 0x0002Byte 12-13 reference number for write 0x0003Byte 14-15 Word count for write (1-100) 0x0001Byte 16 Byte Count(B = 2 x word count for write)0x02Byte17-(B+16)Register Values 0x0123ResponseByte Field name Example....Byte 7 MODBUS function code 0x17Byte 8 Byte Count(B = 2 x word count for read)0x04Byte 9-(B+1)Register Values 0x00040x5678ExceptionByte Field name Example.....Byte 7 MODBUS function code 0x97Byte 8 Exception code 0x01 or 0x02NoteIf register areas for read and write overlap, the results are undefined.