ProSoft Technology MVI69-MCM User Manual
Page 71

MVI69-MCM ♦ CompactLogix or MicroLogix Platform
Ladder Logic
Modbus Communication Module
User Manual
ProSoft Technology, Inc.
Page 71 of 167
March 22, 2011
3.2
Module Data Object (MCM1ModuleDef)
All data related to the MVI69-MCM is stored in a user defined data type. An
instance of the data type is required before the module can be used. This is done
by declaring a variable of the data type in the Controller Tags Edit Tags dialog
box. The following table describes the structure of this object.
Name
Data Type
Description
BlockTransferSize
INT
ReadData
INT[480]
Data read from module
WriteData
INT[480]
Data written to module
BP
MCM1Backplane
ModuleStatus
MCM1_STATUS
BlockRequest
MCM1BlockRequest
CommandControl
MCM1CommandControlPorts
EventCommand
MCM1EventCommandPorts
SlavePollingControl
MCM1SlavePollingControlPorts
SlaveStatus
MCM1SlaveStatusPorts
MBCoil
MCM1Coil_Array
This object contains objects that define the configuration, user data, status and
command control data related to the module.
This object reads and write data between the module and the processor. Values
entered determine the ladder logic and data size required in the application. The
ReadData and WriteData arrays must be sized to or larger than the count values
entered. The ladder logic must process the number of blocks of data to be
transferred. The number of blocks is computed as follows:
BlockCnt = INT(RegCnt/n) + if(MOD(RegCnt, n), 1,0)
Where n is the block transfer size, and equals 60, 120 or 240.
If the register count is evenly divisible by n, the number of blocks is easy to
compute and the ladder is much simpler to write. If the number is not evenly
divisible by n, special handling of the last block of data must be developed, as it
must transfer less than n words.
Important: It is recommended that the count values always be set to values evenly divisible by n.