SMAX MODBUS®
8 Programming examples
Hereafter are some examples of both reading and writing parameters. Unless
otherwise stated, all values are expressed in hexadecimal notation.
8.1 Using the 03 Read Holding Registers function code
EXAMPLE 1
Slave having the node address 1.
Request PDU
(in hexadecimal notation)
[01][03][00][01][00][01][D5][CA]
where:
[01] = Slave address
[03] =
function code
[00][01] = starting address (
parameter, register 2)
[00][01] = number of requested registers
[D5][CA] = CRC
Response PDU
(in hexadecimal notation)
[01][03][02][05][DC][BA][8D]
where:
[01] = Slave address
[03] =
function code
[02] = number of bytes (2 bytes for each register)
[05][DC] = value of register 2, 05 DC hex = 1500 dec
[BA][8D] = CRC
parameter (register 2) contains the value 05 DC hex,
i.e. 1500 in decimal notation; in other words the value set in the
parameter is 1500 dec.
MAN SMAX MB E 1.2
Programming examples
77 of 84