1 ModbusTCP Communication (Server)
4-4
KW2D Series Smart RFID Reader User’s Manual
Write the value to the holding register.
The host device (ModbusTCP client) can write to the holding register of the KW2D Smart RFID Reader (ModbusTCP
Server). When writing a value to one address number, the function code is "06h". When writing values to multiple
consecutive address numbers, the function code is "10h". The function code for error is "86h" (06h+80h) in the case
of writing to one address number, and "90h" (10h+80h) in the case of writing to multiple address numbers.
Example: Write 0 to coil relay 0007 and 1 to coil relay 0008.
Example: Try to access multiple coil relays of the slave address outside the range
For details on the error code, refer to "Error code" on page 4-5.
Example: Write "0103h" to holding register 0008
Example: Try to access one holding register with a slave address outside the range.
For details on the error code, refer to "Error code" on page 4-5.
00h
06h
0Fh
02h
00h
Function
code
Start address
number
Number of bits
to write
(
1 byte
)
(
2 bytes
)
(
2 bytes
)
02h
01h
(
1 byte
) (
1 byte
)
Number of
data to write
Data to
write
Request
Start address number Number of bits written
(
2 bytes
)
(
2 bytes
)
00h
06h
0Fh
02h
00h
Function code
(
1 byte
)
ACK Reply
Error code
(
1 byte
)
02h
8Fh
Function code
(
1 byte
)
NAK Reply
00h
07h
06h
03h
01h
Function code Start address number
Data to write
(
1 byte
)
(
2 bytes
)
(
2 bytes
)
Upper
byte
Lower
byte
Request
Start address number
Written value
(
2 bytes
)
(
2 bytes
)
00h
07h
06h
03h
01h
Function code
(
1 byte
)
Upper
byte
Lower
byte
ACK Reply
Error code
(
1 byte
)
02h
86h
Function code
(
1 byte
)
NAK Reply