MVI56-MCM ♦ ControlLogix Platform Configuration as a Modbus Master
Modbus Communication Module
Page 38 of 159 ProSoft Technology, Inc.
July 24, 2008
4.3.6 Write Multiple Coils 0xxx (Modbus Function Code 15)
Used to write multiple Coils in the 0xxx address range, this function code will
allow you to set multiple Coils within a slave device using the same Modbus
command. Not all devices will support this function code, so verify this with your
slave device documentation before implementing this function code.
This function code will also support the Enable code of 2, to write the data to the
slave device only when the data associated within the IntAddress field of the
module has changed. The IntAddress is once again defined down to the bit level
as a Function Code 15 is a bit level Modbus function.
Below is a sample command to write Modbus addresses 0001 to 0016 of node 1
on the Modbus network.
Label Description
Enable = 2
Causes the module to send the command to the slave device only when
the data associated within the IntAddress of the MVI56-MCM module
memory has changed.
IntAddress = 320
Writes the data in bit 320 of the module memory to the slave device.
Based on the MCM.CONFIG.ModDef setting, this would be the data in
MCM.DATA.WriteData[20].0 to [20].15 in the ladder logic.
Count = 16 Writes 16 consecutive bits to the slave device.
Node = 1 Issues the Modbus command to node 1 on the network.
Func = 15 Issues a Modbus Function code of 15 to write multiple coils.
DevAddress = 0 Function Code 15, DevAddress of 0 will read address 0001
Along with a count of 16, this command writes to 0001 to 0016.
4.3.7 Write Holding Register 4xxxx (Modbus Function Code 6)
Used to write to Modbus Holding Registers 4xxxx, this function code will write a
single register to the slave device. The Enable code can be set to a value of 1 for
a continuous write, or a value of 2 to write the data to the slave device only when
the data associated with the IntAddress field has changed.
Below is a sample command to write Modbus addresses 41041 of node 1 on the
Modbus network.