9 Programming examples
Hereafter are some examples of both reading and writing parameters. All values
are expressed in hexadecimal notation.
9.1 Using the 03 Read Holding Registers function code
EXAMPLE 1
Request to read the parameters
(register 9) to the Slave having the node address 1.
Request PDU
[01][03][00][07][00][02][75][CA]
where:
[01] = Slave address
[03] =
function code
[00][07] = starting address (
parameter, register 8)
[00][02] = number of requested registers
[75][CA] = CRC
Response PDU
[01][03][04][03][E8][05][DC][78][8A]
where:
[01] = Slave address
[03] =
function code
[04] = number of bytes (2 bytes for each register)
[03][E8] = value of register 8
, 03 E8 hex = 1000 dec
[05][DC] = value of register 9
, 05 DC hex = 1500 dec
[78][8A] = CRC
parameter (register 8) contains the value 03 E8 hex, i.e.
parameter (register 9) contains
the value 05 DC hex, i.e. 1500 in decimal notation.
MAN RD6 MB E 1.1
Programming examples
85 of 92
RD6 Modbus®