
Verify Communications
MVI56-MCM
♦
ControlLogix Platform
Modbus Communication Module
ProSoft Technology, Inc.
Page 63 of 159
July 24, 2008
6.2.1 Command Error Codes
The MVI56-MCM module will return an individual error code for every command
configured within the MCM.CONFIG.PortXMasterCmd section. The location of
these error codes are determined by the parameter
MCM.CONFIG.PortX.CmdErrPtr. This parameter determines where in the
module's 5000 register database the error codes for each command will be
placed. The amount of error codes returned into the database is determined by
the MCM.CONFIG.PortX.CmdCount parameter, therefore is the maximum
number of commands have been selected (100), then 100 register will be placed
into the module memory.
To be useful in the application, these error codes must be placed within the
MCM.DATA.ReadData array.
Once again, the configuration in the MCM.CONFIG.ModDef section for
ReadStartReg, and ReadRegCount determine which of the 5000 register will be
presented to the Control Logix processor and placed in the tag
MCM.DATA.ReadData array.
Based on the sample configuration values for ReadStartReg and ReadRegCnt,
this will be addresses 1000 to 1599 of the module memory. Below are the
sample configuration values.
Based on these values shown above, a good place for the
MCM.CONFIG.PortX.CmdErrPtr is address 1500, as shown.
With the CmdErrPtr pointer set to address 1500 and the CmdCount set to a value
of 100, this will place your Command Error Data at addresses 1500 to 1599 of
the module memory, and because of the before mentioned configuration of the
MCM.CONFIG.ModDef ReadStartReg and ReadRegCnt parameters, the
command error data will be placed into the tags MCM.DATA.ReadData[500]-
[599].
Each command setup in the MCM.CONFIG.PortX.MasterCmd will occupy one
register within the ReadData array. Based on the sample configuration values,
the table below is true.
Error Code for Command
ReadData Location
MCM.CONFIG.Port1MasterCmd[0] MCM.DATA.ReadData[500]
MCM.CONFIG.Port1MasterCmd[1] MCM.DATA.ReadData[501]
MCM.CONFIG.Port1MasterCmd[2] MCM.DATA.ReadData[502]
MCM.CONFIG.Port1MasterCmd[3] MCM.DATA.ReadData[503]
MCM.CONFIG.Port1MasterCmd[4] MCM.DATA.ReadData[504]
MCM.CONFIG.Port1MasterCmd[98] MCM.DATA.ReadData[598]
MCM.CONFIG.Port1MasterCmd[99] MCM.DATA.ReadData[599]
To know where to look for the error data, you need to know what the individual
error codes are.