9.3 Using the 06 Write Single Register function code
EXAMPLE 1
Request to write the value 05 DC hex (= 1500 dec) in the
parameter (register 8) of the Slave having the node address 1.
Request PDU
[01][06][00][07][05][DC][3A][C2]
where:
[01] = Slave address
[06] =
function code
[00][07] = address of the register (
parameter, register 8)
[05][DC] = value to be set in the register
[3A][C2] = CRC
Response PDU
[01][06][00][07][05][DC][3A][C2]
where:
[01] = Slave address
[06] =
function code
[00][07] = address of the register (
parameter, register 8)
[05][DC] = value set in the register
[3A][C2] = CRC
The value 05 DC hex, i.e. 1500 in decimal notation, is set in the
parameter (register 8).
EXAMPLE 2
Request to write the value 00 84 hex in the
(register 43) of the Slave having the node address 1.
Request PDU
[01][06][00][2A][00][84][A8][61]
where:
[01] = Slave address
[06] =
function code
[00][2A] = address of the register (
variable, register 43)
[00][84] = value to be set in the register
[A8][61] = CRC
MAN RD6 MB E 1.1
Programming examples
88 of 92
RD6 Modbus®