WAGO-I/O-SYSTEM 750 XTR
Fieldbus Communication 167
750-352/040-000 FC ETHERNET G3 XTR
Manual
Version 1.3.0
Pos: 94.16 /Serie 750 ( WAGO-I/O-SYST EM)/Funkti onsbeschrei bung/F eldbuskommuni kation/M ODBU S/Anwendung der MOD BUS-F unktionen - FC23 @ 4\mod_1235567802937_21.docx @ 27740 @ 4 @ 1
11.2.3.11 Function Code FC23 (Read/Write Multiple Registers)
This function performs a combination of a read and write operation in a single
request. The function can write the new data to a group registers, and then return
the data of a different group. The write operation is performed before the read.
Request
The 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 sent
as 2 bytes per register.
Example: The data in register 3 is set to value 0x0123, and values 0x0004 and
0x5678 are read out of the two registers 0 and 1.
Table 103: Request of Function Code FC23
Byte
Field name
Example
Byte 0, 1
Transaction identifier
0x0000
Byte 2, 3
Protocol identifier
0x0000
Byte 4, 5
Length field
0x000D
Byte 6
Unit identifier
0x01 not used
Byte 7
MODBUS function code
0x17
Byte 8, 9
Reference number for read
0x0000
Byte 10, 11
Word count for read (1…125)
0x0002
Byte 12, 13
Reference number for write
0x0003
Byte 14, 15
Word count for write (1…100)
0x0001
Byte 16
Byte count (2 x word count for write)
0x02
Byte 17...(B+16) Register values (B = Byte count)
0x0123
Response
Table 104: Response of Function Code FC23
Byte
Field name
Example
...
Byte 7
MODBUS function code
0x17
Byte 8
Byte count (2 x word count for read)
0x04
Byte 9...(B+1)
Register values (B = Byte count)
0x0004 or 0x5678
Exception
Table 105: Exception of Function Code FC23
Byte
Field name
Example
...
Byte 7
MODBUS function code
0x97
Byte 8
Exception code
0x01 or 0x02