How To: Write Multiple Registers
Modbus provides two functions to modify the values of Holding Registers. Function Code 0x06 can be used to change the value of a single
register whereas Function Code 0x10 is for changing the values of multiple Holding Registers in one request. This section describes the
procedure for changing the state of multiple Holding Registers using FC 0x10.
The Write Holding Registers form
Figure below shows a Write Holding Registers form and provides a note on the important components of this form.
- Open the Write Holding Registers form by choosing menu item Write->Holding Registers or by clicking the
Write Holding Registers toolbar
- Set Dev ID to the Slave (Unit) ID of your device. Note that this parameter is ignored by most Modbus TCP devices.
- Set Address to the Modbus address of the first Holding Register in the block that will be modified.
- Set Length to the number of Holding Registers to be modified. Length cannot be larger than 123.
- Enter new values for each Holding Register in the text box provided against each address. You may use the Duplicate first
value to others button if you intend to set all registers in this block to the same value.
- Click OK to transmit the Write command to the device.
|You may use the Wrap Contents checkbox to control the flow of the text boxes within the panel. If this is
checked, text boxes (along with their address labels) flow over to the next column on reaching the bottom of the panel.
If not, all textboxes are placed in the same column and a scroll bar appears using which you can view text boxes that are
beyond the bottom of the panel.
|You may resize the Write Holding Registers form to make more space so that all the addresses are visible without
having to scroll. The text boxes and their address labels reflow to fit into the resized form.