8-11
Chapter 8. Modbus Communication Function
Write command (10H)
z
Instruction message
This is a command—in one message—to write data to consecutive word addresses
starting from the specified address. The following is a sample “write” instruction
message.
Example: 01A0H and 0E53H are written to two consecutive word addresses
starting from 1501W (05DDH).
Modbus/ASCII
3AH 30H 31H 31H 30H 30H 35H 44H 44H 30H 30H 30H 32H 30H 34H 30H 31H 41H 30H 30H 45H 35H 33H 30H 35H 0DH 0AH
: 0 1 1 0 0 5 D D 0 0 0 2 0 4 0 1 A 0 0 E 5 3 0 5 CR LF
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
(1) Start of the message
(2) Station address
(3) Write command (10H)
(4) Starting word address
(5) Write data count
(6) Write data count ×2
(7) Write data 1
(8) Write data 2
(9) Checksum (LRC)
(10) Delimiter
Modbus/RTU
01H 10H 05H DDH 00H 02 h 04H 01HA0H 0EH 53H 45H B9H
(1) (2) (3) (4) (5) (6) 7 (8)
(1) Station address
(2) Write command (10H)
(3) Starting word address
(4) Write data count
(5) Write data count ×2
(6) Write data 1
(7) Write data 2
(8) Checksum (CRC)
z
Response message
If an instruction message is received successfully, a response message appropriate
for the command is returned.
The following is a sample response message for a write command.
Modbus/ASCII
3AH 30H 31H 31H 30H 30H 35H 44H 44H 30H 30H 30H 32H 30H 42H 0DH 0AH
: 0 1 1 0 0 5 D D 0 0 0 2 0 B CR LF
(1) (2) (3) (4) (5) (6) (7)
(1) Start of the message
(2) Station address
(3) Write command (10H)
(4) Starting word address
(5) Write data count
(6) Checksum (LRC)
(7) Delimiter