Page 9 / 15
PV500-67 03/17
3.4 WRITE SINGLE REGISTER (0X06):
Command to write a value to a single register. Response will be the data written.
3.4.1 MASTER COMMAND TO WRITE SINGLE REGISTER (0x06):
Slave Address:
(1 byte): Device address that receives the command. Range: 1-247.
Function Code:
(1 byte): Code = 0x06 (Write single register).
Register Address:
(2 bytes): The address of the register to be written to.
Data:
(2 bytes):
The data to write.
CRC:
(2 bytes): CRC calculated for the frame data received and has to be used to verify the integrity of data received.
3.4.2 SUCCESSFUL RESPONSE FROM WRITE SINGLE REGISTER (0x06)
Slave Address:
(1 byte): The address of the slave responding. Same as the address in the initiating command.
Function Code:
(1 byte): Code = 0x06 Echo from the initiating command.
Register Address:
(2 bytes): The address of the register that was written.
Data:
(2 bytes): Byte data buffer, will contain the same data that was sent in initiating command.
CRC:
(2 bytes):
3.4.3 EXCEPTION RESPONSE FROM WRITE SINGLE REGISTER (0x06):
Slave Address:
(1 byte): The address of the slave responding. Same as the address in the initiating command.
Exception Response:
(1 byte): Code = 0x06 Echo from the initiating command plus high bit 0x80 = 0x86.
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 0x06
Register
Address
(MSByte)
Register
Address
(LSByte)
Data
(MSByte)
Data
(LSByte)
CRC
(LSByte)
CRC
(MSByte)
Slave
Address
Success:
Code 0x06
Register
Address
(MSByte)
Register
Address
(LSByte)
Data
(MSByte)
Data
(LSByte)
CRC
(LSByte)
CRC
(MSByte)
Slave
Address
Exception
0x06 + 0x80
Error: 0x86
Exception
Code
see list
CRC
(LSByte)
CRC
(MSByte)