16
8. Protocol Examples: Modbus
Example 4: Read state of analogue input channel 1, as a 32-bit oating-point
value (each value uses two 16-bit Modbus registers)
Request: Read Holding Registers (function code=3), logical address=0x0012,
quantity=0x0002
Response: Function code=3, no. of bytes=4, data=0x064B, 0x3f9E
The 32-bit value is 0x3f9E064B, which is the IEEE 754 encoding of the
oating-point value 1.234567
Example 5: Set state of analogue output channels 0 – 3
Request: Write Multiple Registers (function code=16), logical
address=0x0000, quantity=4, no. of bytes=8, data=0x0000, 0x1000,
0x2000, 0x3fff
Response: Function code=16, logical address=0x0000, quantity=4
The encoding of analogue values to integers is congurable, but this example
could mean the outputs are set to 0%, 25%, 50% and 100% of their FSR. The
response just acknowledges that the request was handled without error.
Modbus Address tables: detailed
tables for each product avaiable in the
device's manual - see the CD or our
website