Mvi56e MCMMCMXT User Manual
Mvi56e MCMMCMXT User Manual
Mvi56e MCMMCMXT User Manual
USER MANUAL
How to Contact Us
ProSoft Technology 5201 Truxtun Ave., 3rd Floor Bakersfield, CA 93309 +1 (661) 716-5100 +1 (661) 716-5101 (Fax) www.prosoft-technology.com [email protected] Copyright 2012 ProSoft Technology, Inc., all rights reserved. MVI56E-MCM User Manual February 15, 2012 ProSoft Technology , ProLinx , inRAx , ProTalk , and RadioLinx are Registered Trademarks of ProSoft Technology, Inc. All other brand or product names are or may be trademarks of, and are used to identify products and services of, their respective owners.
243333
E183151
ME06
<Ex> II 3 G Ex nA T5 0 <= Ta <= 60 C C -25 <= Ta <= 70 (XT models only) C C II Equipment intended for above ground use (not for use in mines). 3 Category 3 equipment, investigated for normal operation only. G Equipment protected against explosive gasses. <cULus> E183151 Class I, DIV 2, groups A,B,C,D T5 for all models 0 to +60 C C -25 to +70 (XT models only) C C
Contents
Your Feedback Please ........................................................................................................................ 2 How to Contact Us .............................................................................................................................. 2 ProSoft Technology Product Documentation .................................................................................... 2 Important Safety Information - MVI56E-MCM/XT ............................................................................... 3 Battery Life Advisory ........................................................................................................................... 4
9 11
Start Here
System Requirements ............................................................................................. 12 Deployment Checklist.............................................................................................. 13 Package Contents ................................................................................................... 15 Setting Jumpers ...................................................................................................... 16 Installing the Module in the Rack ............................................................................ 17 Using ProSoft Configuration Builder Software ........................................................ 19 Setting Up the Project ............................................................................................. 20 Connecting Your PC to the Module's Ethernet Port ................................................ 21 Setting Up a Permanent IP Address ....................................................................... 25 Importing the Sample Add-On Instruction ............................................................... 37 About the Optional Add-On Instruction ................................................................... 37 Creating a New RSLogix 5000 Project.................................................................... 38 Creating the Module ................................................................................................ 39 Import the Ladder Rung .......................................................................................... 41 Adjust the Input and Output Array Sizes (Optional) ................................................ 50 Connecting Your PC to the ControlLogix Processor ............................................... 52 Downloading the Sample Program to the Processor .............................................. 53 Configuring the RSLinx Driver for the PC COM Port .............................................. 54
2
2.1 2.2
57
2.2.1 2.2.2 2.2.3 2.3 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.4 2.4.1 2.4.2
Overview.................................................................................................................. 58 ModDef Settings ...................................................................................................... 59 Port Configuration ................................................................................................... 61 Master Command Configuration ............................................................................. 62 Other Modbus Addressing Schemes ...................................................................... 66 Master Command Examples ................................................................................... 67 Read Holding Registers 4x (Modbus Function Code 3) .......................................... 67 Read Input Registers 3x (Modbus Function Code 4) .............................................. 68 Read Coil Status 0x (Modbus Function Code 1) ..................................................... 69 Read Input Status 1x (Modbus Function Code 2) ................................................... 70 Force (Write) Single Coil 0x (Modbus Function Code 5) ........................................ 71 Force (Write) Multiple Coils 0x (Modbus Function Code 15) .................................. 72 Preset (Write) Single Register 4x (Modbus Function Code 6) ................................ 73 Preset (Write) Multiple Registers 4x (Modbus Function Code 16) .......................... 74 Floating-Point Data Handling (Modbus Master) ...................................................... 75 Read Floating-Point Data ........................................................................................ 75 Read Multiple Floating-Point Registers ................................................................... 76
Page 5 of 215
3
3.1 3.2
85
Overview ................................................................................................................. 86 ModDef Settings ..................................................................................................... 87 Modbus Memory Map ............................................................................................. 89 Customizing the Memory Map ................................................................................ 90 Slave Configuration ................................................................................................ 92 Floating-Point Data Handling (Modbus Slave) ....................................................... 93 Enron/Daniel Float Configuration............................................................................ 94 Read and Write Same Modbus Address (Pass Through) ...................................... 95
4
4.1
Verify Communication
4.1.1 4.1.2 4.1.3 4.2 4.2.1
97
Verifying Master Communications .......................................................................... 98 MVI56E-MCM Status Data Definition as a Master ................................................. 98 Command Error Codes ......................................................................................... 100 MCM Status Data ................................................................................................. 104 Verify Slave Communications ............................................................................... 105 MVI56E-MCM Status Data Definition as a Slave ................................................. 106
5
5.1
109
Ethernet LED Indicators ........................................................................................ 110 Scrolling LED Status Indicators ............................................................................ 110 Non-Scrolling LED Status Indicators .................................................................... 111 Using the Diagnostics Menu in ProSoft Configuration Builder ............................. 112 Connect to the Modules Web Page ..................................................................... 114 The Diagnostics Menu .......................................................................................... 115 Monitoring Backplane Information ........................................................................ 116 Monitoring Database Information.......................................................................... 117 Monitoring General Information ............................................................................ 118 Monitoring Modbus Port Information .................................................................... 118 Data Analyzer ....................................................................................................... 119 Reading Status Data from the Module ................................................................. 123 Viewing the Error Status Table ............................................................................. 123 Communication Error Codes ................................................................................ 124 Clearing a Fault Condition .................................................................................... 125 Troubleshooting .................................................................................................... 126
6
6.1
Reference
6.1.1 6.1.2 6.1.3
127
Product Specifications .......................................................................................... 128 What's New? ......................................................................................................... 128 General Specifications .......................................................................................... 129 General Specifications - Modbus Master/Slave.................................................... 129
Page 6 of 215
Functional Specifications....................................................................................... 130 Hardware Specifications........................................................................................ 131 Functional Overview .............................................................................................. 132 About the MODBUS Protocol ................................................................................ 132 Backplane Data Transfer....................................................................................... 132 Normal Data Transfer ............................................................................................ 134 Special Function Blocks ........................................................................................ 135 Data Flow Between MVI56E-MCM Module and ControlLogix Processor ............. 148 Cable Connections ................................................................................................ 152 Ethernet Cable Specifications ............................................................................... 152 Ethernet Cable Configuration ................................................................................ 153 Ethernet Performance ........................................................................................... 153 RS-232 Application Port(s) ................................................................................... 153 RS-422 .................................................................................................................. 156 RS-485 Application Port(s) .................................................................................... 156 DB9 to RJ45 Adaptor (Cable 14) .......................................................................... 157 MVI56E-MCM Database Definition ....................................................................... 158 MVI56E-MCM Configuration Data ......................................................................... 159 Backplane Setup ................................................................................................... 159 Port 1 Setup .......................................................................................................... 160 Port 2 Setup .......................................................................................................... 162 Port 1 Commands ................................................................................................. 164 Port 2 Commands ................................................................................................. 165 Misc. Status ........................................................................................................... 165 Command Control ................................................................................................. 166 MVI56E-MCM Status Data Definition .................................................................... 167 MVI56E-MCM User Defined Data Types .............................................................. 169 MCMModuleDef .................................................................................................... 169 MCMCONFIG ........................................................................................................ 169 MCMDATA ............................................................................................................ 171 MCMSTATUS ........................................................................................................ 172 MCMCONTROL .................................................................................................... 173 Util ......................................................................................................................... 173 Modbus Protocol Specification .............................................................................. 176 Commands Supported by the Module ................................................................... 176 Read Coil Status (Function Code 01) ................................................................... 177 Read Input Status (Function Code 02).................................................................. 178 Read Holding Registers (Function Code 03) ........................................................ 179 Read Input Registers (Function Code 04)............................................................. 180 Force Single Coil (Function Code 05) ................................................................... 180 Preset Single Register (Function Code 06)........................................................... 182 Diagnostics (Function Code 08) ............................................................................ 182 Force Multiple Coils (Function Code 15) ............................................................... 184 Preset Multiple Registers (Function Code 16) ...................................................... 185 Modbus Exception Responses .............................................................................. 185 Using the Optional Add-On Instruction Rung Import ............................................. 188 Before You Begin .................................................................................................. 188 Overview................................................................................................................ 188 Importing the Utility Add-On Instruction Rung ....................................................... 189 Reading the Ethernet Settings from the Module ................................................... 192 Writing the Ethernet Settings to the Module.......................................................... 193 Reading the Clock Value from the Module............................................................ 195 Writing the Clock Value to the Module .................................................................. 195 Using the Sample Program - RSLogix 5000 Version 15 and earlier ..................... 197
Page 7 of 215
211
Index
213
Page 8 of 215
Start Here (page 11) This section introduces the customer to the module. Included are: package contents, system requirements, hardware installation, and basic configuration.
Reference (page 127) Product Specifications (page 128) Functional Overview (page 132)
These sections contain general references associated with this product, Specifications, and the Functional Overview.
Functional Overview
This section contains Support, Service and Warranty information. Index of chapters.
Page 9 of 215
Page 10 of 215
Start Here
In This Chapter
System Requirements ........................................................................... 12 Deployment Checklist ............................................................................ 13 Package Contents ................................................................................. 15 Setting Jumpers .................................................................................... 16 Installing the Module in the Rack........................................................... 17 Using ProSoft Configuration Builder Software ....................................... 19 Importing the Sample Add-On Instruction.............................................. 37 Creating a New RSLogix 5000 Project .................................................. 38 Connecting Your PC to the ControlLogix Processor.............................. 52 Downloading the Sample Program to the Processor ............................. 53
To get the most benefit from this User Manual, you should have the following skills: Rockwell Automation RSLogix software: launch the program, configure ladder logic, and transfer the ladder logic to the processor Microsoft Windows: install and launch programs, execute menu commands, navigate dialog boxes, and enter data Hardware installation and wiring: install the module, and safely connect Modbus and ControlLogix devices to a power source and to the MVI56EMCM modules application port(s)
Page 11 of 215
1.1
System Requirements
The MVI56E-MCM module requires the following minimum hardware and software components: Rockwell Automation ControlLogix processor (firmware version 10 or higher), with compatible power supply, and one free slot in the rack for the MVI56E-MCM module. The module requires 800 mA of available 5 Vdc power Rockwell Automation RSLogix 5000 programming software o Version 16 or higher required for Add-On Instruction o Version 15 or lower must use Sample Ladder, available from www.prosoft-technology.com Rockwell Automation RSLinx communication software version 2.51 or higher ProSoft Configuration Builder (PCB) (included) ProSoft Discovery Service (PDS) (included in PCB) Pentium II 450 MHz minimum. Pentium III 733 MHz (or better) recommended Supported operating systems: o Microsoft Windows Vista o Microsoft Windows XP Professional with Service Pack 1 or 2 o Microsoft Windows 2000 Professional with Service Pack 1, 2, or 3 o Microsoft Windows Server 2003 128 Mbytes of RAM minimum, 256 Mbytes of RAM recommended 100 Mbytes of free hard disk space (or more based on application requirements) 256-color VGA graphics adapter, 800 x 600 minimum resolution (True Color 1024 768 recommended) CD-ROM drive
Note: The Hardware and Operating System requirements in this list are the minimum recommended to install and run software provided by ProSoft Technology. Other third party applications may have different minimum requirements. Refer to the documentation for any third party applications for system requirements. Note: You can install the module in a local or remote rack. For remote rack installation, the module requires EtherNet/IP or ControlNet communication with the processor.
Page 12 of 215
1.2
Deployment Checklist
Before you begin configuring the module, consider the following questions. Your answers will help you determine the scope of your project, and the configuration requirements for a successful deployment. 1 ____________ Are you creating a new application or integrating the module into an existing application? Most applications can use the Sample Add-On Instruction or Sample Ladder Logic without any edits to the Sample Program. 2 ____________ Which slot number in the chassis will the MVI56E-MCM module occupy? For communication to occur, you must enter the correct slot number in the sample program. 3 ____________ Are RSLogix 5000 and RSLinx installed? RSLogix and RSLinx are required to communicate to the ControlLogix processor (1756-L1, L55, L61 & L63). Sample Ladder programs are available for different versions of RSLogix 5000. 4 ____________ How many words of data do you need to transfer in your application (from ControlLogix to Module / to ControlLogix from Module)? The MVI56E-MCM module can transfer a maximum of 5000 (16-bit) registers to and from the ControlLogix processor. The Sample Ladder transfers 600 words to the ControlLogix processor (into the Read Data array), and obtains 600 words from the ControlLogix processor (from the Write Data array) 5 ____________ Will you be using the module as a Modbus Master or Modbus Slave? Will you be transferring data using Modbus RTU or Modbus ASCII? Modbus is a Master/Slave network. Only one Master is allowed on the serial communications line (max 32 devices/RS485). The Master is responsible for polling data from the Slaves on the network. 6 ____________ For a Modbus Master, what Slave Device Addresses and Modbus Data Addresses do you need to exchange data with on the Modbus network? For a Modbus Master, you must know the Slave Device Address number of each Slave device to poll. You also need the Modbus address (for example, coil 00001, register 40001) of the data to read from or write to each Slave device. 7 ____________ For a Modbus Slave, how many words or bits of data do you need to send to the Master device? The MVI56E-MCM module can send data to a Modbus Master as 0x coil data, 1x input coil data, 3x input registers, and 4x holding registers. The sample program transfers 600 (16-bit) words or 9600 bits to the ControlLogix processor, and 600 (16-bit) words or 9600 bits from the ControlLogix processor. 8 Serial Communication Parameters for the Modbus network: ____________ Baud rate? ____________ Data bits?
Page 13 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module ____________ Parity? ____________ Stop bits? Required for both Master and Slave configurations. ____________ Wiring type to use (RS232, 422 or 485). Configured by jumper settings. Required for proper implementation of the module in Master and Slave configurations.
Note: If you are installing your module into a new system, and plan to use our Sample Ladder Logic, refer to the printed Quick Start Guide in the module package for simple installation procedures. For version 16 or newer of RSLogix 5000, refer to Upload the Add-On Instruction from the Module. For EXISTING system installations, refer to Using the Sample Program - RSLogix Version 15 and earlier (page 197). Note: Most applications can use the Sample Ladder Logic without modifying the sample program.
Page 14 of 215
1.3
Package Contents
The following components are included with your MVI56E-MCM module, and are all required for installation and configuration. Important: Before beginning the installation, please verify that all of the following items are present.
Qty. 1 1 2 Part Name Cable Cable Part Number RL-CBL025 Part Description Modbus Communication Module 5 foot Ethernet Straight-Through Cable (Gray) MVI56E-MCM Module MVI56E-MCM
Cable #14, RJ45 to For DB9 Connection to Modules DB9 Male Adapter Application Serial Port cable 1454-9F Two Adapters, DB9 Female to Screw Terminal. For RS422 or RS485 Connections to Port 1 and 2 of the Module Contains ProSoft Configuration Builder (PCB) and ProSoft Discovery Service (PDS) for the MVI56E-MCM modules.
Adapter
ProSoft Solutions CD
If any of these components are missing, please contact ProSoft Technology Support for replacement parts.
Page 15 of 215
1.4
Setting Jumpers
There are three jumpers located at the bottom of the module. The first two jumpers (P1 and P2) set the serial communication mode: RS-232, RS-422 or RS485. The following illustration shows the MVI56E-MCM jumper configuration, with the Setup Jumper OFF.
The Setup Jumper acts as "write protection" for the modules firmware. In "write protected" mode, the Setup pins are not connected, and the modules firmware cannot be overwritten. The module is shipped with the Setup jumper OFF. If you need to update the firmware, apply the Setup jumper to both pins. Note: If you are installing the module in a remote rack, you may prefer to leave the Setup pins jumpered. That way, you can update the modules firmware without requiring physical access to the module.
Page 16 of 215
1.5
Warning: You must follow all safety instructions when installing this or any other electronic devices. Failure to follow safety procedures could result in damage to hardware or data, or even serious injury or death to personnel. Refer to the documentation for each device you plan to connect to verify that suitable safety procedures are in place before installing or servicing the device.
After you have checked the placement of the jumpers, insert the MVI56E-MCM into the ControlLogix chassis. Use the same technique recommended by Rockwell Automation to remove and install ControlLogix modules. You can install or remove ControlLogix system components while chassis power is applied and the system is operating. However, please note the following warning.
Warning: When you insert or remove the module while backplane power is on, an electrical arc can occur. An electrical arc can cause personal injury or property damage by sending an erroneous signal to your systems actuators. This can cause unintended machine motion or loss of process control. Electrical arcs may also cause an explosion when they happen in a hazardous environment. Verify that power is removed or the area is non-hazardous before proceeding. Repeated electrical arcing causes excessive wear to contacts on both the module and its mating connector. Worn contacts may create electrical resistance that can affect module operation.
Page 17 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module Align the module with the top and bottom guides, and then slide it into the rack until the module is firmly against the backplane connector.
2 3 4
With a firm, steady push, snap the module into place. Check that the holding clips on the top and bottom of the module are securely in the locking holes of the rack. Make a note of the slot location. You must identify the slot in which the module is installed in order for the sample program to work correctly. Slot numbers are identified on the green circuit board (backplane) of the ControlLogix rack. Turn power ON.
Note: If you insert the module improperly, the system may stop working or may behave unpredictably.
Note: When using the MVI56EMCMXT, you must use the 1756-A5XT or 1756-A7LXT chassis. In these chassis, modules are spaced further apart than in standard ControlLogix chassis. Blank spacers are inserted between active modules.
Page 18 of 215
1.6
Note: The MVI56E-MCM module receives its protocol and backplane configuration information from the Ladder Logic. Use ProSoft Configuration Builder to configure the modules Ethernet settings.
To install ProSoft Configuration Builder from the CD-ROM
Insert the ProSoft Solutions CD-ROM into the CD drive of your PC. Wait for the startup screen to appear.
2 3
On the startup screen, click INSTALL PROSOFT CONFIGURATION BUILDER. This action starts the installation wizard for ProSoft Configuration Builder. Click NEXT on each page of the installation wizard. Click FINISH on the last page of the wizard.
Page 19 of 215
If you have used other Windows configuration tools before, you will find the screen layout familiar. PCBs window consists of a tree view on the left, and an information pane and a configuration pane on the right side of the window. When you first start PCB, the tree view consists of folders for Default Project and Default Location, with a Default Module in the Default Location folder. The following illustration shows the PCB window with a new project.
Your first task is to add the MVI56E-MCM module to the project. 1 Use the mouse to select DEFAULT MODULE in the tree view, and then click the right mouse button to open a shortcut menu.
Page 20 of 215
On the shortcut menu, select CHOOSE MODULE TYPE. This action opens the Choose Module Type dialog box.
In the Product Line Filter area of the dialog box, select MVI56E. In the Select Module Type dropdown list, select MVI56E-MCM, and then click OK to save your settings and return to the ProSoft Configuration Builder window.
Page 21 of 215
Important: ProSoft Configuration Builder locates MVI56E-MCM modules through UDP broadcast messages. These messages may be blocked by routers or layer 3 switches. In that case, ProSoft Discovery Service will be unable to locate the modules. To use ProSoft Configuration Builder, arrange the Ethernet connection so that there is no router/ layer 3 switch between the computer and the module OR reconfigure the router/ layer 3 switch to allow routing of the UDP broadcast messages.
In the tree view in ProSoft Configuration Builder, select the MVI56E-MCM module.
Click the right mouse button to open a shortcut menu. On the shortcut menu, choose DIAGNOSTICS.
Page 22 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module 3 In the Diagnostics window, click the SET UP CONNECTION button.
In the Connection Setup dialog box, click the BROWSE DEVICE(S) button to open the ProSoft Discovery Service. Select the module, then right-click and choose ASSIGN TEMPORARY IP.
The modules default IP address is usually 192.168.0.250. Choose an unused IP within your subnet, and then click OK.
Important: The temporary IP address is only valid until the next time the module is initialized. For information on how to set the modules permanent IP address, see Setting Up a Permanent IP Address (page 25).
Page 23 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module Close the ProSoft Discovery Service window. Enter the temporary IP in the Ethernet address field of the Connection Setup dialog box, then click the TEST CONNECTION button to verify that the module is accessible with the current settings.
If the Test Connection is successful, click CONNECT. The Diagnostics menu will display in the Diagnostics window.
Page 24 of 215
Note: For alternative methods of connecting to the module with your PC, refer to Using CIPconnect to Connect to the Module (page 27) or Using RSWho to Connect to the Module (page 35).
These steps show you how to set a permanent IP address on the module. The modules default IP address is 192.168.0.250. 1 Start ProSoft Configuration Builder. 2 Select the MVI56E-MCM icon, and then click the [+] symbol to expand the MVI56E-MCM tree. 3 Select ETHERNET CONFIGURATION, and then click the right mouse button to open a shortcut menu. 4 On the shortcut menu, select CONFIGURE.
This action opens the EDIT-WATTCP dialog box. Use this dialog box to enter the MVI56E-MCM modules permanent IP Address (MY_IP), SUBNET MASK (NETMASK) and DEFAULT GATEWAY (GATEWAY).
Page 25 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module Click OK to save the updated Ethernet configuration. Next, select the MVI56E-MCM icon, and then click the right mouse button to open a shortcut menu. On the shortcut menu, choose DOWNLOAD FROM PC TO DEVICE.
This action opens the DOWNLOAD dialog box. Notice that the Ethernet address field contains the temporary IP address you assigned previously. ProSoft Configuration Builder will use this temporary IP address to connect to the module.
Click TEST CONNECTION to verify that the temporary IP address is correct. 7 If the connection succeeds, click DOWNLOAD to transfer the Ethernet configuration to the module. If the Test Connection procedure fails, you will an error message. To correct the error, follow these steps. 1 Click OK to dismiss the error message.
Page 26 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module 2 On the DOWNLOAD dialog box, click BROWSE DEVICES to open PROSOFT DISCOVERY SERVICe.
3 4 5
Select the module, and then click the right mouse button to open a shortcut menu. On the shortcut menu, choose SELECT FOR PCB. Close Prosoft Discovery Service. Click DOWNLOAD to transfer the Ethernet configuration to the module.
Using CIPconnect to Connect to the Module You can use CIPconnect to connect a PC to the ProSoft Technology MVI56EMCM module over Ethernet using Rockwell Automations 1756-ENBT EtherNet/IP module. This allows you to configure the MVI56E-MCM network settings and view module diagnostics from a PC. RSLinx is not required when you use CIPconnect. All you need are: The IP addresses and slot numbers of any 1756-ENBT modules in the path The slot number of the MVI56E-MCM in the destination ControlLogix chassis (the last ENBTx and chassis in the path). To use CIPconnect, follow these steps.
Page 27 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module In the Select Port dropdown list, choose 1756-ENBT. The default path appears in the text box, as shown in the following illustration.
Click CIP PATH EDIT to open the CIPconnect Path Editor dialog box.
The CIPconnect Path Editor allows you to define the path between the PC and the MVI56E-MCM module. The first connection from the PC is always a 1756ENBT (Ethernet/IP) module. Each row corresponds to a physical rack in the CIP path. If the MVI56E-MCM module is located in the same rack as the first 1756ENBT module, select RACK NO. 1 and configure the associated parameters. If the MVI56E-MCM is available in a remote rack (accessible through ControlNet or Ethernet/IP), include all racks (by using the ADD RACK button). Page 28 of 215 ProSoft Technology, Inc. February 15, 2012
Node address of the source module (only applicable for 1756CNB) Select the destination module associated to the source module in the rack. The connection between the source and destination modules is performed through the backplane. The slot number where the destination MVI56E module is located.
To use the CIPconnect Path Editor, follow these steps. 1 Configure the path between the 1756-ENBT connected to your PC and the MVI56E-MCM module. o If the module is located in a remote rack, add more racks to configure the full path. o The path can only contain ControlNet or Ethernet/IP networks. o The maximum number of supported racks is six. 2 Click CONSTRUCT CIP PATH to build the path in text format 3 Click OK to confirm the configured path. The following examples should provide a better understanding on how to set up the path for your network. Example 1: Local Rack Application For this example, the MVI56E-MCM module is located in the same rack as the 1756-ENBT that is connected to the PC.
Page 29 of 215
Configure the path as shown in the following illustration, and click CONSTRUCT CIP PATH to build the path in text format.
Click OK to close the CIPconnect Path Editor and return to the Download dialog box.
Page 30 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module 3 Check the new path in the Download dialog box.
Click TEST CONNECTION to verify that the physical path is available. The following message should be displayed upon success.
Page 31 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module Click OK to close the Test Connection pop-up and then click DOWNLOAD to download the configuration files to the module through the path.
Example 2: Remote Rack Application For this example, the MVI56E-MCM module is located in a remote rack accessible through ControlNet, as shown in the following illustration.
Rack 1
Slot 0 1 2 3 Module ControlLogix Processor 1756-CNB 1756-ENBT Any Network Address Node = 1 IP=192.168.0.100 -
Page 32 of 215
Rack 2
Slot 0 1 2 3 4 5 6 Module Any Any Any Any Any 1756-CNB MVI56E-MCM Network Address Node = 2 -
Page 33 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module Configure the path as shown in the following illustration and click CONSTRUCT CIP PATH to build the path in text format.
Click OK to close the CIPconnect Path Editor and return to the Download dialog box. Check the new path in the Download dialog box.
Page 34 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module 4 Click TEST CONNECTION to verify that the physical path is available. The following message should be displayed upon success.
Click DOWNLOAD to download the configuration files to the module through the path.
You need to have RSLinx installed on your PC to use this feature. You also need an ENBT module set up in the rack. For information on setting up the ENBT module, see Using CIPconnect to Connect to the Module (page 27).
1 2
In the tree view in ProSoft Configuration Builder, right-click the MVI56E-MCM module. From the shortcut menu, choose DOWNLOAD FROM PC TO DEVICE.
Page 35 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module In the Download dialog box, choose 1756 ENBT from the Select Connection Type dropdown box.
Click RSWHO to display modules on the network. The MVI56E-MCM module will automatically be identified on the network.
5 6
Select the module, and then click OK. In the Download dialog box, click DOWNLOAD.
Page 36 of 215
1.7
Note: This section only applies if your processor is using RSLogix 5000 version 16 or higher. If you have an earlier version, please see Using the Sample Program (page 197).
Before You Begin Two Add-On Instructions are provided for the MVI56E-MCM module. The first is required for setting up the module; the second is optional. Copy the files from the ProSoft Solutions CD-ROM, or download them from www.prosoft-technology.com. Save them to a convenient location in your PC, such as Desktop or My Documents.
File Name MVI56(E)MCM_AddOn_Rung_v2_2.L5X Description L5X file containing Add-On Instruction, user defined data types, controller tags and ladder logic required to configure the MVI56E-MCM module Optional L5X file containing additional Add-On Instruction with logic for changing Ethernet configuration and clock settings.
MVI56(E)MCM_Optional_Rung_<VersionNu mOpt>.L5X
Page 37 of 215
1.8
2 3 4 5 6
Select your ControlLogix controller model. Select REVISION 16. Enter a name for your controller, such as My_Controller. Select your ControlLogix chassis type. Select SLOT 0 for the controller.
Page 38 of 215
Select the 1756-MODULE (GENERIC 1756 MODULE) from the list and click OK. This action opens the NEW MODULE dialog box.
Page 39 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module In the NEW MODULE dialog box, enter the following values.
Value MCM Enter a description for the module. Example: Modbus Communication Module Select DATA-INT Enter the slot number in the rack where the MVI56E-MCM module is located 1 250 2 248 0
Parameter NAME DESCRIPTION COMM FORMAT SLOT INPUT ASSEMBLY INSTANCE INPUT SIZE OUTPUT ASSEMBLY INSTANCE OUTPUT SIZE CONFIGURATION SIZE
Important: You must select the COMM FORMAT as DATA - INT in the dialog box, otherwise the module will not communicate over the backplane of the ControlLogix rack. 4 5 Click OK to continue. Edit the Module Properties. Select the REQUESTED PACKET INTERVAl value for scanning the I/O on the module. This value represents the minimum frequency at which the module will handle scheduled events. This value should not be set to less than 1 millisecond. The default value is 5 milliseconds. Values between 1 and 10 milliseconds should work with most applications.
Page 40 of 215
Click OK to close the dialog box. Notice that the module now appears in the CONTROLLER ORGANIZATION window.
Page 41 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module Navigate to the location on your PC where you saved (page 37) the Add-On Instruction (for example, My Documents or Desktop). Select the MVI56(E)MCM_ADDON_RUNG_V2_4.L5X file
This action opens the IMPORT CONFIGURATION dialog box, showing the controller tags that will be created.
If you are using the module in a different slot (or remote rack), select the correct connection input and output variables that define the path to the module. If your module is located in Slot 1 of the local rack, this step is not required.
Page 42 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module 6 Click OK to confirm the import. RSLogix will indicate that the import is in progress:
When the import is completed, the new rung with the Add-On Instruction will be visible as shown in the following illustration.
The procedure has also imported new User Defined Data Types, Controller Tags, and the Add-On instruction for your project.
Save the application and then download the sample ladder logic into the processor.
Page 43 of 215
Important: If your application requires more than one MVI56E-MCM module in the same project, follow the steps below. 1 In the I/O CONFIGURATION folder, click the right mouse button to open a shortcut menu, and then choose NEW MODULE.
Select 1756-MODULE
Parameter NAME DESCRIPTION COMM FORMAT SLOT INPUT ASSEMBLY INSTANCE INPUT SIZE OUTPUT ASSEMBLY INSTANCE OUTPUT SIZE CONFIGURATION SIZE
Page 44 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module 4 Click OK to confirm. The new module is now visible:
5 6 7
Expand the TASKS folder, and then expand the MAINTASK folder. In the MAINPROGRAM folder, double-click to open the MAINROUTINE ladder. Select an empty rung in the routine, and then click the right mouse button to open a shortcut menu. On the shortcut menu, choose IMPORT RUNG
Page 45 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module Select the MVI56(E)MCM_ADDON_RUNG_V2_4.L5X file, and then click IMPORT.
This action opens the IMPORT CONFIGURATION window, which shows the tags that will be imported.
Page 46 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module 10 Associate the I/O connection variables to the correct module. The default values are Local:1:I and Local:1:O so these require change.
Page 47 of 215
11 Change the default tags MCM and AOI56MCM to avoid conflict with existing tags. In this procedure, you will append the string "_2" as shown in the following illustration.
Page 48 of 215
The setup procedure is now complete. Save the project and download the application to your ControlLogix processor.
Page 49 of 215
In the edit window, change the value of the READDATA array from INT[600] to INT[1000] as shown, and then click APPLY.
Note: If RSLogix resets your data values, refer to the backup copy of your program to re-enter your configuration parameters. 3 Next, navigate to CONTROLLER TAGS and double click to open an edit window. Click the MONITOR TAGS tab at the bottom of the edit window.
Page 50 of 215
Click [+] to expand the MCM.CONFIG.MODDEF section, and then change the READREGCNT parameter from 600 to 1000.
5 6
Save and download the sample program to the processor. Go Online with the ControlLogix processor, and then toggle the MCM.CONTROL.WARMBOOT bit to download the configuration to the MVI56E-MCM module.
Note: Any changes made to the MCM.CONFIG or WriteData arrays must be downloaded to the MVI56E-MCM module. The use of the MCM.CONTROL.WarmBoot or MCM.CONTROL.ColdBoot bit will cause the MVI56E-MCM module to re- read the configuration from the ControlLogix processor. To modify the WRITEDATA array, follow the steps in this topic, but substitute WRITEDATA for ReadData throughout. Also, make sure that the READDATA and WRITEDATA arrays do not overlap in the module memory. For example, if your application requires 2000 words of WriteData starting at register 0, then your MCM.CONFIG.MODDEF.READSTARTREG must be set to a value of 2000 or greater.
Page 51 of 215
1.9
Connect the straight connector end of the cable to the serial port on your computer.
Page 52 of 215
1.10
Note: The key switch on the front of the ControlLogix processor must be in the REM or PROG position.
If you are not already online with the processor, open the Communications menu, and then choose DOWNLOAD. RSLogix 5000 will establish communication with the processor. You do not have to download through the processor's serial port, as shown here. You may download through any available network connection. When communication is established, RSLogix 5000 will open a confirmation dialog box. Click the DOWNLOAD button to transfer the sample program to the processor.
3 4
RSLogix 5000 will compile the program and transfer it to the processor. This process may take a few minutes. When the download is complete, RSLogix 5000 will open another confirmation dialog box. If the key switch is in the REM position, click OK to switch the processor from PROGRAM mode to RUN mode.
Note: If you receive an error message during these steps, refer to your RSLogix documentation to interpret and correct the error.
Page 53 of 215
Note: If the list of configured drivers is blank, you must first choose and configure a driver from the Available Driver Types list. The recommended driver type to choose for serial communication with the processor is RS-232 DF1 Devices.
Page 54 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module 3 Click to select the driver, and then click CONFIGURE. This action opens the Configure RS-232 DF1 Devices dialog box.
4 5
Click the AUTO-CONFIGURE button. RSLinx will attempt to configure your serial port to work with the selected driver. When you see the message Auto Configuration Successful, click the OK button to dismiss the dialog box.
Note: If the auto-configuration procedure fails, verify that the cables are connected correctly between the processor and the serial port on your computer, and then try again. If you are still unable to auto-configure the port, refer to your RSLinx documentation for further troubleshooting steps.
Page 55 of 215
Page 56 of 215
Page 57 of 215
2.1
Overview
This section describes how to configure the module as a MODBUS MASTER device. The Master is the only device on a Modbus network that can initiate communications. A Master device issues a request message, and then waits for the Slave to respond. When the Slave responds, or when a timeout has occurred, the Modbus Master will then execute the next command in the list. The following RSLogix controller tags contain the Modbus Master configuration. You must configure all three sets of controller tags. 1 The MODDEF controller tags set up the backplane communication between the MVI56E-MCM module and the ControlLogix processor. These settings include register addresses for ReadData and WriteData. You can configure up to 5000 data registers in the module to exchange data with the ControlLogix processor. 2 The PORT1 and PORT 2 controller tags configure the Modbus application serial port. This set of controller tags configures serial communication parameters such as baud rate, data bits, and stop bits. They also contain settings to configure the port as a Modbus Master or a Modbus Slave. 3 The PORT1MASTERCOMMAND and PORT2MASTERCOMMAND controller tags define a polling table (command list) for the Modbus Master. This set of tags contains the addresses for devices on the network, the types of data (Modbus Function Codes) to read and write with those devices, and the location to store the data within the modules 5000 data registers.
Page 58 of 215
2.2
ModDef Settings
The MCM.CONFIG.MODDEF tag defines the 5000 data registers to use for read and write data within the MVI56E-MCM module. You will use these data read and write locations in the IntAddress tag within each Master Command (page 62). The following illustration shows the values from the sample program.
The WRITESTARTREG tag determines the starting register location for the WRITEDATA[0 to 599] array. The WRITEREGCNT tag determines how many of the 5000 registers to use to send data to the module. The sample ladder file uses 600 registers for write data, labeled MCM.WRITEDATA[0 to 599].
Label WRITESTARTREG WRITEREGCNT Description Specifies where in the 5000 register module memory to place data sent from the WriteData tags in the ControlLogix processor. Specifies how many registers of data the MVI56E-MCM module will request from the ControlLogix processor. Because the module pages data in blocks of 200 words, this number must be evenly divisible by 200. Specifies which registers in the modules read data area to send to the ReadData tags in the ControlLogix processor. Sets how many registers of data the MVI56E-MCM module will send to the ControlLogix processor. This value should also be a multiple of 200. Sets the consecutive number of backplane failures that will cause the module to stop communications on the Modbus network. Typically used when the module is configured as a Slave. Also used mainly when the module is configured as a Slave. This parameter places the STATUS data into the database of the module.
ERRSTATPTR
Page 59 of 215
The sample configuration values configure the module database to store WRITEDATA[0 to 599] in registers 0 to 599, and READDATA[0 TO 599] in registers 1000 to 1599, as shown in the following illustration.
Page 60 of 215
Note: Any changes made within the MCM.CONFIG array must be downloaded to the MVI56EMCM module by setting the WARMBOOT or COLDBOOT bit, or cycling power to the module. Any parameters not mentioned in this section are not used when the module is configured as a Modbus Master. Verify that you are in MONITOR TAGS mode. Then use the scroll bar at the bottom of the window to view a description of each parameter. The following table uses that information.
Parameter Enabled Type Description 1 = ENABLE PORT, 0 = disable port 0=Master, 1=Slave, 2=Slave with Umformatted Pass-through, 3=Slave, formatted Pass-through with data swapping, 4= Slave, formatted pass-through wuith no data swapping. 0 = MODBUS RTU MODE, 1 = Modbus ASCII mode Sets the baud rate for the port. Valid values for this field are 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200, 384 or 3840 (for 38,400 baud), 576 or 5760 (for 57,600 baud) and 115,1152, or 11520 (for 115,200 baud) 0 = None, 1 = Odd, 2 = Even Modbus RTU mode = 8 Modbus ASCII mode = 8 or 7 Valid values are 1 or 2. 0 to 65535 milliseconds to delay after RTS line is asserted on the port before data message transmission begins. This delay can be used to allow for radio keying or modem dialing before data transmission begins. 0 to 65535 milliseconds to delay after data message is complete before RTS line is dropped on the port. No or Yes This parameter is used to enable or disable hardware handshaking. The default setting is No hardware handshaking, CTS Line not used. Set to No if the connected devices do not need hardware handshaking. Set to Yes if the device(s) connected to the port require hardware handshaking (most modern devices do not) If you set this parameter to Yes, be sure to pay attention to the pinout and wiring requirements to be sure the hardware handshaking signal lines are properly connected; otherwise communication will fail.
Protocol Baudrate
Page 61 of 215
Description 0-100 commands This parameter sets the number of commands to execute from the command list. Setting to zero (0) will disable all command polling. Setting to a value less than the number of configured commands will limit polling to the number of commands specified by this parameter. Setting to a value greater than the number of configured commands will cause invalid command errors to be reported for the unconfigured commands. Minimum Command Delay 0-65535 milliseconds The amount of delay in milliseconds to be inserted after receiving a Slave response or encountering a response timeout before retrying the command or sending the next command on the list. Use this parameter to slow down overall polling speed and spread out commands on networks with Slaves that require additional gaps between messages. CmdErrPtr Internal DB location to place command error list Each command will reserve one word for the command error code for that command. See Verify Communication. CMDERRPTR value should be within the range of the READDATA array. See Backplane Configuration. Error Delay Counter This parameter specifies the number of poll attempts to be skipped before trying to re-establish communications with a slave that has failed to respond to a command within the time limit set by the Response Timeout parameter. After the slave fails to respond, the master will skip sending commands that should have been sent to the slave until the number of skipped commands matches the value entered in this parameter. This creates a sort of slow poll mode for slaves that are experiencing communication problems. RespTO 0 to 65535 milliseconds response timeout for command before it will either reissue the command, if RETRYCOUNT > 0. If the RetryCount =0 or if the designated number of retries have been accomplished, then the Master will move on to the next command in the list. RetryCount Number of times to retry a failed command request before moving to the next command on the list.
Page 62 of 215
Verify you are in MONITOR TAGS mode. Then use the scroll bar at the bottom of the window to view a description of each parameter.
Label Enable
Description 0 = Disabled Command will not be executed, but can be enabled using command control option in ladder logic. 1 = Enabled Command is enabled and will be sent out to the target device. 2 = Conditional Write Only for Func 5, 15, 6, or 16 data will be sent to the target device only when the data to be written has changed. Determines where in the modules 5000-register database the data will be stored to or written from. For a Read command, this will determine, after information has been read from a Slave, where it will be placed in the module database. For read commands, you should configure this for a location that is configured for READDATA. The internal database location for the READDATA and WRITEDATA tags is determined by the configuration in the MCM.ModDef tag location. For write data, the INTADDRESS determines where to obtain the information to write to the Slave device. This must be a location that is configured as WRITEDATA. Note: When using a bit level command, you must define this field at the bit level. For example, when using a function code 1, 2 for a Read command, you must have a value of 16000 to place the data in MCM.ReadData[0] (register 1000 * 16 bits per register = 16000). The Poll Interval (PollInt) is the number of seconds that a Master device will wait before issuing this command. Sets how many continuous words (Function Codes 3, 4, and 16) or bits (Function Codes 1, 2, and 15) to request from the Slave device. Valid values are 1 to 125 words for function codes 3, 4, and 16, while you can specify a range of 1 to 2000 for function codes 1, 2, and 15. Note: These values are the maximum allowed in the Modbus protocol. Some devices may support fewer words or bits than the maximum allowed.
IntAddress
PollInt Count
Page 63 of 215
Typically used when reading floating-point data, swaps the data read from the Slave device before it is placed into the module memory. For example, you receive 4 bytes of data from the Slave (ABCD). 0 = No swapping (ABCD) 1 = Word pairs switched (CDAB) 2 = Bytes and words switched (DCBA) 3 = Bytes swapped (BADC) Node address of the device on the network to read data from, or write data to. Valid addresses are 1 to 247. Address 0 is reserved for broadcast write commands (will broadcast a Write command to all devices on the network). Determines the Modbus function code that to issue in the command to the Slave device. Valid values for this field are as follows: 1 = Read Coil Status This will read Modbus addresses 0001 to 9999. These bit values indicate coil status. Use Function Code 5 or 15 to write to these registers 2 = Read Input Coils This will read Modbus addresses 10001 to 29999. Like Function Code 1, these are also bit values, but Function Code 2 values are Read Only data values. Use Function Code 5 or 15 to write to these registers 3 = Read Holding Registers This will read Modbus addresses 40001 to 47999. This is a 16-bit word value. Use Function Codes of 6 and 16 to write to these registers. 4 = Read Input Registers This will read Modbus addresses 30001 to 39999. These are also 16-bit word values, but are Read Only data. The Modbus Master cannot write to these registers. 5 = Force (Write) Single Coil Status This will write to Modbus addresses 0001 to 9999. This command will write to only one coil. Use Function Code 15 to write to multiple coils. 6 = Preset (Write) Single Register This will write to Modbus addresses 40001 to 47999. This command writes a single register value out to a Slave device. Use Function Code 16 to write to multiple registers. 15 = Force (Write) Multiple Coil This will write multiple coil values to the Slave addresses 0001 to 9999. 16 = Preset (Write) Multiple Register This will write multiple register values to the Slave device at addresses 40001 to 49999.
Node
Func
Page 64 of 215
Specifies the Modbus Slave address for the registers associated with that command. This is the offset address for the Modbus Slave device. With Modbus, to read an address of 40001, what will actually be transmitted out port is Function Code 03 (one byte) with an address of 00 00 (two bytes). This means that to read an address of 40501, use Func 3 with a DevAddress of 500. This applies to Modbus addresses 10001 to 47999. Below is a definition that will help with your DevAddress configuration: Function Codes 1, 5, or 15 DevAddress = Modbus address in device - 0001 Example: Modbus address 0001 = DevAddress 0 Modbus address 1378 = DevAddress 1377 Function Code 2 DevAddress = Modbus address in device - 10001 Example: Modbus address 10001 = DevAddress 0 Modbus address 10345 = DevAddress 344 Function Codes 3, 6, or 16 DevAddress = Modbus address in device - 40001 Example: Modbus address 40001 = DevAddress 0 Modbus address 40591 = DevAddress 590 Function Code 4 DevAddress = Modbus address in device - 30001 Example: Modbus address 30001 = DevAddress 0 Modbus address 34290 = DevAddress 4289
Page 65 of 215
If your device manufacturer gives you addressing like this, "Input Registers" then you will use Function Code 4, and then place the address shown in the DevAddress field. Also, most manufacturers that show this type of addressing will list the address in hex, as is the case with the device shown above. So for this example device, use Func = 4 (Input Registers) with a DevAddress of 512 decimal (200h) to read the "Switch Input Status" value.
Why does my Slave show addressing such as 400,001 or 301,345?
For the 6 digit addressing, use the same function codes and configuration as configured above, just the starting address has changed. Below is a definition that will help with your DevAddress configuration: Function Codes 1, 5, or 15 DevAddress = Modbus address in device - 0001 Example: Modbus address 0001 = DevAddress 0 Modbus address 1378 = DevAddress 1377 Function Code 2 DevAddress = Modbus address in device - 100001 Example: Modbus address 100001 = DevAddress 0 Modbus address 100345 = DevAddress 344 Function Codes 3, 6, or 16 DevAddress = Modbus address in device - 400001 Example: Modbus address 400001 = DevAddress 0 Modbus address 400591 = DevAddress 590 Function Code 4 DevAddress = Modbus address in device - 300001 Example: Modbus address 300001 = DevAddress 0 Modbus address 304290 = DevAddress 4289 For example, our device listed above could show their addressing as follows.
To read the same parameter "Switch_Input_Status", you would still issue a Function Code 4, and use a DevAddress of 512 decimal. Page 66 of 215 ProSoft Technology, Inc. February 15, 2012
2.3
Master Command Examples 2.3.1 Read Holding Registers 4x (Modbus Function Code 3)
The 4x holding registers are used for Analog Values such as Pressure, Temperature, Current, and so on. These are 16-bit register values, but they can also store Floating-Point data (page 75). You can also write to these Modbus addresses using Modbus Function Codes 6 or 16. Below is a sample command to read Modbus addresses 40001 to 40010 of node 1 on the Modbus network.
Description The module will send the command every time it goes through the command list. Places the data read from the Slave device into the module at address 1000. IntAddress 1000 of the module memory will be copied into the tag MCM.DATA.READDATA[0]. Reads 10 consecutive registers from the Slave device. Issues the Modbus command to node 1 on the network. Issues Modbus Function Code 3 to Read Holding Registers. Function Code 3, DevAddress of 0 will read address 40001 Along with a count of 10, this command reads 40001 to 40010.
Page 67 of 215
Description The module will send the command every time it goes through the command list. Places the data read from the Slave device into the module at address 1010. IntAddress 1010 of the module memory will be copied into the tag MCM.DATA.READDATA[10]. Reads 10 consecutive registers from the Slave device. Issues the Modbus command to node 1 on the network. Issues Modbus Function Code 4 to Read Input Registers. Function Code 4 DevAddress of 20 will read address 30021 Along with a count of 10, this command reads 30021 to 30030.
Page 68 of 215
Description The module will send the command every time it goes through the command list. 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 MVI56E-MCM module (16320 / 16 = register 1020). Reads 160 consecutive bits from the Slave device. Issues the Modbus command to node 1 on the network. Issues Modbus Function Code 1 to Read Coils. Function Code 1, DevAddress of 320 will read address 0321 Along with a count of 160, this command reads 0321 to 0480.
Page 69 of 215
Description The module will send the command every time it goes through the command list. Places the data read from the Slave device into the module at address 16480. IntAddress 16480 of the module memory will be copied into the tag MCM.DATA.READDATA[30] (bit16480 / 16 = register 1030). Reads 16 consecutive registers from the Slave device. Issues the Modbus command to node 1 on the network. Issues Modbus Function Code 2 to Read Input Coils. Function Code 2, DevAddress of 80 will read address 10081 Along with a count of 16, this command reads 10081 to 10096.
Page 70 of 215
Description The module will send the command only when the data within the IntAddress field of the module has changed. Will write the data to the Slave device when the value at WriteData[10].0 has changed. Because this is a bit level command, the IntAddress field must be defined down to the bit level. Will write a single bit to the device (Function Code 5 will 1 support a count of 1). Issues the Modbus command to node 1 on the network. Issues Modbus Function Code 5 to write a single coil. Function Code 5, DevAddress of 512 will read address 0513
Page 71 of 215
Label Enable = 2
Description The module will send the command to the Slave device only when the data associated within the IntAddress of the MVI56E-MCM module memory has changed. 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. Writes 16 consecutive bits to the Slave device. Issues the Modbus command to node 1 on the network. Issues Modbus Function Code 15 to write multiple coils. Function Code 15, DevAddress of 0 will read address 0001 Along with a count of 16, this command writes to 0001 to 0016.
IntAddress = 320
Page 72 of 215
Description The module will send the command every time it goes through the command list. Writes the data from address 5 of the module memory to the Slave device. Based on the MCM.CONFIG.MODDEF configuration, this will take the data from MCM.DATA.WRITEDATA[5] and write that information out to the Slave device. Writes 1 register (16-bit) to the Slave device. Issues the Modbus command to node 1 on the network. Issues Modbus Function Code 6 to write a single register. Function Code 6, DevAddress of 1040 will write to address 41041 of the Modbus Slave device.
Page 73 of 215
Description The module will send the command only when the data associated with the IntAddress of the module has changed. Writes the data from Internal Address 30 of the module memory to the Slave device. Based on the MCM.CONFIG.MODDEF configuration, this will write the data from MCM.DATA.WRITEDATA[30] TO [39] to the Slave device. Writes 10 consecutive registers to the Slave device. Issues the Modbus command to node 1 on the network. Issues Modbus Function Code 16 to write Holding Registers. Function Code 16, DevAddress of 1050 will write address 41051. Along with a count of 10, this command writes 41051 to 41060 of the Slave device.
Page 74 of 215
2.4
PollInt Count
0 2
Swap
Sends the command to Node #1. Issues a Modbus Function Code 3 to "Read Holding registers." Along with the Function Code 3, DevAddress 256 will read Modbus address 40257 of the Slave device.
Page 75 of 215
Along with the Function Code 3, DevAddress 256 will read Modbus address 40257 of the Slave device. The above command will read 40257 and 40258 of the Modbus Slave #1 and place that data in MCM.DATA.READDATA[0] and [1]. Within the controller tags section of the ControlLogix processor, it is necessary to configure a tag with the data type of "REAL" as shown in the following illustration.
[+] Energy_Consumption REAL[1] Float
Copy data from the MCM.DATA.READDATA[0] and [1] into the tag ENERGY_CONSUMPTION that has a data type of REAL. Use a COP statement within the ladder logic. Here is an example.
Because the tag MCM.DATA.READDATA[0] should only be used within the above command, an unconditional COP statement can be used. Notice the length of the COP statement is a value of 1. Within a Rockwell Automation processor, a COP statement will copy the required amount of "Source" values to fill the "Dest" tag for the Length specified. Therefore, the above statement will copy ReadData[0] and [1] to fill the 32 bits required for the tag "Energy_Consumption". Note: Do not use a MOV statement. A MOV will convert the data from the Source register to the destination register data type. This would create a data casting statement and will result in the loss or corruption of the original data.
Page 76 of 215
MVI56E-MCM ControlLogix Platform Modbus Communication Module Configure the command to read these 7 floats as follows.
Configure an array of 7 floats within the ControlLogix processor as shown in the following illustration.
The following COP statement will copy the data from MCM.DATA.READDATA[0] TO [13] into the array MCM_FLOAT_DATA[0] TO [6].
The "Length" parameter is set to the number of Floating-Point values that must be copied from the MCM.DATA.READDATA array.
You must use a COP statement to copy the data from floating-point data tags within the ControlLogix processor, into the MCM.DATA.WRITEDATA array used by the MVI56E-MCM module. Below is an example.
Page 77 of 215
The length of this COP statement must now be 14. This will COP as many of the MCM_FLOAT_DATA values required to occupy the MCM.DATA.WRITEDATA array for a length of 14. This will take 7 registers, MCM_FLOAT_DATA[0] TO [6], and place that data into MCM.DATA.WRITEDATA[0] TO [13]. You must configure the command to write all 7 floats (14 Modbus addresses) as follows.
The above command will take the data from MCM.DATA.WRITEDATA[0] TO [13] and write this information to the Slave device node #1 addresses 40261 to 40274.
2.4.4 Read Floats with Single Modbus Register Address (Enron/Daniel Float)
Some Modbus Slave devices use a single Modbus address to store 32 bits of data. This type of data is typically referred to as Enron or Daniel Floating-Point. A device that uses this addressing method may have the following Modbus Memory Map.
Address 47001 47002 47003 47004 47005 47006 47007 Data Type 32 bit REAL 32 bit REAL 32 bit REAL 32 bit REAL 32 bit REAL 32 bit REAL 32 bit REAL Parameter Demand Reactive Power Apparent Power Power Factor Voltage: Line to Line Voltage: Line to Neutral Current
This type of device uses one Modbus address per floating-point register. To read these values from the Slave device, configure the following command within the module.
Page 78 of 215
Notice that the count is now set to a value of 7. Because the Slave device utilizes only 7 Modbus addresses, a count of 7 will cause the Slave to respond with 14 registers (28 bytes) of information. Important: This command will still occupy 14 register within the MCM.DATA.READDATA array. You must not use addresses 1000 to 1013 in the IntAddress field for any other Modbus Master commands. The COP statement for this type of data is the same as shown in Read Multiple Floating-Point Registers (page 76).
The Float Flag causes the module to use the FloatStart parameter to determine which DevAddress requires a write command to issue double the number of bytes. With the above configuration, any DevAddress > 7000 is known to be floatingpoint data. Therefore, a count of 1 will send 4 bytes of data, instead of the normal 2 bytes of data to a non Enron/Daniel floating-point register. 1 First, copy the floating-point data from the ControlLogix processor into the MCM.DATA.WRITEDATA array used by the MVI56E-MCM module. Below is an example.
Page 79 of 215
The length of this COP statement must now be 14. This will COP as many of the MCM_FLOAT_DATA values required to occupy the MCM.DATA.WRITEDATA array for a length of 14. This will take 7 registers, MCM_FLOAT_DATA[0] TO [6], and place that data into MCM.DATA.WRITEDATA[0] TO [13]. The following illustration shows the command required to write these 7 FloatingPoint values.
Based on the IntAddress and the configuration within the MCM.CONFIG.MODDEF section for WriteStartReg and WriteRegCount, the data from the tag MCM.DATA.WRITEDATA[0] TO [6] will be written to Modbus addresses 47001 to 47007 of the Slave device node #1. Note: A swap code may be required to put the data in the proper format for the Slave device.
Page 80 of 215
2.5
Page 81 of 215
The following configuration will place 6 commands into the command queue. MCM.CONFIG.PORT1MASTERCMD[0] to MCM.CONFIG.PORT1MASTERCMD[5] will be enabled with this configuration. Error codes for each command are placed in the Error Status table.
Tag TriggerCmdCntrl NumberOfCommands PortNumber CommandIndex[0] to [99] CmdsAddedToQueue Value 1 6 1 0 to 99 Description 1 will execute the Command Control Number of commands per block MVI56E-MCM Port number (Master) Stores the command index for Command Control block Number of commands added to queue. This is the confirmation that the Command Control block has completed successfully Temporary variable to calculate control block ID number Aux. control command - prevents a second request before acknowledgement is received
CmdControlBlockID CmdCntrolPending
Note: For RSLogix version 15 and lower, the ladder logic necessary for the successful execution of this block is contained in the _WriteControl ladder file, rung 4, and in the _ReadControl ladder file, rung 2.
Page 82 of 215
Parameter EventCmdTrigger EventCmdPending PortNumber SlaveAddress InternalDBAddress PointCount SwapCode ModbusFunctionCode DeviceDBAddress
EventCmdStatusReturned EventBlockID
Description 1 = trigger the Event Command Used = EventCommand is executed once Module Port # to send command out to Modbus Slave ID command to be issued to 1100 will place the data read into MCM.DATA.ReadData[100] Consecutive register/bits to read or write with the command Swap code used with command Function Code 3 is read 4xxxx holding registers Address in the Slave device to read. With Function Code 3, DeviceDBAddress of 276, the module will read starting at address 40277 in the Slave device Return value of 0 = Fail, 1 = Success Block ID number for the module to recognize the Event Command, Slave address, and Port number to send the command out
Note: For RSLogix version 15 and lower, the ladder logic used for the Event Command blocks is contained in _WriteControl rung 5 and _ReadControl rung 4 within the sample ladder file. Note: Event Command blocks can only send 1 command to the command queue per block. Note: Event Commands (like Command Control) take priority over commands in the normal command list. ProSoft Technology, Inc. February 15, 2012 Page 83 of 215
Page 84 of 215
Page 85 of 215
3.1
Overview
When configuring the module as a Slave, you will be providing whoever is programming the Master side of the communications with a Modbus Memory Map. Note: If you are using the Sample Ladder Logic, the transfer of data is already done. Information that is to be read by the Modbus Master device will be placed in the MCM.DATA.WRITEDATA array as this will be pushed out to the module so that values from the ControlLogix processor can be read by the Modbus Master. Information that must be written to the ControlLogix processor from the Modbus Master device will be placed into the MCM.DATA.READDATA array. To configure module as a Modbus Slave you must determine how much data you must transfer to and from the module, to the Modbus Master. The sample ladder file is configured to transfer 600 16-bit registers in each direction. If more than that is required, please see Adjust the Input and Output Array Sizes (page 50). Find out if the Master can read from one Modbus address and write to another Modbus address, or, if the Master must use the same address to read and write data points. If a Modbus command must bypass the read and write areas of the slave's memory area and send Modbus commands directly to another device on the Modbus network (for example, to a PLC), you must use Pass-Through mode (page 95). This allows the MCM.DATA.WRITEDATA array to be used for all data transfer to the Master. Because the data transfer of the MVI56E-MCM module cannot be bidirectional, when the Master issues a Modbus Write command in Pass-Through mode, the MVI56E-MCM module builds a special block of information. This block is then parsed by the ladder logic, and the value written from the Modbus Master is then updated in the MCM.DATA.WRITEDATA array. Note: You should only use Pass-Through mode when there is no other option, as there is a drawback to this mode that is not present in the standard mode. Because the module must wait for the ladder logic to confirm receiving the new data from the Master, if the Master issues consecutive write commands, the module cannot process the second write command until it has finished with the first command. This will cause the module to respond with an error code of 6 (module busy) on the Modbus network.
Page 86 of 215
3.2
ModDef Settings
To configure Modbus Slave mode, use the MCM.CONFIG.MODDEF settings. This section specifies which of the MVI56E-MCM modules 5000 registers of memory to send from the ControlLogix processor to the MVI56E-MCM module (WriteData) and which registers to send from the MVI56E-MCM module to the ControlLogix processor (ReadData).
The WRITESTARTREG determines the starting register location for WRITEDATA [0 TO 599] and the WRITEREGCNT determines how many of the 5000 registers to use for information to be written out to the module. The sample ladder file will configure 600 registers for Write Data, labeled MCM.WRITEDATA[0 TO 599].
Value WriteStartReg Description Determines where in the 5000 register module memory to place the data obtained from the ControlLogix processor from the WriteData tags. Sets how many registers of data the MVI56E-MCM module will request from the ControlLogix processor. Because the module pages data in blocks of 200 words, this number must be evenly divisible by 200. Determines where in the 5000 register module memory to begin obtaining data to present to the ControlLogix processor in the ReadData tags. Sets how many registers of data the MVI56E-MCM module will send to the ControlLogix processor. This value should also be a multiple of 200. Sets the consecutive number of backplane failures that will cause the module to stop communications on the Modbus network. This parameter places the STATUS data into the database of the module. This information can be read be the Modbus Master to know the status of the module.
WriteRegCnt
ReadStartReg
ReadRegCnt
BPFail ErrStatPtr
Page 87 of 215
With the sample configuration, the following is the layout of the tags and addressing.
The sample configuration values configure the module database for WRITEDATA[0 TO 599] to be stored in the module memory at register 0 to 599, and READDATA[0 TO 599] to be stored in the module memory at registers 1000 to 1599 as shown above.
Page 88 of 215
The above addressing chart will work with many Modbus applications. Values listed in the ReadData array for 31001 to 31600 are shown with an * beside them.
Page 89 of 215
Although these are valid addresses, they will not work in the application. The Master must issue a Write command to the addresses that correspond to the READDATA array. For Modbus addresses 3xxxx these are considered Input registers, and a Modbus Master does not have a function code for this type of data.
Parameter BitInOffset
Value 0
10 1000 1010
Description Defines the starting address within the module for 1xxxx Modbus addressing. A value of 0 sets 10001 to 10016 as address 0 in the MVI56E-MCM module. Defines the starting address within the module memory for 3xxxx registers. Defines the starting address within the module for 0xxx coils. Defines the starting address within the module for 4xxxx addressing.
Page 90 of 215
Based on the configuration described above for the ModDef section of the module and the values specified for the offset parameters, below is the Modbus addressing map for the module.
MVI Address 0 1 9 10 11 100 200 500 598 599 600 to 999 1000 1001 1009 1010 1011 1050 1100 1200 1500 1598 1599 0xxx 1xxxx 10001 to 10016 10017 to 10032 10145 to 10160 10161 to 10176 10177 to 10192 11601 to 11616 13201 to 13216 18001 to 18016 19569 to 19584 19585 to 19600 N/A 3xxxx 4xxxx Tag Address WriteData[0] WriteData[1] WriteData[9] WriteData[10] WriteData[11] WriteData[100] WriteData[200] WriteData[500] WriteData[598] WriteData[599] Reserved ReadData[0] ReadData[1] ReadData[9] ReadData[10] ReadData[11] ReadData[50] ReadData[100] ReadData[200] ReadData[500] ReadData[598] ReadData[599]
N/A 0001 to 0016 0017 to 0032 0145 to 0160 0161 to 0176 0177 to 0192 0801 to 0816 1601 to 1616 3201 to 3216 8001 to 8016 9569 to 9584 9585 to 9600
N/A
With the offset parameters listed above, the Modbus Master could read from coils 10001 to 10176 using the tags MCM.DATA.WRITEDATA[0] TO [9]. The Master could also read from address 30001 to 30490, and the data contained in those Modbus addresses would come from the tags MCM.DATA.WRITEDATA[10] TO [499] within the ControlLogix program. The Master could then write to coils addressing 0001 to 0160 and this data would reside within the ControlLogix program in tags MCM.DATA.READDATA[0] TO [9]. The Master could then write to registers using Modbus addresses 40001 to 40590, and this information would reside in addresses MCM.DATA.READDATA[10] TO [599]. Note: The offset parameter only set the starting location for the data. As shown above, if the Master issues a Write command to address 40001, the data will go into the ControlLogix processor at address MCM.DATA.READDATA[10]. Likewise, a Write To bit address 0161 will also change to address MCM.DATA.READDATA[10].0 within the program. Be careful not to overlap your data. You may want leave additional registers/bits unused to allow for future expansion in the program.
Page 91 of 215
3.3
Slave Configuration
Any parameters not mentioned in this section are not used when the module is configured as a Modbus Master.
Value Enabled Type Description 1= enable port, 0 = disable port 1= Modbus Slave Port The module also supports a variety of Pass-Through modes. See Pass-Through Control Blocks (page 142) for more information. As a Slave, emulates Enron/Daniel style floats. See Floating Point Data Handling (page 93) for more information. Register offset in message for floating data point. See Floating Point Data Handling (page 93) for more information. 0 = Modbus RTU mode, 1 = Modbus ASCII mode Sets the baud rate for the port. Valid values for this field are 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200, 384 or 3840 (for 38,400 baud), 576 or 5760 (for 57,600 baud) and 115,1152, or 11520 (for 115,200 baud) 0 = None, 1 = Odd, 2 = Even 8 = Modbus RTU mode, 8 or 7 = Modbus ASCII mode Valid values are 1 or 2 Valid values are 1 to 247
Page 92 of 215
3.4
Then configure a COP statement within the main routine to copy this tag to the module's MCM.DATA.WRITEDATA array.
The length of the copy statement is determined by the Dest file size. To copy 10 floats from the MCM_Write_Floats array to the MCM.DATA.WRITEDATA array, the length of the COP statement must be set to a value of 20.
To copy data from the MVI56E-MCM module to a floating-point tag within the ControlLogix processor
Then configure the COP statement to move data from the MCM.DATA.READDATA array, and over to the new tag MCM_READ_FLOATS tag as shown here.
Once again, the COP statement will take as many of the Source elements required to fill the Dest tag for the length specified. Therefore, the COP statement will take MCM.DATA.READDATA[0] TO [19] to fill the MCM_READ_FLOATS[0] TO [9].
Page 93 of 215
FloatOffset
With the above configuration, this would be the addressing for the module.
Module Address 100 102 104 110 120 200 300 500 Modbus Address 47001 47002 47003 47006 47011 47051 47101 47201 Tag Address MCM.DATA.WriteData[100] MCM.DATA.WriteData[102] MCM.DATA.WriteData[104] MCM.DATA.WriteData[110] MCM.DATA.WriteData[120] MCM.DATA.WriteData[200] MCM.DATA.WriteData[300] MCM.DATA.WriteData[500]
Page 94 of 215
3.5
Note: For RSLogix version 15 and lower, the ladder logic necessary for the successful execution of this block is contained in the subroutine _PassThru. Pass Through should only be used when required. If a Master issues a Write command to the module, the module must build a special block of information. Then, it waits for confirmation from the ladder logic that the block has been processed. Note: If the module is waiting for the block to be processed by the ladder, and the Master device issues another Write command, the module will return an Error Code of 6 (module busy). This error causes the ladder not to process data written by the Master.
Page 95 of 215
Page 96 of 215
Verify Communication
In This Chapter
Verifying Master Communications ......................................................... 98 Verify Slave Communications.............................................................. 105
There are several ways to verify that the MVI56E-MCM module is communicating with the processor and with the Modbus network. View the LED Status Indicators View the Module Status in the RSLogix 5000 Controller Tags (page 167). View Diagnostics in ProSoft Configuration Builder (page 109)
Page 97 of 215
4.1
Port 1 Command List This field contains the number of requests made from this Requests port to Slave devices on the network. Port 1 Command List This field contains the number of Slave response messages Response received on the port. Port 1 Command List This field contains the number of command errors processed Errors on the port. These errors could be due to a bad response or command. Port 1 Requests Port 1 Responses Port 1 Errors Sent Port 1 Errors Received This field contains the total number of messages sent from the port. This field contains the total number of messages received on the port. This field contains the total number of message errors sent from the port. This field contains the total number of message errors received on the port.
Port 2 Command List This field contains the number of requests made from this Requests port to Slave devices on the network.
Page 98 of 215
Port 2 Command List This field contains the number of Slave response messages Response received on the port. Port 2 Command List This field contains the number of command errors processed Errors on the port. These errors could be due to a bad response or command. Port 2 Requests Port 2 Responses Port 2 Errors Sent Port 2 Errors Received Read Block Count Write Block Count Parse Block Count Command Event Block Count Command Block Count Error Block Count Port 1 Current Error This field contains the total number of messages sent out the port. This field contains the total number of messages received on the port. This field contains the total number of message errors sent out the port. This field contains the total number of message errors received on the port. This field contains the total number of read blocks transferred from the module to the processor. This field contains the total number of write blocks transferred from the module to the processor. This field contains the total number of blocks successfully parsed that were received from the processor. This field contains the total number of command event blocks received from the processor. This field contains the total number of command blocks received from the processor. This field contains the total number of block errors recognized by the module. For a Master Port, this field contains the command index number of the most recently executed command that failed. To find what kind of error occurred, see the Command Error List entry for this command index number. For a Master Port, this field contains the command index number of the previous most recently executed command that failed. To find what kind of error occurred, see the Command Error List entry for this command index number. For a Master Port, this field contains the command index number of the most recently executed command that failed. To find what kind of error occurred, see the Command Error List entry for this command index number. For a Master Port, this field contains the command index number of the previous most recently executed command that failed. To find what kind of error occurred, see the Command Error List entry for this command index number.
221 222 223 224 225 226 227 228 229 230 231
232
233
234
Page 99 of 215
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] TO [599].
Each command configured in the MCM.CONFIG.PORTX.MASTERCMD will occupy one register within the READDATA array. Based on the sample configuration values, the following table is true.
Error Code for Command MCM.CONFIG.Port1MasterCmd[0] MCM.CONFIG.Port1MasterCmd[1] MCM.CONFIG.Port1MasterCmd[2] MCM.CONFIG.Port1MasterCmd[3] MCM.CONFIG.Port1MasterCmd[4] MCM.CONFIG.Port1MasterCmd[98] MCM.CONFIG.Port1MasterCmd[99] ReadData Location MCM.DATA.ReadData[500] MCM.DATA.ReadData[501] MCM.DATA.ReadData[502] MCM.DATA.ReadData[503] MCM.DATA.ReadData[504] MCM.DATA.ReadData[598] MCM.DATA.ReadData[599]
To know where to look for the error data, you need to know what the individual error codes are. The following tables describe the possible error codes for the module: Standard Modbus Protocol Errors
Code 1 2 3 4 5 6 Description Illegal Function Illegal Data Address Illegal Data Value Failure in Associated Device Acknowledge Busy, Rejected Message
The "Standard Modbus Protocol Errors" are error codes returned by the device itself. This means that the Slave device understood the command, but replied with an Exception Response, which indicates that the command could not be executed. These responses typically do not indicate a problem with port settings or wiring. The most common values are Error Code 2 and Error Code 3. Error Code 2 means that the module is trying to read an address in the device that the Slave does not recognize as a valid address. This is typically caused by the Slave device skipping some registers. If you have a Slave device that has address 40001 to 40005, and 40007 to 40010, you cannot issue a read command for addresses 40001 to 40010 (function code 3, DevAddress 0, Count 10) because address 40006 is not a valid address for this Slave. Instead, try reading just one register, and see if the error code goes away. You can also try adjusting your DevAddress -1, as some devices have a 1 offset. An Error Code of 3 is common on Modbus Write Commands (Function Codes 5,6,15, or 16). Typically, this is because you are trying to write to a parameter that is configured as read only in the Slave device, or the range of the data you are writing does not match the valid range for that device. Refer to the documentation for your Slave device, or contact ProSoft Technical Support for more help with these types of error codes.
CTS modem control line not set before transmit Timeout while transmitting message Timeout waiting for response after request Incorrect Slave address in response Incorrect function code in response Invalid CRC/LRC value in response
"Module Communication Errors" are generated by the MVI56E-MCM module, and indicate communication errors with the Slave device. Error Code -11 indicates that the module is transmitting a message on the communications wire. However, it is not receiving a response from the addressed Slave. This error is typically caused by one or more of the following conditions. Parameter mismatch, for example the module is set for 9600 baud, Slave is set for 19,200, parity is set to none, Slave is expecting even, and so on. Wiring problem, for example the port jumper on the module is set incorrectly, or + and - lines on RS485 are switched) The Slave device is not set to the correct address, for example the Master is sending a command to Slave 1 and the Slave device is configured as device 10. With a -11 error code, check all of the above parameters, wiring, and settings on the Slave device. Also make sure that you cycle power to the module, or toggle the MCM.CONTROL.WARMBOOT or COLDBOOT bit to transfer the values in the MCM.CONFIG array to the module. Error codes of 253 to 255 typically indicate noise on RS485 lines. Make sure that you are using the proper RS485 cable, with termination resistors installed properly on the line. If termination resistors are installed, try removing them as they are usually only required on cable lengths of more than 1000 feet.
MVI56E-MCM ControlLogix Platform Modbus Communication Module Command List Entry Errors
Code -41 -42 -43 -44 -45 -46 Description Invalid enable code Internal address > maximum address Invalid node address (< 0 or > 255) Count parameter set to 0 Invalid function code Invalid swap code
The above error codes indicate that the module has detected an error when parsing the command. For all commands that have not been configured (all parameters set to a value of 0) you will receive an error code of -44. To remove this error code, you can change your MCM.CONFIG.PORTX.CMDCOUNT parameter to the number of commands that are actually configured, cycle power to the module, or toggle the MCM.CONTROL.WARMBOOT or COLDBOOT bit to transfer the new values to the module. Transferring the Command Error List to the Processor You can transfer the command error list to the processor from the module database. To place the table in the database, set the Command Error Pointer (MCM.PORT1.CMDERRPTR) parameter to the database location desired. In the sample ladder, the MCM.PORT1.CMDERRPTR tag is set to a value of 1100. This will cause the error value of command 0 to be placed at database address 1100. Each command error value occupies one database word. The error value for command 1 will be in location 1101 and the remaining values in consecutive database locations. To transfer this table to the processor, refer to Command Error Codes. Make sure that the Command Error table is in the database area covered by the Read Data (MCM.MODDEF.READSTARTREG and MCM.MODDEF.READREGCNT).
If your system is working correctly, you will see CMDREQ, CMDRESP, REQUESTS, and RESPONSES all incrementing together. If you see that CMDERR is incrementing, determine what command is causing the error (using the error code defined in the previous section (page 100)) and correct the issue causing the error. Note: This information is not as detailed as the individual error codes, but they can help to troubleshoot your application. Also within the MCM.STATUS location is the parameters for Last Error and Previous Error, shown below.
This indicates the command index that last generated an error and does not indicate a command currently in error. In the above example, a value of 2 in PORT1LASTERR indicates that the last error was generated by MCM.PORT1MASTERCMD[2]. This does not indicate that this command is currently in error. The value in MCM.STATUS.PORT1PREVIOUSERR indicates that before MASTERCMD[2] generated an error, MCM.PORT1.MASTERCMD[1] posted an error.
4.2
The REQUESTS field shows the number of request messages sent to the module as a Slave. The RESPONSES field shows how many times the module has responded to a request message from the Modbus Master.
The module provides information on diagnostics and troubleshooting in the following forms: LED status indicators on the front of the module provide information on the modules status. Status data contained in the module can be viewed in ProSoft Configuration Builder through the Ethernet port. Status data values are transferred from the module to the processor.
5.1
Config P1/P2 <Modbus mode> <Port type> <Baud> <Parity> <Data bits> <Stop Bits> <RS Interface> <ID (Slave)> <Cmds: (Master)>
Operation Messages After the initialization step, the following message pattern will be repeated.
<Backplane Status> <IP Address> <Backplane Status> <Port Status> Code <Backplane Status> Message OK: Module is communicating with processor ERR: Module is unable to communicate with processor. For this scenario, the <Port Status> message above is replaced with "Processor faulted or is in program mode". Module IP address OK: Port is communicating without error Master/Slave Communication Errors: port is having communication errors. Refer to PCB diagnostics (page 109) for further information about the error.
GREEN RED
OK
Red or Green
ERR
5.2
Tip: You can have a ProSoft Configuration Builder Diagnostics window open for more than one module at a time.
To connect to the modules Configuration/Debug Ethernet port: 1 In ProSoft Configuration Builder, select the module, and then click the right mouse button to open a shortcut menu.
In the Diagnostics window, click the SET UP CONNECTION button to browse for the modules IP address.
In the Connection Setup dialog box, click the TEST CONNECTION button to verify that the module is accessible with the current settings.
You can also use CIPconnect to connect to the module through a 1756ENBT card. Refer to Using CIPconnect to Connect to the Module (page 27) for information on how to construct a CIP path.
Click the BROWSE DEVICE(S) button to open the ProSoft Discovery Service. Select the module, then right-click and choose SELECT FOR PCB.
2 3
Close ProSoft Discovery Service, and click the CONNECT button again. If these troubleshooting steps fail, verify that the Ethernet cable is connected properly between your computer and the module, either through a hub or switch (using the grey cable) or directly between your computer and the module (using the red cable). If you are still not able to establish a connection, contact ProSoft Technology for assistance.
MVI56E-MCM ControlLogix Platform Modbus Communication Module 2 On the shortcut menu, choose VIEW MODULES WEBPAGE.
Decimal
Float
Hexadecimal
Use the scroll bar on the right edge of the window to view each page (100 words) of data. ProSoft Technology, Inc. February 15, 2012 Page 117 of 215
The values on this menu correspond with the contents of the modules Miscellaneous Status registers (page 165).
Slave Status List Use the Slave Status List menu to view the status of each Slave connected to the Modbus Master port. Slaves attached to the Master Port can have one of the following states:
0 1 2 The Slave is inactive and not defined in the command list for the Master Port. The Slave is actively being polled or controlled by the Master Port. This does not indicate that the Slave has responded to this message. The Master Port has failed to communicate with the Slave device. Communications with the Slave is suspended for a user defined period based on the scanning of the command list. Communications with the Slave has been disabled by the ladder logic. No communication will occur with the Slave until this state is cleared by the ladder logic.
Refer to Slave Status Blocks (page 137) for more information. Port Status Use the Port Status menu to view status for Modbus Port 1 and Modbus Port 2. During normal operation, the number of requests and responses should increment, while the number of errors should not change.
Select Timing Interval Time Ticks help you visualize how much data is transmitted on the port for a specified interval. Select the interval to display, or choose No Ticks to turn off timing marks. Select the Communication Port to Analyze You can view incoming and outgoing data for one application port at a time. Choose the application port to analyze. Select the Data Format You can view incoming and outgoing data in Hexadecimal (HEX) or Alphanumeric (ASCII) format.
MVI56E-MCM ControlLogix Platform Modbus Communication Module Stopping the Data Analyzer
Important: When in analyzer mode, program execution will slow down. Only use this tool during a troubleshooting session. Before disconnecting from the Config/Debug port, please stop the data analyzer. This action will allow the module to resume its normal high speed operating mode. Data Analyzer Tips For most applications, HEX is the best format to view the data, and this does include ASCII based messages (because some characters will not display in the Diagnostics window, and by capturing the data in HEX, we can figure out what the corresponding ASCII characters are supposed to be). The Tick value is a timing mark. The module will print a _TT for every xx milliseconds of no data on the line. Usually 10milliseconds is the best value to start with. To save a capture file of your Diagnostics session 1 After you have selected the Port, Format, and Tick, we are now ready to start a capture of this data.
When you have captured the data you want to save, click again to stop capturing data.
You have now captured, and saved the file to your PC. This file can now be used in analyzing the communications traffic on the line, and assist in determining communication errors. The log file name is PCB-Log.txt, located in the root directory of your hard drive (normally Drive C). Now you have everything that shows up on the Diagnostics screen being logged to a file called PCB-Log.txt. You can email this file to ProSoft Technical Support for help with issues on the communications network. ProSoft Technology, Inc. February 15, 2012 Page 121 of 215
To begin the display of the communications data, start the Data Analyzer. When the Data Analyzer is running, you should see something like this.
The <R+> means that the module is transitioning the communications line to a transmit state. All characters shown in <> brackets are characters being sent out by the module. The <R-> shows when the module is done transmitting data, and is now ready to receive information back. And finally, all characters shown in the [ ] brackets is information being received from another device by the module. After taking a minute or two of traffic capture, stop the Data Analyzer.
5.3
5.4
The bits in each configuration word are shown in the following table. The module configuration error word has the following definition:
Bit 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description Read block start value is greater than the database size. Read block start value is less than zero. Read block count value is less than zero. Read block count + start is greater than the database size. Write block start value is greater than the database size. Write block start value is less than zero. Write block count value is less than zero. Write block count + start is greater than the database size. Value 0x0001 0x0002 0x0004 0x0008 0x0010 0x0020 0x0040 0x0080 0x0100 0x0200 0x0400 0x0800 0x1000 0x2000 0x4000 0x8000
Correct any invalid data in the configuration for proper module operation. When the configuration contains a valid parameter set, all the bits in the configuration words will be clear. This does not indicate that the configuration is valid for the user application. Make sure each parameter is set correctly for the specific application. Note: If the APP, BP ACT and OK LEDs blink at a rate of every one-second, this indicates a serious problem with the module. Call ProSoft Technology Support to arrange for repairs.
5.4.2 Troubleshooting
Use the following troubleshooting steps if you encounter problems when the module is powered up. If these steps do not resolve your problem, please contact ProSoft Technology Technical Support. Processor Errors
Problem Description Processor Fault Steps to take Verify that the module is plugged into the slot that has been configured for the module in the I/O Configuration of RSLogix. Verify that the slot location in the rack has been configured correctly in the ladder logic. This indicates a problem with backplane communications. A problem could exist between the processor and any installed I/O module, not just the MVI56E-MCM. Verify that all modules in the rack are correctly configured in the ladder logic.
Module Errors
Problem Description MVI56E modules with scrolling LED display: <Backplane Status> condition reads ERR Steps to take This indicates that backplane transfer operations are failing. Connect to the modules Configuration/Debug port to check this. To establish backplane communications, verify the following items: The processor is in RUN or REM RUN mode. The backplane driver is loaded in the module. The module is configured for read and write data block transfer. The ladder logic handles all read and write block situations. The module is properly configured in the processor I/O configuration and ladder logic. The program has halted or a critical error has occurred. Connect to the Configuration/Debug port to see if the module is running. If the program has halted, turn off power to the rack, remove the card from the rack and re-insert the card in the rack, and then restore power to the rack.
Reference
In This Chapter
Product Specifications ......................................................................... 128 Functional Overview ............................................................................ 132 Cable Connections .............................................................................. 152 MVI56E-MCM Database Definition...................................................... 158 MVI56E-MCM Configuration Data ....................................................... 159 MVI56E-MCM Status Data Definition .................................................. 167 MVI56E-MCM User Defined Data Types ............................................. 169 Modbus Protocol Specification ............................................................ 176 Using the Optional Add-On Instruction Rung Import ........................... 188 Using the Sample Program - RSLogix 5000 Version 15 and earlier .... 197
6.1
Product Specifications
The MVI56E Enhanced Modbus Master/Slave Communication Modules allow Rockwell Automation ControlLogix processors to easily interface with devices using the Modbus RTU/ASCII serial communications protocol. The MVI56E-MCM and MVI56E-MCMXT act as input/output modules on the ControlLogix backplane, making Modbus data appear as I/O data to the processor. Data transfer to and from the processor is asynchronous from the communications on the Modbus network. Two independently configurable serial ports can operate on the same or different Modbus networks. Each port can be configured as a Modbus Master or Slave, sharing the same user-controlled 5000word database. The two modules are functionally the same. The MVI56E-MCM is designed for standard process applications. The MVI56E-MCMXT is designed for the LogixXT control platform, allowing it to operate in extreme environments. It can tolerate higher operating temperatures, and it also has a conformal coating to protect it from harsh or caustic conditions.
Modbus Modes
Floating point data movement supported, including configurable support for Enron, Daniel , and other implementations 15: Force( Write) Multiple Coils 16: Preset (Write) Multiple Holding Registers 17: Report Slave ID (Slave Only) 22: Mask Write Holding Register (Slave Only) 23: Read/Write Holding Registers (Slave Only)
Modbus Function 1: Read Coil Status Codes Supported 2: Read Input Status 3: Read Holding Registers 4: Read Input Registers 5: Force (Write) Single Coil 6: Preset (Write) Single Holding Register 8: Diagnostics (Slave Only, Responds to Subfunction 00)
Serial Application ports (P1 & P2) Full hardware handshaking control, providing radio, modem, and multi-drop support Software configurable communication parameters Baud rate: 110 baud to 115.2 kbps RS-232, 485 and 422 Parity: none, odd or even Data bits: 5, 6, 7, or 8 Stop bits: 1 or 2 RTS on/off delay: 0 to 65535 milliseconds RJ45 (DB-9M with supplied adapter cable) Configurable RS-232 hardware handshaking 500V Optical isolation from backplane RS-232, RS-422, RS-485 jumper-select, each port RX (Receive) and TX (Transmit) LEDs, each port RJ45 to DB-9M cables for each serial port 5 foot Ethernet Straight-Thru Cable (Gray)
6.2
The following illustration shows the data transfer method used to move data between the ControlLogix processor, the MVI56E-MCM module and the Modbus Network.
As shown in the illustration above, all data transferred between the module and the processor over the backplane is through the input and output images. Ladder logic must be written in the ControlLogix processor to interface the input and output image data with data defined in the Controller Tags. All data used by the module is stored in its internal database. This database is defined as a virtual Modbus data table with addresses from 0 to 6999. The database is translated into a Modbus data table, according to which a Modbus command is received or sent. Refer to Modbus Memory Map (page 89) for more information. The following illustration shows the layout of the database: Modules Internal Database Structure 5000 registers for user data Register Data 4999 2000 words of configuration and status data Status and Config 6999 5000 0
Data contained in this database is paged through the input and output images by coordination of the ControlLogix ladder logic and the MVI56E-MCM module's program. Up to 248 words of data can be transferred from the module to the processor at a time. Up to 247 words of data can be transferred from the processor to the module. Each image has a defined structure depending on the data content and the function of the data transfer as defined below.
The Read Block ID is an index value used to determine the location of where the data will be placed in the ControlLogix processor controller tag array of module read data. Each transfer can move up to 200 words (block offsets 2 to 201) of data. In addition to moving user data, the block also contains status data for the module. This last set of data is transferred with each new block of data and is used for high-speed data movement. The Write Block ID associated with the block requests data from the ControlLogix processor. Under normal program operation, the module sequentially sends read blocks and requests write blocks. For example, if the application uses three read and two write blocks, the sequence will be as follows:
R1W1R2W2R3W1R1W2R2W1R3W2R1W1
This sequence will continue until interrupted by other write block numbers sent by the controller or by a command request from a node on the Modbus network or operator control through the modules Configuration/Debug port. Write Block These blocks of data transfer information from the ControlLogix processor to the module. The following table describes the structure of the output image. Write Block from Processor to Module
Word Offset 0 1 to 200 201 to 247 Description Write Block ID Write Data Spare Length 1 200 47
The Write Block ID is an index value used to determine the location in the modules database where the data will be placed. Each transfer can move up to 200 words (block offsets 1 to 200) of data.
Event Command Blocks (1000 to 1255 or 2000 to 2255) Event Command blocks send Modbus commands directly from the ladder logic to one of the Master Ports. The following table describes the format for these blocks. Block Request from Processor to Module
Word Offset 0 1 2 3 4 5 6 to 247 Description 1000 to 1255 or 2000 to 2255 Internal DB Address Point Count Swap Code Modbus Function Code Device Database Address Spare Length 1 1 1 1 1 1 242
The block number defines the Modbus Port that will send the command, and the Slave node that will respond to the command. Blocks in the 1000 range are directed to Modbus Port 1, and blocks in the 2000 range are directed to Modbus Port 2. The Slave address is represented in the block number in the range of 0 to 255. The sum of these two values determines the block number. The other parameters passed with the block are used to construct the command. The Internal DB Address parameter specifies the modules database location to associate with the command The Point Count parameter defines the number of points or registers for the command The Swap Code is used with Modbus function 3 requests to change the word or byte order The Modbus Function Code has one of the following values 1, 2, 3, 4, 5, 6, 15, or 16 The Device Database Address is the Modbus register or point in the remote Slave device to be associated with the command When the command receives the block, it will process it and place it in the command queue. The module will respond to each command block with a read block. The following table describes the format of this block. Block Response from Module to Processor
Word Offset 0 1 2 3 to 248 249 Description Reserved Write Block ID 0 = Fail, 1 = Success Spare 1000 to 1255 or 2000 to 2255 Length 1 1 1 246 1
Word two of the block can be used by the ladder logic to determine if the command was added to the command queue of the module. The command will only fail if the command queue for the port is full (100 commands for each queue). Page 136 of 215 ProSoft Technology, Inc. February 15, 2012
MVI56E-MCM ControlLogix Platform Modbus Communication Module Slave Status Blocks (3000 to 3003 or 3100 to 3103) Slave status blocks send status information of each Slave device on a Master Port. Slaves attached to the Master Port can have one of the following states:
0 1 2 The Slave is inactive and not defined in the command list for the Master Port.
The Slave is actively being polled or controlled by the Master Port. This does not indicate that the Slave has responded to this message. The Master Port has failed to communicate with the Slave device. Communications with the Slave is suspended for a user defined period based on the scanning of the command list. Communications with the Slave has been disabled by the ladder logic. No communication will occur with the Slave until this state is cleared by the ladder logic.
Slaves are defined to the system when the module initializes the Master command list. Each Slave defined will be set to a state of one in this initial step. If the Master Port fails to communicate with a Slave device (retry count expired on a command), the Master will set the state of the Slave to a value of 2 in the status table. This suspends communication with the Slave device for a user specified scan count (ERRORDELAYCNTR value in the MCMPORT object for each port). Each time a command in the list is scanned that has the address of a suspended Slave, the delay counter value will be decremented. When the value reaches zero, the Slave state will be set to one. This will enable polling of the Slave.
Block ID 3002 3003 3102 3103 Description Request for first 128 Slave status values for Modbus Port 1 Request for last 128 Slave status values for Modbus Port 1 Request for first 128 Slave status values for Modbus Port 2 Request for last 128 Slave status values for Modbus Port 2
The following table describes the format of these blocks. Block Request from Processor to Module
Word Offset 0 1 to 247 Description 3002 to 3003 or 3102 to 3103 Spare Length 1 246
The module will recognize the request by receiving the special write block code and respond with a read block with the following format: Block Response from Module to Processor
Word Offset 0 1 2 to 129 130 to 248 249 Description Reserved Write Block ID Slave Poll Status Data Spare 3002 to 3003 or 3102 to 3103 Length 1 1 128 119 1
Ladder logic can be written to override the value in the Slave status table. It can disable (state value of 3) by sending a special block of data from the processor to the Slave. Port 1 Slaves are disabled using block 3000, and Port 2 Slaves are disabled using block 3100. Each block contains the Slave node addresses to disable. The following table describes the structure of the block. Block Request from Processor to Module
Word Offset 0 1 2 to 201 202 to 247 Description 3000 or 3100 Number of Slaves in Block Slave indexes Spare Length 1 1 200 46
The module will respond with a block with the same identification code received and indicate the number of Slaves acted on with the block. The following table describes the format of the response block. Block Response from Module to Processor
Word Offset 0 1 2 3 to 248 249 Description Reserved Write Block ID Number of Slaves processed Spare 3000 or 3100 Length 1 1 1 246 1
Ladder logic can be written to override the value in the Slave status table to enable the Slave (state value of 1) by sending a special block. Port 1 Slaves are enabled using block 3001, and Port 2 Slaves are enabled using block 3101. Each block contains the Slave node addresses to enable. The following table describes the format for this block. Block Request from Processor to Module
Word Offset 0 1 2 to 201 202 to 247 Description 3001 or 3101 Number of Slaves in Block Slave indexes Spare Length 1 1 200 46
The module will respond with a block with the same identification code received and indicate the number of Slaves acted on with the block. The following table describes the format of this response block. Block Response from Module to Processor
Word Offset 0 1 2 3 to 248 249 Description Reserved Write Block ID Number of Slaves processed Spare 3001 or 3101 Length 1 1 1 246 1
Command Control Blocks (5001 to 5006 or 5101 to 5106) Command Control blocks place commands in the command list into the command queue. Each port has a command queue of up to 100 commands. The module services commands in the queue before the Master command list. This gives high priority to commands in the queue. Commands placed in the queue through this mechanism must be defined in the Master command list. Under normal command list execution, the module will only execute commands with the Enable parameter set to one or two. If the value is set to zero, the command is skipped. Commands may be placed in the command list with an Enable parameter set to zero. These commands can then be executed using the Command Control blocks. One to six commands can be placed in the command queue with a single request. The following table describes the format for this block. Block Request from Processor to Module
Word Offset 0 1 2 3 4 5 6 7 to 247 Description 5001 to 5006 or 5101 to 5106 Command index (MCM.CONFIG.PORTXMASTERCMD [command index value]) Command index (MCM.CONFIG.PORTXMASTERCMD [command index value]) Command index (MCM.CONFIG.PORTXMASTERCMD [command index value]) Command index (MCM.CONFIG.PORTXMASTERCMD [command index value]) Command index (MCM.CONFIG.PORTXMASTERCMD [command index value]) Command index (MCM.CONFIG.PORTXMASTERCMD [command index value]) Spare Length 1 1 1 1 1 1 1 241
Blocks in the range of 5001 to 5006 are used for Modbus Port 1, and blocks in the range of 5101 to 5106 are used for Modbus Port 2. The last digit in the block code defines the number of commands to process in the block. For example, a block code of 5003 contains 3 command indexes for Modbus Port 1. The Command index parameters in the block have a range of 0 to 99 and correspond to the Master command list entries. The module responds to a Command Control block with a block containing the number of commands added to the command queue for the port. The following table describes the format for this block. Block Response from Module to Processor
Word Offset 0 1 2 3 to 248 249 Description Reserved Write Block ID Number of commands added to command queue Spare 5000 to 5006 or 5100 to 5106 Length 1 1 1 246 1
Configuration Data Transfer When the module performs a restart operation, it will request configuration information from the ControlLogix processor. This data is transferred to the module in specially formatted write blocks (output image). The module will poll for each block by setting the required write block number in a read block (input image). Refer to Integrating the Sample Ladder Logic into an Existing Project (page 203) for a description of the data objects used with the blocks and the ladder logic required. The format of the blocks for configuration is given in the following topics. Module Configuration Block (9000) On boot-up, the module sends a request for configuration information to the processor. The request block has a Block ID of 9000. Block Request from Module to Processor
Word Offset 0 1 2 to 248 249 Description Reserved 9000 Spare 9000 Length 1 1 247 1
The processor responds by sending a block with general configuration information to the module. Configuration Block from Processor to Module
Word Offset 0 1 to 6 7 to 31 32 to 56 57 to 59 60 to 62 63 to 247 Description 9000 Backplane Setup Port 1 Configuration Port 2 Configuration Port 1 Aux. Configuration Port 2 Aux. Configuration Spare Length 1 6 25 25 3 3 185
If the configuration information is valid, the module commences normal data transfer operation. If there are errors in the configuration, the module sends the processor a read block with configuration error codes.
MVI56E-MCM ControlLogix Platform Modbus Communication Module Block Response from Module to Processor
Word Offset 0 1 2 3 4 5 to 248 249 Description Reserved 9000 Module Configuration Error Code Port 1 Configuration Error Code Port 2 Configuration Error Code Spare -2 or -3 Length 1 1 1 1 1 244 1
Any errors must be corrected before the module will start operating. Master Command Data List (6000 to 6003 or 6100 to 6103) Each port on the module can be configured as a Modbus Master device containing its own list of one hundred commands. The commands are read from the processor using the following Write Block IDs: Modbus Port 1: 6000 to 6003, and Modbus Port 2: 6100 to 6103. The module will sequentially poll for each block from the processor. Ladder logic must handle all of the data transfers. The following table describes the structure of each block. Configuration Block from Processor to Module
Word Offset 0 1 to 8 9 to 16 17 to 24 25 to 32 33 to 40 41 to 48 49 to 56 57 to 64 65 to 72 73 to 80 81 to 88 89 to 96 97 to 104 105 to 112 113 to 120 121 to 128 129 to 136 137 to 144 145 to 152 153 to 160 161 to 168 169 to 176 177 to 184 185 to 192 193 to 200 Description 6000 to 6003 and 6100 to 6103 Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Length 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
Pass-Through Blocks The Pass-through Mode allows a Modbus Slave port to pass write commands received from a host directly across the backplane to the ControlLogix processor for handling by ladder logic. Although this feature requires more ladder logic in order to implement a solution, there are certain situations where this functionality can be useful. Some of these situations include: 1 When the slave needs to know when it has been written to 2 When the acceptance of data may require some conditioning 3 When the hosts write data registers must overlap the read register space Unformatted Pass-Through Blocks (9996) If one or more of the Slave Ports on the module are configured for the unformatted pass-through mode, the module will pass blocks with identification codes of 9996 to the processor for each received write command. Any Modbus function 5, 6, 15, and 16 commands will be passed from the port to the processor using this block identification number. Ladder logic must handle the receipt of all Modbus write functions to the processor and to respond as expected to commands issued by the remote Modbus Master device. The structure of the unformatted Pass-through block is shown in the following table. Pass-Through Block 9996 from Module to Processor
Word Offset 0 1 2 3 to 248 249 Description 0 9996 Number of bytes in Modbus message Modbus message received 9996 Length 1 1 1 246 1
The ladder logic will be responsible for parsing and copying the received message and performing the proper control operation as expected by the Master device. The processor must then respond to the Pass-through block with a write block with the following format. Response Block 9996 from Processor to Module
Word Offset 0 1 to 247 Description 9996 Modbus slave response generated by ladder logic Length 1 247
This will inform the module that the command has been processed and can be cleared from the pass-through queue.
Formatted Pass-Through Blocks (9956 to 9959) If one or more of the Slave Ports on the module are configured for the Formatted Pass-through mode, the module will pass blocks with identification codes of 9956 to 9959 to the processor for each received write command. Any Modbus function 5, 6, 15 or 16 commands will be passed from the port to the processor using these block identification numbers. Ladder logic must handle the receipt of all Modbus write functions to the processor and must respond as expected to commands issued by the remote Modbus Master device. The structure of these formatted Pass-through blocks is shown in the following tables: Function 5 Pass-Through Block 9958 from Module to Processor
Word Offset 0 1 2 3 4 5 to 248 249 Description 0 9958 1 Bit Address Data Modbus data received 9958 Length 1 1 1 1 1 244 1
The ladder logic will be responsible for parsing and copying the received message and performing the proper control operation as expected by the Master device. The processor must then respond to the Pass-through block with a write block with the following format. Response Block 9958 from Processor to Module
Word Offset 0 1 to 247 Description 9958 Spare Length 1 247
This will inform the module that the command has been processed and can be cleared from the pass-through queue. Function 6 and 16 Pass-Through Blocks 9956 or 9957 from Module to Processor
Offset 0 1 2 3 4 to 248 249 Description 0 9956/9957 (Floating-point) Number of data words Data Address Data 9956/9957 Length 1 1 1 1 244 1
The ladder logic will be responsible for parsing and copying the received message and performing the proper control operation as expected by the Master device. The processor must then respond to the Pass-through block with a write block with the following format. Response Blocks 9956 or 9957 from Processor to Module
Offset 0 1 to 247 Description 9956/9957 Spare Length 1 247
This will inform the module that the command has been processed and can be cleared from the pass-through queue. Function 15 When the module receives a function code 15 while in pass-through mode, the module will write the data using block ID 9959 for multiple-bit data. First the bit mask clears the bits to be updated. This is accomplished by ANDing the inverted mask with the existing data. Next the new data ANDed with the mask is ORed with the existing data. This protects the other bits in the INT registers from being affected. Pass-Through Block 9959 from Module to Processor
Word Offset 0 1 2 3 4 to 53 54 to 103 104 to 248 249 Description 0 9959 Number of Words Word Address Data Mask Spare 9959 Length 1 1 1 1 50 50 145 1
The ladder logic will be responsible for parsing and copying the received message and performing the proper control operation as expected by the Master device. The processor must then respond to the Pass-through block with a write block with the following format. Response Block 9959 from Processor to Module
Word Offset 0 1 to 247 Description 9959 Spare Length 1 247
This will inform the module that the command has been processed and can be cleared from the pass-through queue.
Warm Boot Block (9998) This block is sent from the ControlLogix processor to the module (output image) when the module is required to perform a warm-boot (software reset) operation. This block is commonly sent to the module any time configuration data modifications are made in the controller tags data area. This will cause the module to read the new configuration information and to restart. The following table describes the format of the Warm Boot block. Block Request from Processor to Module
Word Offset 0 1 to 247 Description 9998 Spare Length 1 247
Cold Boot Block (9999) This block is sent from the ControlLogix processor to the module (output image) when the module is required to perform the cold boot (hardware reset) operation. This block is sent to the module when a hardware problem is detected by the ladder logic that requires a hardware reset. The following table describes the format of the Cold Boot block. Block Request from Processor to Module
Word Offset 0 1 to 247 Description 9999 Spare Length 1 247
MVI56E-MCM Remote Master Control The MVI56E-MCM can receive special function block codes from a remote Master on the network to control the module, using specific values written to regions of this block. The module can respond to the following requests: Write configuration to processor Warm boot Cold boot The remote Master controls the module by writing one of the following values to register 7800 (Modbus address 47801):
Block ID 9997 9998 9999 Description Write configuration in database to the processor and warm boot the module. Warm boot the module. Cold boot the module.
The control register is reset to 0 after the operation is executed with the exception of the 9997 command. If the module fails to successfully transfer the configuration to the processor, it will place one of the following error codes in the control register.
Error Code Description 0 -1 -2 -3 No error, transfer successful Error transferring general configuration information. Error transferring Modbus Port 1 Master command list Error transferring Modbus Port 2 Master command list
Ladder logic must handle the 9997 command. No ladder logic is required for the warm or cold boot commands. Write Configuration Block (-9000 and -6000 to -6003 or -6100 to -6103) This special function is used to update the processor's module configuration information when the modules configuration has been altered by a remote Master. The remote Master writes a block code 9997 to module register 7800 (Modbus Address 47801), causing the module to write its current configuration to the processor. Ladder logic must handle the receipt of these blocks. The first write block from the module contains a value of -9000 in the first word. Block Response from Module to Processor
Word Offset 0 1 2 to 7 8 to 32 33 to 57 58 to 60 61 to 63 64 to 248 249 Description Reserved -9000 Backplane Setup Port 1 Configuration Port 2 Configuration Port 1 Configuration (continued) Port 2 Configuration (continued) Spare -9000 Length 1 1 6 25 25 3 3 185 1
MVI56E-MCM ControlLogix Platform Modbus Communication Module Blocks -6000 to -6003 and -6100 to -6103 contain the Master Command List Data for ports 1 and 2, respectively: Block Response from Module to Processor
Word Offset 0 1 2 to 9 10 to 17 18 to 25 26 to 33 34 to 41 42 to 49 50 to 57 58 to 65 66 to 73 74 to 81 82 to 89 90 to 97 98 to 105 106 to 113 114 to 121 122 to 129 130 to 137 138 to 145 146 to 153 154 to 161 162 to 169 170 to 177 178 to 185 186 to 193 194 to 201 202 to 248 249 Description Reserved -6000 to -6003 and -6100 to -6103 Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Command Definition Spare -6000 to -6003 and -6100 to -6103 Length 1 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 47 1
Each of these blocks must be handled by the ladder logic for proper module operation.
2 3
4 5
The Modbus Slave Port driver receives the configuration information from the ControlLogix processor. This information configures the serial port and defines the Slave node characteristics. Additionally, the configuration information contains data that can be used to offset data in the database to addresses requested in messages received from Master units. A Host device, such as a Modicon PLC or an HMI application, issues a read or write command to the modules node address. The port driver qualifies the message before accepting it into the module. After the module accepts the command, the data is immediately transferred to or from the internal database in the module. If the command is a read command, the data is read from the database and a response message is built. If the command is a write command, the data is written directly into the database and a response message is built. After the data processing has been completed in Step 2, the response is issued to the originating Master node. Counters are available in the Status Block that permit the ladder logic program to determine the level of activity of the Slave Driver.
Refer to Integrating the Sample Ladder Logic into an Existing Project (page 203) for a complete list of the parameters that must be defined for a Slave Port. An exception to this normal mode is when the pass-through mode is implemented. In this mode, all write requests will be passed directly to the processor and will not be placed in the database. This permits direct, remote control of the processor without the intermediate database. This mode is especially useful for Master devices that do not send both states of control. For example, a SCADA system may only send an on command to a digital control point and never send the clear state. The SCADA system expects the local logic to reset the control bit. Pass-through must be used to simulate this mode. The following illustration shows the data flow for a Slave Port with pass-through enabled:
Processor Memory
ControlLogix Controller Tags
Backplane Interface
Database Addresses 0 Modbus Addresses 40001
MCM Module
Register Data
45000
Status
Status
Configuration Data
Configuration
Configuration
Master Driver In the Master mode, the MVI56E-MCM module issues read or write commands to Slave devices on the Modbus network. These commands are user configured in the module via the Master Command List received from the ControlLogix processor or issued directly from the ControlLogix processor (event command control). Command status is returned to the processor for each individual command in the command list status block. The location of this status block in the modules internal database is user defined.
The following illustration describes the flow of data to and from the module.
The Master driver obtains configuration data from the ControlLogix processor. The configuration data obtained includes the number of commands and the Master Command List. These values are used by the Master driver to determine the type of commands to be issued to the other nodes on the Modbus network. 2 After configuration, the Master driver begins transmitting read and/or write commands to the other nodes on the network. If writing data to another node, the data for the write command is obtained from the modules internal database to build the command. 3 Presuming successful processing by the node specified in the command, a response message is received into the Master driver for processing. 4 Data received from the node on the network is passed into the modules internal database, assuming a read command. 5 Status is returned to the ControlLogix processor for each command in the Master Command List. Refer to Integrating the Sample Ladder Logic into an Existing Project (page 203) for a complete description of the parameters required to define the virtual Modbus Master Port. Take care when constructing each command to ensure predictable operation of the module. If two commands write to the same internal database address of the module, the results will not be as desired. All commands containing invalid data are ignored by the module.
Master Command List In order to function in the Master Mode, you must define the modules Master Command List. This list contains up to 100 individual entries, with each entry containing the information required to construct a valid command. A valid command includes the following items: Command enable mode: (0) disabled, (1) continuous or (2) conditional Slave Node Address Command Type: Read or Write up to 125 words (16000 bits) per command Database Source and Destination Register Address: The addresses where data will be written or read. Count: The number of words to be transferred - 1 to 125 on FC 3, 4, or 16. Select the number of bits on FC 1, 2, 15. As the list is read in from the processor and as the commands are processed, an error value is maintained in the module for each command. This error list can be transferred to the processor. The following tables describe the error codes generated by the module. Note: 125 words is the maximum count allowed by the MODBUS protocol. Some field devices may support less than the full 125 words. Check with your device manufacturer for the maximum count supported by your particular slave.
6.3
Cable Connections
The application ports on the MVI56E-MCM module support RS-232, RS-422, and RS-485 interfaces. Please inspect the module to ensure that the jumpers are set correctly to correspond with the type of interface you are using. Note: When using RS-232 with radio modem applications, some radios or modems require hardware handshaking (control and monitoring of modem signal lines). Enable this in the configuration of the module by setting the UseCTS parameter to 1.
Note: The standard connector view shown is color-coded for a straight-through cable.
Crossover cable RJ-45 PIN 1 Rx+ 2 Rx3 Tx+ 6 TxRJ-45 PIN 3 Tx+ 6 Tx1 Rx+ 2 Rx-
Straight- through cable RJ-45 PIN 1 Rx+ 2 Rx3 Tx+ 6 TxRJ-45 PIN 1 Tx+ 2 Tx3 Rx+ 6 Rx-
RS-232: Modem Connection (Hardware Handshaking Required) This type of connection is required between the module and a modem or other communication device.
The "Use CTS Line" parameter for the port configuration should be set to 'Y' for most modem applications. RS-232: Null Modem Connection (Hardware Handshaking) This type of connection is used when the device connected to the module requires hardware handshaking (control and monitoring of modem signal lines).
RS-232: Null Modem Connection (No Hardware Handshaking) This type of connection can be used to connect the module to a computer or field device communication port.
Note: For most null modem connections where hardware handshaking is not required, the Use CTS Line parameter should be set to N and no jumper will be required between Pins 7 (RTS) and 8 (CTS) on the connector. If the port is configured with the Use CTS Line set to Y, then a jumper is required between the RTS and the CTS lines on the port connection.
6.3.5 RS-422
The RS-422 interface requires a single four or five wire cable. The Common connection is optional, depending on the RS-422 network devices used. The cable required for this interface is shown below:
Note: Terminating resistors are generally not required on the RS-485 network, unless you are experiencing communication problems that can be attributed to signal echoes or reflections. In these cases, installing a 120-ohm terminating resistor between pins 1 and 8 on the module connector end of the RS-485 line may improve communication quality. RS-485 and RS-422 Tip If communication in the RS-422 or RS-485 mode does not work at first, despite all attempts, try switching termination polarities. Some manufacturers interpret + and -, or A and B, polarities differently.
6.4
The User Data area holds data collected from other nodes on the network (Master read commands) or data received from the processor (write blocks). Additionally, this data area is used as a data source for the processor (read blocks) or other nodes on the network (write commands). Detailed definition of the miscellaneous status data area can be found in MVI56E-MCM Status Data Definition (page 167). Definition of the configuration data areas can be found in the data definition section of this document and in MVI56E-MCM Configuration Data Definition (page 159). MVI56E-MCM Command Control (page 146) contains a discussion of the command control section of the database.
6.5
5001
5002
5003
5004
Backplane Fail
5005
5006 to 5009
Spare
5011
Type
5012
Float Flag
5013
Float Start
5014
Float Offset
5015
Protocol
5016
Baud Rate
5017 5018
5019 5020
5021
RTS Off
5022
5024
5025
5026
5027
5028
5029 5030
5031
5032
Description This parameter specifies if the CTS modem control line is to be used. If the parameter is set to 0, the CTS line will not be monitored. If the parameter is set to 1, the CTS line will be monitored and must be high before the module will send data. This parameter is normally only required when halfduplex modems are used for communication (2wire). Slave ID This parameter defines the virtual Modbus Slave address for the internal database. All requests received by the port with this address are processed by the module. Verify that each device has a unique address on a network. Valid range for this parameter is 1 to 255 (247 on some networks). Bit in Offset This parameter specifies the offset address in the internal Modbus database for network requests for Modbus Function 2 commands. For example, if the value is set to 150, an address request of 0 will return the value at register 150 in the database. Word in Offset This parameter specifies the offset address in the internal Modbus database for network request for Modbus function 4 commands. For example, if the value is set to 150, an address request of 0 will return the value at register 150 in the database. Out in Offset This parameter specifies the offset address in the internal Modbus database for network requests for Modbus function 1, 5, or 15 commands. For example, if the value is set to 100, an address request of 0 will correspond to register 100 in the database. Holding Reg Offset This parameter specifies the offset address in the internal Modbus database for network requests for Modbus function 3, 6, or 16 commands. For example, if a value of 50 is entered, a request for address 0 will correspond to the register 50 in the database. Command Count This parameter specifies the number of commands to be processed by the Modbus Master Port. Minimum Command This parameter specifies the number of Delay milliseconds to wait between issuing each command. This delay value is not applied to retries. Command Error Pointer This parameter sets the address in the internal Modbus database where the command error will be placed. If the value is set to -1, the data will not be transferred to the database. The valid range of values for this parameter is -1 to 4899. Response Timeout This parameter represents the message response timeout period in 1-millisecond increments. This is the time that a port configured as a Master will wait before re-transmitting a command if no response is received from the addressed Slave. The value is set depending upon the communication network used and the expected response time of the slowest device on the network.
5034
5035 to 5039
Spare
5041
Type
5042
Float Flag
5043
Float Start
5044
Float Offset
5045
Protocol
5046
Baud Rate
5047
Parity
5049 5050
5051
RTS Off
5052
5053
5054
Slave ID
5055
Bit in Offset
5056
Word in Offset
5057
Out in Offset
5058
5061
5062
5063
5064
5065 to 5069
6700
6701
6702
6703 to 6750 6751 6752 6753 to 6760 6760 6761 6762 6763 to 6799
6.6
Port 1 Command List This field contains the number of requests made from this Requests port to Slave devices on the network. Port 1 Command List This field contains the number of Slave response messages Response received on the port. Port 1 Command List This field contains the number of command errors Errors processed on the port. These errors could be due to a bad response or command. Port 1 Requests Port 1 Responses Port 1 Errors Sent Port 1 Errors Received This field contains the total number of messages sent from the port. This field contains the total number of messages received on the port. This field contains the total number of message errors sent from the port. This field contains the total number of message errors received on the port.
Port 2 Command List This field contains the number of requests made from this Requests port to Slave devices on the network. Port 2 Command List This field contains the number of Slave response messages Response received on the port. Port 2 Command List This field contains the number of command errors Errors processed on the port. These errors could be due to a bad response or command. Port 2 Requests Port 2 Responses Port 2 Errors Sent Port 2 Errors Received Read Block Count Write Block Count This field contains the total number of messages sent out the port. This field contains the total number of messages received on the port. This field contains the total number of message errors sent out the port. This field contains the total number of message errors received on the port. This field contains the total number of read blocks transferred from the module to the processor. This field contains the total number of write blocks transferred from the module to the processor.
This field contains the total number of blocks successfully parsed that were received from the processor. This field contains the total number of command event blocks received from the processor. This field contains the total number of command blocks received from the processor. This field contains the total number of block errors recognized by the module. For a Slave Port, this field contains the value of the most recently returned error code. For a Master Port, this field contains the index number of the most recently executed command that failed. For a Slave Port, this field contains the value of the previous most recently returned error code. For a Master Port, this field contains the index number of the previous most recently executed command that failed. For a Slave Port, this field contains the value of the most recently returned error code. For a Master Port, this field contains the index number of the most recently executed command that failed. For a Slave Port, this field contains the value of the previous most recently returned error code. For a Master Port, this field contains the index number of the previous most recently executed command that failed.
232
233
234
6.7
MCMSTATUS (page Status information in each read block 172) MCMCONTROL (page 173) MCMUTIL (page 173) Optional requests from the processor to the module Variables for internal ladder usage - should not be accessed by user application
6.7.2 MCMCONFIG
This object contains the data types that apply to the configuration of the module. Refer to MVI56E-MCM Configuration Data Definition (page 159) for a complete description of each element in this object.
Name ModDef Port1 Port2 Port1MasterCmd Port2MasterCmd Data Type MCMModule (page 169) MCMPort (page 170) MCMPort MCMCmd[100] (page 171) MCMCmd[100] Description Module Defintion Port 1 configuration settings Port 2 configuration settings Master commands for Port 1 (ignore if port is configured for slave mode) Master commands for Port 2 (ignore if port is configured for slave mode)
MCMModule This object contains the information used to define the data movement between the module and the processor.
Name WriteStartReg WriteRegCnt ReadStartReg ReadRegCnt BPFail Data Type INT INT INT INT INT Description Start reg to transfer from PLC to module Number of registers to write from PLC Start reg to transfer from module to PLC Number of registers to transfer from module Determines module operation if BP fails 0=continue,>0=number of retries before comm shutdown Internal DB start register for status data (1=Ignore)
ErrStatPtr
INT
MCMPort This object contains the serial port configuration for the MVI56E-MCM module.
Name Enabled Type Data Type INT INT Description 0=Port Disabled,1=Port Enabled 0=Master, 1=Slave, 2=Slave: pass-through, 3=Slave: formatted pass-through/data swapped, 4=Slave: form. pass-through 0=No floating-point data, 1=Use floating-point data Register offset in message for floating-point data Internal DB offset to start of floating-point data 0=Modbus RTU, 1=Modbus ASCII Baudrate for port (110 to 115.2K) 0=None, 1=Odd, 2=Even, 3=Mark, 4=Space 5 to 8 data bits 1 or 2 stop bits 0-65535 mSec delay before data 0-65535 mSec delay after data 0-65535 mSec minimum time before response to request 0=No, 1=Yes to use CTS modem line 1-255 Modbus Node Address (Slave) Internal DB offset to bit input data (Slave) Internal DB offset to word input data (Slave) Internal DB offset to bit output data (Slave) Internal DB offset to holding register data (Slave) Command list count (Master) 0-65535 mSec minimum time between each command (Master) Internal DB location to place command error list (Master) 0-65535 mSec response timeout for command (Master) Retry count for failed request (Master) 0-65535 Command cycle count if error (Master) Reserved (Previously was UseGuardBand parameter) 0-65535 mSec time between characters to signal end of message Internal DB offset to function 99 counter
FloatFlag FloatStart FloatOffset Protocol Baudrate Parity DataBits StopBits RTSOn RTSOff MinResp UseCTS SlaveID BitInOffset WordInOffset OutOffset HoldOffset CmdCount MinCmdDelay CmdErrPtr RespTO RetryCount ErrorDelayCntr Reserved InterCharacterDelay Fcn99Offset
INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT INT
MVI56E-MCM ControlLogix Platform Modbus Communication Module MCMCmd This object contains the attributes to define a Master command. An array of these objects is used for each port.
Name Enable IntAddress PollInt Count Swap Node Func DevAddress Data Type INT INT INT INT INT INT INT INT Description
0=Disable,1=Continuous,2=Event Command Module's internal address associated with the command Minimum number of seconds between issuance of command (0-65535 Sec) Number of registers associated with the command Swap code used with command Node address of the target device on the network Function code for the command Address in device associated with the command
6.7.3 MCMDATA
Contains Read Data (data read from the module to the processor) and Write Data (data written from the processor to the module).
Name ReadData WriteData Data Type INT[600] INT[600] Description Data read from the module to the processor Data written from the processor to the module
6.7.4 MCMSTATUS
This status data is returned on each read block and can be used to detect proper module operation.
Name PassCnt Product Rev OP Run Prt1Errs Prt2Errs Blk Port1LastErr Port1PreviousErr Port2LastErr Port2PreviousErr Data Type INT INT[2] INT[2] INT[2] INT[2] MCMPortErrors (page 172) MCMPortErrors MCMBlkStat (page 172) INT INT INT INT Description Program cycle counter Product Name Revision Level Number Operating Level Number Run Number Port 1 error statistics Port 2 error statistics Block transfer statistics Last command index that received an error on Port 1 Previous Command index that received an error on Port 1 Last command index that received an error on Port 2 Previous Command index that received an error on Port 2
MCMPortErrors This object stores the port statistics for an MVI56E-MCM port.
Name CmdReq CmdResp CmdErr Requests Responses ErrSent ErrRec Data Type INT INT INT INT INT INT INT Description Total number of command list requests sent Total number of command list responses received Total number of command list errors Total number of requests for port Total number of responses for port Total number of errors sent Total number of errors received
MCMBlkStat This object stores the block transfer statistics for the module.
Name Read Write Parse Event Cmd Err Data Type INT INT INT INT INT INT Description Total number of read block transfers Total number of write block transfers Total number of blocks parsed Total number of event blocks received Total number of command blocks received Total number of block transfer errors
6.7.5 MCMCONTROL
This object contains the attributes to define a Master command. An array of these objects is used for each port.
Name WarmBoot ColdBoot BPLastRead BPLastWrite BlockIndex ReadDataSize MaxReadBlock WriteDataSize MaxWriteBlock RBTSremainder WBTSremainder Data Type BOOL BOOL INT INT INT DINT DINT DINT DINT INT INT Description Warm Boot Cold Boot Index of last read block Index of last write block Computed block offset for data table Size of Read Data Array Maximum read block Size of Write Data Array Maximum write block Contains remainder from Read Data array size divided by the block size Contains remainder from Write Data array size divided by the block size
6.7.6 Util
This object contains optional elements for the module.
Name CmdControl EventCmd SlavePollStat Passthru Data Type CmdControl (page 173) EventCmd (page 174) SlavePollStatus (page 174) Description Allows for a disabled command to be sent to a device (MASTER) Allows a command defined in ladder to be sent to a device (MASTER) Request slave poll status for the port (MASTER).
Passthru (page 174) Contains PassThru objects required when PortX.Type is set to a value between 2-4.
CmdControl
Name TriggerCmdCntrl NumberOfCommands PortNumber CommandIndex CmdsAddedToQueue CmdControlBlockID CmdCntrlPending Data Type BOOL INT INT INT[6] INT INT BOOL Description Trigger command control. User application will activate this trigger Number of commands per block (1 to 6) MVI56-MCM Port Number of master port (1 or 2) Stores the command indexes for command control Number of commands added to queue Temporary variable to calculate control block ID Auxiliary control command - prevents a second request before acknowledgment is received
Trigger for event command. User ladder must set this bit to initiate event command Set after the ladder has sent an event cmd to the module and is waiting for the status to be returned Module master port number associated to this request (1 or 2) Slave target modbus address Internal database address Number of points for this command Swap code (0= no swap, 1=swap words, 2=swap words and bytes, 3=swap bytes) Modbus function code Modbus register address in target modbus slave (0=Fail, 1=Sucess) Temporary variable to calculate event block ID
SlavePollStatus This object contains all of the Slave Polling status (when the port is used as a Master).
Tag Name Port1Slave0Read Port1Slave128Read Port2Slave0Read Port2Slave128Read P1Slaves P2Slaves Data Type BOOL BOOL BOOL BOOL INT[256] INT[256] P1 Slave Status P2 Slave Status Description
Passthru
Tag Name MBOffset MBOffsetBit MBMsgLen MBMsg MBControl1 MBControl2 MBScratch MBCoil Data Type INT INT INT SINT[500] CONTROL (page 173) CONTROL (page 173) INT[3] CoilArray (page 175) Conversion from Bool to INT data types Description
MVI56E-MCM ControlLogix Platform Modbus Communication Module CoilArray Conversion to INT values
Name Boolean Data Type BOOL[416] Description Conversion from Bool to INT data types
6.8
Each command list record has the same general format. The first part of the record contains the information relating to the communication module and the second part contains information required to interface to the MODBUS slave device.
Response An example response to Read Coil Status is as shown in Figure C2. The data is packed one bit for each coil. The response includes the Slave address, function code, quantity of data characters, the data characters, and error checking. Data will be packed with one bit for each coil (1 = ON, 0 = OFF). The low order bit of the first character contains the addressed coil, and the remainder follow. For coil quantities that are not even multiples of eight, the last characters will be filled in with zeros at high order end. The quantity of data characters is always specified as quantity of RTU characters, that is, the number is the same whether RTU or ASCII is used. Because the Slave interface device is serviced at the end of a controller's scan, data will reflect coil status at the end of the scan. Some Slaves will limit the quantity of coils provided each scan; thus, for large coil quantities, multiple PC transactions must be made using coil status from sequential scans.
Adr Func Byte Count 05 Data Coil Status 20 to 27 CD Data Coil Status 28 to 35 6B Data Coil Status 36 to 43 B2 Data Coil Status 44 to 51 OE Data Coil Status 52 to 56 1B Error Check Field CRC
11
01
The status of coils 20 to 27 is shown as CD(HEX) = 1100 1101 (Binary). Reading left to right, this shows that coils 27, 26, 23, 22, and 20 are all on. The other coil data bytes are decoded similarly. Due to the quantity of coil statuses requested, the last data field, which is shown 1B (HEX) = 0001 1011 (Binary), contains the status of only 5 coils (52 to 56) instead of 8 coils. The 3 left most bits are provided as zeros to fill the 8-bit format.
Response An example response to Read Input Status is as shown in Figure C4. The data is packed one bit for each input. The response includes the Slave address, function code, quantity of data characters, the data characters, and error checking. Data will be packed with one bit for each input (1=ON, 0=OFF). The lower order bit of the first character contains the addressed input, and the remainder follow. For input quantities that are not even multiples of eight, the last characters will be filled in with zeros at high order end. The quantity of data characters is always specified as a quantity of RTU characters, that is, the number is the same whether RTU or ASCII is used. Because the Slave interface device is serviced at the end of a controller's scan, data will reflect input status at the end of the scan. Some Slaves will limit the quantity of inputs provided each scan; thus, for large coil quantities, multiple PC transactions must be made using coil status for sequential scans.
Adr 11 Func 02 Byte Count 03 Data Discrete Input 10197 to 10204 AC Data Discrete Input 10205 to 10212 DB Data Discrete Input 10213 to 10218 35 Error Check Field CRC
The status of inputs 10197 to 10204 is shown as AC (HEX) = 10101 1100 (binary). Reading left to right, this show that inputs 10204, 10202, and 10199 are all on. The other input data bytes are decoded similar. Due to the quantity of input statuses requested, the last data field which is shown as 35 HEX = 0011 0101 (binary) contains the status of only 6 inputs (10213 to 102180) instead of 8 inputs. The two left-most bits are provided as zeros to fill the 8-bit format.
Response The addressed Slave responds with its address and the function code, followed by the information field. The information field contains 1 byte describing the quantity of data bytes to be returned. The contents of the registers requested (DATA) are two bytes each, with the binary content right justified within each pair of characters. The first byte includes the high order bits and the second, the low order bits. Because the Slave interface device is normally serviced at the end of the controller's scan, the data will reflect the register content at the end of the scan. Some Slaves will limit the quantity of register content provided each scan; thus for large register quantities, multiple transmissions will be made using register content from sequential scans. In the example below, the registers 40108 to 40110 have the decimal contents 555, 0, and 100 respectively.
Adr 11 Func 03 ByteCnt 06 Hi Data 02 Lo Data 2B Hi Data 00 Lo Data 00 Hi Data 00 Lo Data 64 Error Check Field CRC
Response The addressed Slave responds with its address and the function code followed by the information field. The information field contains 1 byte describing the quantity of data bytes to be returned. The contents of the registers requested (DATA) are 2 bytes each, with the binary content right justified within each pair of characters. The first byte includes the high order bits and the second, the low order bits. Because the Slave interface is normally serviced at the end of the controller's scan, the data will reflect the register content at the end of the scan. Each PC will limit the quantity of register contents provided each scan; thus for large register quantities, multiple PC scans will be required, and the data provided will be form sequential scans. In the example below the register 3009 contains the decimal value 0.
Adr 11 Func 04 Byte Count 02 Data Input Reg Hi 00 Data Input Reg Lo 00 Error Check Field E9
The use of Slave address 00 (Broadcast Mode) will force all attached Slaves to modify the desired coil.
Note: Functions 5, 6, 15, and 16 are the only messages that will be recognized as valid for broadcast.
Response The normal response to the Command Request is to re-transmit the message as received after the coil state has been altered.
Adr 11 Func 05 Data Coil # Hi 00 Data Coil # Lo AC Data On/ Off FF Data 00 Error Check Field CRC
The forcing of a coil via MODBUS function 5 will be accomplished regardless of whether the addressed coil is disabled or not (In ProSoft products, the coil is only affected if the necessary ladder logic is implemented).
Note: The Modbus protocol does not include standard functions for testing or changing the DISABLE state of discrete inputs or outputs. Where applicable, this may be accomplished via device specific Program commands (In ProSoft products, this is only accomplished through ladder logic programming).
Coils that are reprogrammed in the controller logic program are not automatically cleared upon power up. Thus, if such a coil is set ON by function Code 5 and (even months later), an output is connected to that coil, the output will be "hot".
Note Functions 5, 6, 15, and 16 are the only messages that will be recognized as valid for broadcast.
Adr 11
Func 06
Response The response to a preset single register request is to re-transmit the query message after the register has been altered.
Adr 11 Func 06 Data Reg Hi 00 Data Reg Lo 01 Data Input Reg Hi 00 Data Input Reg Lo 03 Error Check Field CRC
A server device can, however, be forced into 'Listen Only Mode' in which it will monitor the messages on the communications system but not respond to them. This can affect the outcome of your application program if it depends upon any further exchange of data with the remote device. Generally, the mode is forced to remove a malfunctioning remote device from the communications system. Sub-function Codes Supported Only Sub-function 00 is supported by the MVI56E-MCM module. 00 Return Query Data The data passed in the request data field is to be returned (looped back) in the response. The entire response message should be identical to the request.
Sub-function 00 00 Data Field (Request) Any Data Field (Response) Echo Request Data
Example and State Diagram Here is an example of a request to remote device to Return Query Data. This uses a sub-function code of zero (00 00 hex in the two-byte field). The data to be returned is sent in the two-byte data field (A5 37 hex).
Request Field Name Function Sub-function Hi Sub-function Lo Data Hi Data Lo (Hex) 08 00 00 A5 37 Response Field Name Function Sub-function Hi Sub-function Lo Data Hi Data Lo (Hex) 08 00 00 A5 27
The data fields in responses to other kinds of queries could contain error counts or other data requested by the sub-function code.
Note: Functions 5, 6, 15, and 16 are the only messages (other than Loopback Diagnostic Test) that will be recognized as valid for broadcast.
The following example forces 10 coils starting at address 20 (13 HEX). The two data fields, CD =1100 and 00 = 0000 000, indicate that coils 27, 26, 23, 22, and 20 are to be forced on.
Adr 11 Func 0F Hi Add 00 Lo Add 13 Quantity 00 Byte Cnt 0A Data Coil Status Data Coil Status 20 to 27 28 to 29 02 CD Error Check Field 00 CRC
Response The normal response will be an echo of the Slave address, function code, starting address, and quantity of coils forced.
Adr 11 Func 0F Hi Addr 00 Lo Addr 13 Quantity 00 Error Check Field 0A CRC
The writing of coils via Modbus function 15 will be accomplished regardless of whether the addressed coils are disabled or not. Coils that are unprogrammed in the controller logic program are not automatically cleared upon power up. Thus, if such a coil is set ON by function code 15 and (even months later) an output is connected to that coil, the output will be hot.
Note: Function codes 5, 6, 15, and 16 are the only messages that will be recognized as valid for broadcast.
Adr 11
Func 10
Hi Add 00
Lo Add 87
Quantity 00 02
Byte Cnt 04
Hi Data 00
Lo Data 0A
Hi Data 01
Response The normal response to a function 16 query is to echo the address, function code, starting address and number of registers to be loaded.
Adr 11 Func 10 Hi Addr 00 Lo Addr 87 Quantity 00 02 Error Check Field 56
Function Code Field: In a normal response, the server echoes the function code of the original request in the function code field of the response. All function codes have a most-significant bit (MSB) of 0 (their values are all below 80 hexadecimal). In an exception response, the server sets the MSB of the function code to 1. This makes the function code value in an exception response exactly 80 hexadecimal higher than the value would be for a normal response. With the function code's MSB set, the Master's application program can recognize the exception response and can examine the data field for the exception code. Data Field: In a normal response, the server may return data or statistics in the data field (any information that was requested in the request). In an exception response, the server returns an exception code in the data field. This defines the server condition that caused the exception. The following table shows an example of a Master request and server exception response.
Request Field Name Function Starting Address Hi Starting Address Lo Quantity of Outputs Hi Quantity of Outputs Lo (Hex) 01 04 A1 00 01 Response Field Name Function Exception Code (Hex) 81 02
In this example, the Master addresses a request to server device. The function code (01) is for a Read Output Status operation. It requests the status of the output at address 1245 (04A1 hex). Note that only that one output is to be read, as specified by the number of outputs field (0001). If the output address is non-existent in the server device, the server will return the exception response with the exception code shown (02). This specifies an illegal data address for the Slave.
The function code received in the query is not an allowable action for the Slave. This may be because the function code is only applicable to newer devices, and was not implemented in the unit selected. It could also indicate that the Slave is in the wrong state to process a request of this type, for example because it is unconfigured and is being asked to return register values. The data address received in the query is not an allowable address for the Slave. More specifically, the combination of reference number and transfer length is invalid. For a controller with 100 registers, a request with offset 96 and length 4 would succeed; a request with offset 96 and length 5 will generate exception 02. A value contained in the query data field is not an allowable value for Slave. This indicates a fault in the structure of the remainder of a complex request, such as that the implied length is incorrect. It specifically does not mean that a data item submitted for storage in a register has a value outside the expectation of the application program, because the Modbus protocol is unaware of the significance of any particular value of any particular register. An unrecoverable error occurred while the Slave was attempting to perform the requested action. Specialized use in conjunction with programming commands. The Slave has accepted the request and is processing it, but a long duration of time will be required to do so. This response is returned to prevent a timeout error from occurring in the Master. The Master can next issue a poll program complete message to determine if processing is completed. Specialized use in conjunction with programming commands. The Slave is engaged in processing a longduration program command. The Master should retransmit the message later when the Slave is free. Specialized use in conjunction with function codes 20 and 21 and reference type 6, to indicate that the extended file area failed to pass a consistency check. The Slave attempted to read record file, but detected a parity error in the memory. The Master can retry the request, but service may be required on the Slave device.
02
03
04 05
06
08
0a
Gateway Path Unavailable Specialized use in conjunction with gateways, indicates that the gateway was unable to allocate an internal communication path from the input port to the output port for processing the request. Usually means that the gateway is misconfigured or overloaded. Gateway Target Device Failed To Respond Specialized use in conjunction with gateways, indicates that no response was obtained from the target device. Usually means that the device is not present on the network.
0b
6.9
Using the Optional Add-On Instruction Rung Import 6.9.1 Before You Begin
Make sure that you have installed RSLogix 5000 version 16 (or later). Download the Optional Add-On file MVI56(E)MCM_Optional_Rung_v1_1.L5X from www.prosoft-technology.com or copy it from the ProSoft Solutions CDROM. Save a copy in a folder in your PC.
6.9.2 Overview
The Optional Add-On Instruction Rung Import contains optional logic for MVI56EMCM applications to perform the following tasks. Read/Write Ethernet Configuration Allows the processor to read or write the module IP address, netmask and gateway values. Note: This is an optional feature. You can perform the same task through PCB (ProSoft Configuration Builder). Even if your PC is in a different network group you can still access the module through PCB by setting a temporary IP address.
Read/Write Module Clock Value Allows the processor to read and write the module clock settings. The module clock stores the last time that the Ethernet configuration was changed. The date and time of the last Ethernet configuration change is displayed in the scrolling LED during module power up. Important: The Optional Add-On Instruction only supports the two features listed above. You must use the sample ladder logic for all other features including backplane transfer of Modbus data.
Navigate to the folder where you saved MVI56(E)MCM_Optional_Rung_v1_1.L5X and select the file.
The Add-On instruction will be now visible in the ladder logic. Observe that the procedure has also imported data types and controller tags associated to the Add-On instruction.
MVI56E-MCM ControlLogix Platform Modbus Communication Module You will notice that new tags have been imported: four MESSAGE tags, MVI56MCMCLOCK and MVI56MCMETHERNET tags.
4 5
In the Add-On instruction click the [...] button next to each MSG tag to open the MESSAGE CONFIGURATION TAG. Click the COMMUNICATION tab and click the BROWSE button as follows.
Reference User Manual 6 Select the module to configure the message path.
The bit will be automatically reset and the current Ethernet settings will be copied to MVI56MCMETHERNET controller tag as follows.
The bit will be automatically reset and the current clock value will be copied to MVI56MCMCLOCK.CONFIG controller tag as follows.
6.10
Insert the ProSoft Solutions CD-ROM into the CD drive of your PC. Wait for the startup screen to appear. 2 On the startup screen, click Product Documentation. This action opens an Explorer window. Files are arranged by type: o The Ladder Logic folder contains sample programs for each module, arranged by processor type, and then by product name. The sample programs for your module are in the ControlLogix/MVI56/MVI56E-MCM folder. o The Manuals folder contains product manuals and datasheets in Adobe Acrobat Reader format (PDF) for each module, arranged in the same way as the Ladder Logic folder. o The Utilities folder contains additional programs and tools required for some ProSoft modules. Refer to your user manual to determine if you need to use or install any of these additional tools. 3 In the Explorer window, navigate to the files you need, and then copy them to a location on your hard drive.
Download the manuals and sample program from the ProSoft Technology web site
You can always download the latest version of the sample ladder logic and user manuals for the MVI56E-MCM module from the ProSoft Technology web site, at http://www.prosoft-technology.com/support/downloads (http://www.prosofttechnology.com/support/downloads)
From that link, navigate to the download page for your module and choose the sample program to download for your version of RSLogix 5000 and your processor.
To determine the firmware version of your processor
Important: The RSLinx service must be installed and running on your computer in order for RSLogix to communicate with the processor. Refer to your RSLinx and RSLogix documentation for help configuring and troubleshooting these applications. 1 2 3 4 Connect an RS-232 serial cable from the COM (serial) port on your PC to the communication port on the front of the processor. Start RSLogix 5000 and close any existing project that may be loaded. Open the Communications menu and choose Go Online. RSLogix will establish communication with the processor. This may take a few moments. When RSLogix has established communication with the processor, the Connected To Go Online dialog box will open.
MVI56E-MCM ControlLogix Platform Modbus Communication Module 5 On the Connected To Go Online dialog box, click the General tab. This tab shows information about the processor, including the Revision (firmware) version. In the following illustration, the firmware version is 11.32
6 1 2
Select the sample ladder logic file for your firmware version:
On the Connected to Go Online dialog box, click the Select File button. Choose the sample program file that matches your firmware version, and then click the Select button. 3 RSLogix will load the sample program. The next step is to configure the correct controller type and slot number for your application. Choosing the Controller Type The sample application is for a 1756-L63 ControlLogix 5563 Controller. If you are using a different model of the ControlLogix processor, you must configure the sample program to use the correct processor model. 1 In the Controller Organization list, select the folder for the controller and then click the right mouse button to open a shortcut menu.
MVI56E-MCM ControlLogix Platform Modbus Communication Module On the shortcut menu, choose PROPERTIES. This action opens the Controller Properties dialog box.
Click the CHANGE TYPE or CHANGE CONTROLLER button. This action opens the Change Controller dialog box.
4 5 6
Open the TYPE dropdown list, and then select your ControlLogix controller. Select the correct firmware revision for your controller, if necessary. Click OK to save your changes and return to the previous window.
Selecting the Slot Number for the Module The sample application is for a module installed in Slot 1 in a ControlLogix rack. The ladder logic uses the slot number to identify the module. If you are installing the module in a different slot, you must update the ladder logic so that program tags and variables are correct, and do not conflict with other modules in the rack.
1 2
In the CONTROLLER ORGANIZATION list, select the module [1] 1756-MODULE MVI56, and then click the right mouse button to open a shortcut menu. On the shortcut menu, choose PROPERTIES. This action opens the MODULE PROPERTIES dialog box.
In the SLOT field, use the up and down arrows on the right side of the field to select the slot number where the module will reside in the rack, and then click OK. RSLogix will automatically apply the slot number change to all tags, variables and ladder logic rungs that use the MVI56E-MCM slot number for computation. Adjust the Input and Output Array Sizes Note: The following steps are only required if you are using the sample ladder logic (RSLogix version 15 or older) rather than the Add-On Instruction (RSLogix version 16 or newer). 1 2 Click ReadData to open ladder file and go to rung #2 of this file. Change the High Limit on the LIM statement to allow for 5 blocks of data, as shown in the following illustration. (1000 registers / 200 registers per block = 5 blocks of data)
3 4 5
Verify the change to this rung. Toggle the object within RSLogix 5000. Save and download ladder to the processor. When Online with the ControlLogix processor, toggle the MCM.CONTROL.WARMBOOT bit to download the changes to the processor. Page 201 of 215
To download the sample program from RSLogix 5000 to the ControlLogix processor
Note: The key switch on the front of the ControlLogix module must be in the REM position. 1 2 If you are not already online to the processor, open the COMMUNICATIONS menu, and then choose DOWNLOAD. RSLogix will establish communication with the processor. When communication is established, RSLogix will open a confirmation dialog box. Click the DOWNLOAD button to transfer the sample program to the processor.
3 4
RSLogix will compile the program and transfer it to the processor. This process may take a few minutes. When the download is complete, RSLogix will open another confirmation dialog box. Click OK to switch the processor from PROGRAM mode to RUN mode.
Note: If you receive an error message during these steps, refer to your RSLogix documentation to interpret and correct the error.
MVI56E-MCM ControlLogix Platform Modbus Communication Module In the SELECT MODULE TYPE dialog box, select 1756-MODULE (GENERIC 1756 MODULE) from the list and, and then click OK. This action opens the MODULE PROPERTIES dialog box.
In the MODULE PROPERTIES dialog box, enter the Name, Description and Slot options for your application, using the examples in the following illustration. You must select the Comm Format as DATA - INT in the dialog box. Failure to set the correct parameters will result in backplane communication problems between the module and the processor.
Click the NEXT button and set the Request Packet Interval to 5.0ms as shown in the following illustration.
Copying the User Defined Data Types Next, copy the User Defined Data Types from the sample program to your existing program. These data types contain configuration information, status, commands and other functions used by the program. 1 Arrange the two RSLogix 5000 windows on your desktop so that they are side-by-side. 2 In the CONTROLLER ORGANIZATION pane in the Sample Program, expand the DATA TYPES folder until the list of User-Defined data types is visible. 3 In the Sample Program window, select one data type at a time, and then drag the data type to the User-Defined data types folder in your existing program. 4 Repeat these steps until you have copied all of the data types from the sample program into your existing application. Note: Data types prefixed with an underscore [_] are used in optional routines, and need not be copied unless your application requires them. Refer to MVI56E-MCM User Defined Data Types (page 169) for a description of the usage for each data type.
Copying the Sample Ladder Logic Next, copy the Sample Ladder Logic from the sample program to your existing program. 1 In the CONTROLLER ORGANIZATION pane in the Sample Program, expand the TASKS folder until the list of program routines is visible.
In the Sample Program window, select one routine at a time, and then drag the routine to the MainProgram folder in your existing program. 3 Save your program. The sample program contains the following tasks.
MainRoutine The MAINROUTINE checks for the presence of new read data from the module for the processor. The module cycles through its list of read blocks to transfer data from the module to the processor. Whenever new data is available, the module will set the value for the block in the modules input image (LOCAL:1:I:DATA[249]). The ladder logic must constantly scan this input word for a new value. The ladder logic should only perform the READDATA and WRITEDATA tasks, in that order, when a new value is present in LOCAL:1:I:DATA[249], otherwise data may be lost or scrambled. If the new data is available, the LASTREAD and word (249) will not be equal. This will force the program to call the READDATA subroutine to process the new data received. After the new data is placed in the Modbus Data Table, the program will send new data to the module using the WRITEDATA subroutine. ReadData The READDATA task handles all new data and status information received from the module and placing it in the proper location in the processor. Data is transferred from the module to the processor using the modules input image (LOCAL:1:I:DATA[ ]). This task should set the last read block number (MCM1.BP.LastRead) to the current block number sent from the module (LOCAL:1:I:DATA[249]) and stores the newly received read block number (DATA[249]) into the LASTREAD variable. Note: The _READCONTROL routine handles the command control responses received from the module. If command control, event command, or Slave status blocks are not going to be used in the application, then the _READCONTROL rung (rung 4 in the sample READDATA task) and the _READCONTROL and _WRITECONTROL ladder files may be removed.
If the module is configured for zero blocks, it will send blocks with identification codes of zero and -1. These blocks will only contain status data, and no user data will be included in these blocks. The ladder obtains status information when the module is configured for either 1 or 0 blocks of read data. If the module is configured with 0 for the ReadRegCnt, then blocks -1 and 0 will be given by the module on the input image. If the ReadRegCnt is 200 or less, then you will receive block 0 and block 1. The ladder logic also determines if the new data received in the input image is user data. If user data is present, the ladder logic will place the data in the correct location in the processors read data area (MCM.READDATA[ ]). Up to 200 data words can be transferred in each block transfer. In addition to the user data, the block also contains important status data. This data should be copied to the correct data area in the module (MCM.STATUS). This status data can be used to determine the "health" of the MVI56E-MCM module. This rung computes offset into the Modbus Data Table for the received data block and to store the data into the Modbus Data Table. If the requested block is within the valid range of data blocks for the Modbus Data Table, the offset into the table is computed as (Block ID number - 1) * 200. This is the starting offset in the Modbus Data Table where the 200 bits of data will be stored. When the processor receives a pass-through block the received data will be handled at the _Pass-Thru routine. If the module is being used as a Modbus Master (PortX.Type=0) or a standard Modbus Slave (Port X.Type = 1) then this rung of logic and the _PassThru routine are not required. If the module is being used as PortX.Type = 2 to 4, then this rung and ladder routine is required. WriteData The WriteData task sends data from the processor to the MVI56E-MCM module. Data is transferred from the processor to the module using the modules output image (LOCAL:1:O:DATA[ ]). This task should store the currently requested data set in the modules MCM.BP.LASTWRITE data object. This object is used in all subsequent ladder logic in case the input word (LOCAL:1:I:DATA[1]) changes during processing. Note: The _WRITECONTROL 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 _WRITECONTROL rung (rung 7 in the sample WRITEDATA task) and the _READCONTROL and _WRITECONTROL 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.WRITEDATA 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.MODDEF 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.PORT1 and MCM.PORT2 configure the modules serial ports for Modbus communications. The sample program configures Port 1 as a Modbus Master, and Port 2 as a Modbus Slave. MCM.P1.CMD and MCM.P2.CMD configure the Modbus Master commands for the module. These commands are active only if a port is configured as a Modbus Master. MCM.READDATA contains data read by the ControlLogix processor from the MVI56E-MCM module. MCM.WRITEDATA contains data read from the ControlLogix processor to the modules internal database. The remaining controller tags contain error and status information, and special commands to execute. 1 In the CONTROLLER ORGANIZATION pane in each instance of RSLogix 5000, expand the CONTROLLER folder. 2 Double-click the CONTROLLER TAGS icon in each instance of RSLogix 5000. This action opens the CONTROLLER TAGS dialog box. 3 In the CONTROLLER TAGS dialog box in each instance of RSLogix 5000, click the EDIT TAGS tab, located at the bottom of the dialog box. 4 In the Sample Program, select the line containing the MCM tag structure.
Drag the MCM tag structure to the blank line at the bottom of the list in the EDIT TAGS tab in your existing program.
Editing the Controller Tags The MVI56E-MCM module configuration is stored in the MCM.CONFIG structure in the CONTROLLER TAGS dialog box. The sample program configures the module as a Modbus Master on Port 1, and a Modbus Slave on Port 2. ProSoft Technology, Inc. February 15, 2012 Page 209 of 215
To edit the module configuration, in the Controller Organization pane, expand the CONTROLLER folder, and then double-click CONTROLLER TAGS. This action opens CONTROLLER TAGS - MVI56MCM, as shown in the following illustration.
To configure a Modbus Master, refer to Configuring the MVI56E-MCM as a Modbus Master. To configure a Modbus Slave, refer to Configuring the MVI56E-MCM as a Modbus Slave. Note: In order for any of the new values entered into these fields to be used by the module, you must restart the module (WarmBoot, ColdBoot, or cycle power).
Note: For technical support calls within the United States, an after-hours answering system allows 24-hour/7-days-a-week pager access to one of our qualified Technical and/or Application Support Engineers. Detailed contact information for all our worldwide locations is available on the following page.
Warranty Information
For complete details regarding ProSoft Technologys TERMS & CONDITIONS OF SALE, WARRANTY, SUPPORT, SERVICE AND RETURN MATERIAL AUTHORIZATION INSTRUCTIONS please see the documents on the Product CD/DVD or go to www.prosoft-technology/warranty All documentation is subject to change without notice.
Index
_
_PassThru 208 _ReadControl 208 _WriteControl 208
D
Data Analyzer 119 Data Analyzer Tips 121 Data Flow Between MVI56E-MCM Module and ControlLogix Processor 148 DB9 to RJ45 Adaptor (Cable 14) 157 Defining Module in I/O Configuration 203 Deployment Checklist 13 Diagnostics (Function Code 08) 182 Diagnostics and Troubleshooting 9, 97, 109, 111 Downloading the Sample Program to the Processor 53, 202
0
00 Return Query Data 183
A
About the MODBUS Protocol 132 About the Optional Add-On Instruction 37 Adding Multiple Modules (Optional) 44 Adjust the Input and Output Array Sizes 201 Adjust the Input and Output Array Sizes (Optional) 50, 86
E
Editing the Controller Tags 209 Enron/Daniel Float Configuration 94 Ethernet Cable Configuration 152, 153 Ethernet Cable Specifications 152 Ethernet LED Indicators 110 Ethernet Performance 153 Event Command 83 Event Command Blocks (1000 to 1255 or 2000 to 2255) 136 EventCmd 173, 174 Example 1 Local Rack Application 29 Example 2 Remote Rack Application 32 Example and State Diagram 183
B
Backplane Configuration 116 Backplane Data Transfer 132 Backplane Setup 159 Backplane Status 116 Battery Life Advisory 4 Before You Begin 188
C
Cable Connections 152 Choosing the Controller Type 199 Clearing a Fault Condition 125 CmdControl 173 CoilArray 174, 175 Cold Boot Block (9999) 145 Command Control 82, 166 Command Control and Event Command 81 Command Control Blocks (5001 to 5006 or 5101 to 5106) 139 Command Error Codes 100, 104 Command List Entry Errors 103 Commands Supported by the Module 176 Communication Error Codes 124 Configuration as a Modbus Master 57 Configuration as a Modbus Slave 85 Configuration Data Transfer 140 Configuring the Data Analyzer 119 Configuring the RSLinx Driver for the PC COM Port 54 Connect to the Modules Web Page 37, 114 Connecting Your PC to the ControlLogix Processor 52 Connecting Your PC to the Module's Ethernet Port 21 Contacting Technical Support 211 Copying the Controller Tags 209
F
Floating-Point Data Handling (Modbus Master) 67, 68, 75 Floating-Point Data Handling (Modbus Slave) 92, 93 Force (Write) Multiple Coils 0x (Modbus Function Code 15) 72 Force (Write) Single Coil 0x (Modbus Function Code 5) 71 Force Multiple Coils (Function Code 15) 184 Force Single Coil (Function Code 05) 180 Formatted Pass-Through Blocks (9956 to 9959) 143 Function 15 144 Function 5 143 Function 6 and 16 143 Functional Overview 9, 132 Functional Specifications 130
G
General Specifications 129 General Specifications - Modbus Master/Slave 129 Guide to the MVI56E-MCM User Manual 9
I
Import the Ladder Rung 41 Important Safety Information - MVI56E-MCM/XT 3 Importing the Sample Add-On Instruction 37, 42 Importing the Utility Add-On Instruction Rung 189 Installing the Module in the Rack 17
P
Package Contents 15 Pass-Through Blocks 92, 142 Passthru 173, 174 Pinouts 101, 102, 129, 131, 152, 153, 157 Port 1 Commands 164 Port 1 Setup 160 Port 2 Commands 165 Port 2 Setup 162 Port Configuration 61, 118 Port Status 119 Preset (Write) Multiple Registers 4x (Modbus Function Code 16) 74 Preset (Write) Single Register 4x (Modbus Function Code 6) 73 Preset Multiple Registers (Function Code 16) 185 Preset Single Register (Function Code 06) 182 Product Specifications 9, 128 ProSoft Technology Product Documentation 2
M
MainRoutine 206 Master Command Configuration 59, 62, 164, 165 Master Command Data List (6000 to 6003 or 6100 to 6103) 141 Master Command Examples 67 Master Command List 118, 151 Master Command Status 118 Master Driver 149 MCM Status Data 104 MCMBlkStat 172 MCMCmd 169, 171 MCMCONFIG 169 MCMCONTROL 169, 173, 174 MCMDATA 169, 171 MCMModule 169 MCMModuleDef 169 MCMPort 118, 169, 170 MCMPortErrors 172 MCMSTATUS 169, 172 Misc. Status 118, 165 Modbus Exception Codes 187 Modbus Exception Responses 185 Modbus Memory Map 89, 90, 133 Modbus Protocol Specification 176 ModDef Settings 59, 87, 116 Module Communication Error Codes 102 Module Configuration Block (9000) 140 Monitoring Backplane Information 116 Monitoring Database Information 117 Monitoring General Information 118 Monitoring Modbus Port Information 118, 123 MVI56E-MCM Configuration Data 158, 159, 169 MVI56E-MCM Database Definition 117, 158 MVI56E-MCM Remote Master Control 146, 158 MVI56E-MCM Status Data Definition 97, 123, 158, 167 MVI56E-MCM Status Data Definition as a Master 98 MVI56E-MCM Status Data Definition as a Slave 106 MVI56E-MCM User Defined Data Types 169, 205
R
Read and Write Same Modbus Address (Pass Through) 86, 95 Read Block 134 Read Coil Status (Function Code 01) 177 Read Coil Status 0x (Modbus Function Code 1) 69 Read Floating-Point Data 75 Read Floats with Single Modbus Register Address (Enron/Daniel Float) 78 Read Holding Registers (Function Code 03) 179 Read Holding Registers 4x (Modbus Function Code 3) 67 Read Input Registers (Function Code 04) 180 Read Input Registers 3x (Modbus Function Code 4) 68 Read Input Status (Function Code 02) 178 Read Input Status 1x (Modbus Function Code 2) 70 Read Multiple Floating-Point Registers 76, 79 ReadData 206 Reading Status Data from the Module 123 Reading the Clock Value from the Module 195 Reading the Ethernet Settings from the Module 192 Reference 9, 127 RS-232 Modem Connection (Hardware Handshaking Required) 154 Null Modem Connection (Hardware Handshaking) 154 Null Modem Connection (No Hardware Handshaking) 155 RS-232 Application Port(s) 153 RS-422 156 RS-485 and RS-422 Tip 156
N
Non-Scrolling LED Status Indicators 111 Normal Data Transfer 134
S
Scrolling LED Status Indicators 110 Selecting the Slot Number for the Module 200 Setting Jumpers 16 Setting Up a Permanent IP Address 23, 25 Setting Up a Temporary IP Address 22 Setting Up the Project 20 Slave Configuration 92 Slave Driver 148 Slave Status Blocks (3000 to 3003 or 3100 to 3103) 119, 137 Slave Status List 119 SlavePollStatus 173, 174 Special Function Blocks 135 Standard Modbus Protocol Errors 101 Start Here 9, 11 Starting the Data Analyzer 120 Stopping the Data Analyzer 121 Sub-function Codes Supported 183 Support, Service & Warranty 9, 211 System Requirements 12
Y
Your Feedback Please 2
T
The Diagnostics Menu 115 Transferring the Command Error List to the Processor 103 Troubleshooting 126
U
Unformatted Pass-Through Blocks (9996) 142 Using CIPconnect to Connect to the Module 25, 27, 35, 113, 153 Using ProSoft Configuration Builder Software 19 Using RSWho to Connect to the Module 25, 35 Using the Diagnostics Menu in ProSoft Configuration Builder 112 Using the Optional Add-On Instruction Rung Import 188 Using the Sample Program - RSLogix 5000 Version 15 and earlier 14, 37, 197 Using the Sample Program in a New Application 197 Using the Sample Program in an Existing Application 134, 140, 149, 150, 203 Util 169, 173
V
Verify Communication 97 Verify Slave Communications 105 Verifying Master Communications 98 Viewing the Error Status Table 123
W
Warm Boot Block (9998) 145 What's New? 128 Write Block 135