
MVI56-MCM
♦
ControlLogix Platform
Configuration as a Modbus Master
Modbus Communication Module
Page 36 of 159
ProSoft Technology, Inc.
July 24, 2008
4.3.3 Read Coils 0xxxx (Modbus Function Code 1)
Modbus Function Code 1 reads the Coils addressed at 0001 to 9999 from a
slave device. These are bit values that are read using Modbus Function Code 1,
and can be written to using Function Code 5 or 15. Within a slave device, this is
an individual bit value. Thus the IntAddress field must be defined down to the bit
level within your MasterCmd.
Below is a sample command to read Modbus addresses 0321 to 0480 of node 1
on the Modbus network.
Label Description
Enable = 1
Causes the module to send the command every time it goes through
the command list.
IntAddress = 16320
Places the data read from the slave device into the module at address
16320. IntAddress 16320 of the module memory will be copied into the
tag MCM.DATA.ReadData[20] because 16320 represents a bit address
within the memory of the MVI56-MCM module (16320 / 16 = register
1020).
Count = 160
Reads 160 consecutive bits from the slave device.
Node = 1
Issues the Modbus command to node 1 on the network.
Func = 1
Issues a Modbus Function code of 1 to Read Coils.
DevAddress = 320
Function Code 1, DevAddress of 320 will read address 0321
Along with a count of 160, this command reads 0321 to 0480.
4.3.4 Read Input Coils 1xxxx (Modbus Function Code 2)
Used to read Input Coils from a slave device, these are single bit addresses
within a Modbus slave device. Unlike Coils 0xxx, the Input Coils are Read Only
values and cannot be written to by a Modbus Master device. Also like the Coils
0xxx, the IntAddress field of this command is defined down to the bit level within
the module memory.
Below is a sample command to read Modbus addresses 10081 to 10090 of node
1 on the Modbus network.