Page 10 / 15
PV500-67 03/17
3.5 WRITE HOLDING REGISTERS (0x10):
Command to write 1-5 registers. Limit is 5 registers. Response will be the number of registers written.
3.5.1 MASTER COMMAND TO WRITE HOLDING REGISTER (0x10):
Slave Address:
(1 byte): Device address that receives the command. Range: 1-247.
Function Code:
(1 byte): Code = 0x10 (Write holding registers 1-5).
Register Address:
The address of the first register to write to.
Number of Registers:
(2 bytes): Defines the number of Elements (Registers) to write to. No more than 5 Elements
allowed for the XR10CX.
Num Byte:
(1 byte): Defines the number of bytes followed
minus the CRC. The number of bytes has to be double the
number of addressed Elements (Number of bytes = 2 x number of Registers).
Data
(Num Byte or 2 X Number of Registers): Data to be written in MSByte, LSByte order.
CRC:
(2 bytes): CRC calculated for the frame data received and has to be used to verify the integrity of data received.
3.5.2 SUCCESSFUL RESPONSE FROM WRITE HOLDING REGISTERS (0x10):
Slave Address:
(1 byte): The address of the slave responding. Same as the address in the initiating command.
Function Code:
(1 byte): Code = 0x10 Echo from the initiating command.
Register Address:
(2 bytes): The address of the register that was written.
Number Registers:
(2 bytes): The number of registers written.
CRC:
(2 bytes):
3.5.3 EXCEPTION RESPONSE FROM WRITE HOLDING REGISTERS (0x10):
Slave Address:
(1 byte): The address of the slave responding. Same as the address in the initiating command.
Exception Response:
(1 byte): Code = 0x10 Echo from the initiating command plus high bit 0x80 = 0x90.
Exception Code:
(1 byte): Defines the number of bytes followed minus the CRC. See Table 1 for explanation of
exceptions.
CRC:
(2 bytes):
Slave
Address
Function
Code 0x10
Register
Address
(MSByte)
Register
Address
(LSByte)
Number
Registers
(MSByte)
Number
Registers
(LSByte)
CRC
(LSByte)
CRC
(MSByte)
Num
Byte
Data
Slave
Address
Function
Code
0x10
Register
Address
(MSByte)
Register
Address
(LSByte)
Number
Registers
(MSByte)
Number
Registers
(LSByte)
CRC
(LSByte)
CRC
(MSByte)
Slave
Address
Error, Code
0x10 + 0x80
Error: 0x90
Exception
Code, see list
CRC
(LSByte)
CRC
(MSByte)