9.2 Using the 04 Read Input Register function code
EXAMPLE 1
4) to the Slave having the node address 1.
Request PDU
[01][04][00][02][00][02][D0][0B]
where:
[01] = Slave address
[04] =
function code
[00][02] = starting address (
3)
[00][02] = number of requested registers
[D0][0B] = CRC
Response PDU
[01][04][04][00][00][2F][F0][E7][F0]
where:
[01] = Slave address
[04] =
function code
[04] = number of bytes (2 bytes for each register)
[00][00] = value of register 3
, 00 00 hex = 0 dec
[2F][F0] = value of register 4
, 2F F0 hex = 12272
dec
[E7][F0] = CRC
parameter (registers 3 and 4) contains the value
00 00 2F F0 hex, i.e. 12272 in decimal notation.
EXAMPLE 2
variable (register 1) to the Slave
having the node address 1.
Request PDU
[01][04][00][00][00][01][31][CA]
where:
[01] = Slave address
[04] =
function code
[00][00] = starting address (
variable, register 1)
[00][01] = number of requested registers
MAN RD6 MB E 1.1
Programming examples
86 of 92
RD6 Modbus®