Write Multiple Registers - Siemens SITRANS F Modbus RTU RS 485 Operating Instructions Manual

Communication modules
Hide thumbs Also See for SITRANS F Modbus RTU RS 485:
Table of Contents

Advertisement

Functions codes

6.5 Write multiple registers

6.5
Write multiple registers
Command messages
The multiple register write functions (10hex) allows the master to write data to the slaves
registers. The command message of a multiple register write is structured as shown below.
The initial slave address is 1. Address 0 (broadcast) and other values between 1 and 255 can be
used.
The function code of this message is 10hex (write multiple registers).
The starting register is the first register to be written to.
The quantity indicates how many consecutive 16-bit registers are to be written to. The quantity
may range from 1 to 25 registers. If the quantity is greater than 25 an error code of 03 hex is
returned in the exception response message.
The Byte count is the number of bytes of data to be written to the device. The number of bytes
is actually the quantity times 2, since there are two bytes of data in each register.
The data section of the command message contains 8 upper and 8 lower bits of data for each
register that is being written to.
CRC check and exception handling is performed as described for command 'Read multiple
registers'.
Table 6-11
Message byte
Slave address
Function code
Starting register
Quantity
Byte count
Starting register value
Next register value
Last register value
CRC-16
Normal response
The normal response message contains the same slave address and function code as the
command message.
The starting register is the first register that was written to.
30
Write multiple coil command messages
Upper
Lower
Upper
Lower
Upper
Lower
Upper
Lower
Upper
Lower
Lower
Upper
Example
xxhex
10hex
00hex
20hex
00hex
04hex
xxhex
xxhex
xxhex
xxhex
xxhex
xxhex
xxhex
xxhex
xxhex
Operating Instructions, 03/2021, A5E00753974-AB
Modbus RTU RS 485

Advertisement

Table of Contents
loading

Table of Contents