ProSoft Technology MVI56E-MCM/MCMXT User Manual
Page 191

MVI56E-MCM ♦ ControlLogix Platform
Reference
Modbus Communication Module
User Manual
ProSoft Technology, Inc.
Page 191 of 199
June 18, 2014
Note: The _W
RITE
C
ONTROL
routine handles the command control blocks sent to the module. If
command control, event command, or Slave status blocks are not going to be used in the
application, then the _W
RITE
C
ONTROL
rung (rung 7 in the sample W
RITE
D
ATA
task) and the
_R
EAD
C
ONTROL
and _W
RITE
C
ONTROL
ladder files may be removed.
_PassThru
Use this optional task to send pass-through data between the processor and the
Modbus devices connected to the MVI56E-MCM module. Pass-Through
functionality allows the Modbus Master to read and write the same Modbus
address on a Modbus Slave. If pass-through mode is not chosen, then the
attached Modbus Master device must read from one set of Modbus register/bits
and write to another set of Modbus register/bits. Pass-Through mode takes a
Modbus write command (Function Codes 5, 6, 15, and 16) and passes that to the
ControlLogix processor. The pass-through ladder logic then parses that
information and updates the MCM.DATA.W
RITE
D
ATA
array with the new value
that has been written by the Modbus Master.
_ReadControl
Use this optional task to get status and event data from the Modbus devices
connected to the MVI56E-MCM module. Special command blocks requested
from the module in the _WriteControl routine are processed and handled in this
routine. If command control, event command, or Slave status blocks are not
going to be used in the application, then this rung and the _ReadControl and
_WriteControl ladder files may be removed.
_WriteControl
Use this optional task to send commands to the Modbus devices connected to
the MVI56E-MCM module. Command Control, Event Command, and Slave
status blocks are sent to the module in this task.
Copying the Controller Tags
Next, copy the Controller Tags from the sample program to your existing
program. The sample program includes the following tags in the MCM structure.
MCM.M
OD
D
EF
configures the database in the module. The module uses this
database to store input and output data transferred between the processor
and the Modbus devices connected to the MVI56E-MCM module.
MCM.P
ORT
1
and MCM.P
ORT
2
configure the module’s serial ports for Modbus
communications. The sample program configures Port 1 as a Modbus
Master, and Port 2 as a Modbus Slave.
MCM.P1.C
MD
and MCM.P2.C
MD
configure the Modbus Master commands for
the module. These commands are active only if a port is configured as a
Modbus Master.
MCM.R
EAD
D
ATA
contains data read by the ControlLogix processor from the
MVI56E-MCM module.
MCM.W
RITE
D
ATA
contains data read from the ControlLogix processor to the
module’s internal database.