DKM-409 Pro AT User Manual Rev_02 Firmware V-2.5
K91D01-EN - 54 -
Writing register values can be accomplished by using function 06 (write single register). Single message
can write only one register. MODBUS master device sends query, which includes data to be written.
Respond can be either a message that indicates writing process successful, or failure message including
writing fail.
BYTE DESCRIPTION
VALUE
0
Controller Address
1 to 253
1
Function Code
6
2
Register Address Upper Writeable registers are listed below
3
Register Address Lower Writeable registers are listed below
4
Data Upper Byte
5
Data Lower Byte
6
CRC Lower Byte
CRC calculation is mentioned below
7
CRC Upper Byte
CRC calculation is mentioned below
Sample message, which writes 0010h value to 40h (64 decimal) address, is explained below.
01 06 00 40 00 10 89 D2 (each byte is written as 2 hexadecimal characters)
Expected response is same as query:
BYTE DESCRIPTION
VALUE
0
Controller Address
1 to 253
1
Function Code
6
2
Register Address Upper Writeable registers are listed below
3
Register Address Lower Writeable registers are listed below
4
Data Upper Byte
5
Data Lower Byte
6
CRC Lower Byte
CRC calculation is mentioned below
7
CRC Upper Byte
CRC calculation is mentioned below
Failure response message is:
BYTE DESCRIPTION
VALUE
0
Controller
Address
Same as query
1
Function Code
134 (Function code + 128)
2
Fail Code
2: Invalid Address
10: Write Protection
3
CRC Lower Byte CRC calculation is mentioned below
4
CRC Upper Byte CRC calculation is mentioned below
21.4. DATA WRITE