EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via...

42
For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 1 EtherNet/IP Controller to Modbus Master Communication via DeviceMaster EIP-MOD Gateways

Transcript of EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via...

Page 1: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 1

EtherNet/IP Controller to Modbus Master Communication via

DeviceMaster EIP-MOD Gateways

Page 2: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 2

CONTENTS

1. Introduction 3

2. Configure Interfaces to Modbus Master(s) 4

2.1 Serial Modbus Master(s) 4

2.2 Modbus/TCP Master(s) 5

2.3 Modbus RTU/ASCII over Ethernet TCP/IP Master(s) 6

3. Communicate via a Class1 Connection 7

3.1 Shared Memory Configuration 8

3.1.1 Default Configuration 8

3.1.2 Creating a Custom Class 1 Interface 10

3.2 Configuring an I/O Ethernet Module on a ControlLogix PLC 11

3.3 Class 1 Connection Example 14

3.3.1 Modbus Master(s) Configuration 15

3.3.2 Example of a Running System 19

4. Communicate via PLC Tags and Files 27

4.1 Shared Memory Configuration 28

4.2 PLC Tag Definitions 29

4.3 PLC File Definitions 29

4.4 Example of Tag to/from Modbus Communication Between an EtherNet/IP PLC and a Modbus Master 31

4.4.1 EtherNet/IP Tag Definitions 31

4.4.2 DeviceMaster EIP-MOD Configuration 32

4.4.3 Modbus Master Configuration 34

4.4.4 Example Running System 36

Page 3: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 3

1. INTRODUCTION

This document is intended to explain how to provide communication between EtherNet/IP con-trollers and Modbus master controllers.

• EtherNet/IP Controllers Include:• CIP compliant controllers that support Class 1 connections. These include numerous

PLCs, HMIs, SCADA systems, OPC Servers, etc.• Limited CIP controllers that communicate through PCCC messages over EtherNet/IP.

These include MicroLogix, SLC 5/05 and PLC-5 PLCs as well as some HMIs and OPC servers.

• Modbus master controllers include many types of PLCs, HMIs, SCADA systems, OPC servers, custom applications and many others. The Modbus master interfaces supported by the De-viceMaster EIP-MOD gateway include the following:

• Serial Modbus RTU/ASCII interfaces. RS-485, RS-232, RS-422, selectable baud rates, parity, etc.

• Modbus TCP interfaces via standard socket port 502 and up to seven other configu-rable ports. (503,505,506, etc.)

• Modbus RTU/ASCII over Ethernet TCP/IP. A highly configurable interface is provided to tailor the socket interface(s) for different environments.

The steps necessary to provide communication between an EtherNet/IP controller and a Mod-bus master involve the following:1. Configure the DeviceMaster EIP-MOD gateway.

• Configure and enable Shared Memory.• Configure the Modbus master interface(s)

• Serial port– configure any serial port to connect to a Modbus RTU/ASCII serial master

• Modbus TCP interface• Modbus RTU/ASCII over Ethernet TCP/IP

2. Configure the EtherNet/IP controller(s) (PLC, SCADA, HMI, etc).• Via Class1 connection• Via Tag or File (depending on PLC type)

3. Connect the EtherNet/IP PLC(s) to the DeviceMaster EIP-MOD gateway.• IP Addresses should be on same subnet

4. Connect the Modbus master(s) to the DeviceMaster EIP-MOD gateway.• Serial connection • Modbus TCP • Modbus RTU/ASCII over Ethernet TCP/IP

Page 4: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 4

2. CONFIGURE INTERFACES TO MODBUS MASTER(S)2.1 Serial Modbus Master(s)

Each serial port on the DeviceMaster EIP-MOD gateway can connect to a serial Modbus Master. To configure a serial port to connect to a serial Modbus Master, go to the embedded serial con-figuration web page.

The following serial master interfaces are supported:• Modes – RS/232, RS-485, RS-422, etc.• Modbus/RTU-to-Master – connects directly to a Modbus/RTU serial master• Modbus/ASCII-to-Master – connects directly to a Modbus/ASCII serial master• Modbus/RTU-to-Master/Slaves – connects to a RS-485 or RS-422 serial bus containing a

Modbus/RTU serial master and one or more Modbus/RTU serial slave devices• Modbus/ASCII-to-Master/Slaves – connects to a RS-485 or RS-422 serial bus containing a

Modbus/ASCII serial master and one or more Modbus/ASCII serial slave devices

Page 5: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 5

2.2 Modbus/TCP Master(s)

The standard Modbus/TCP socket port is, be default, always enabled. To configure other socket ports to receive Modbus/TCP messages, go to the Modbus/TCP configuration web page. Up to seven additional TCP/IP socket ports can be configured:

Note: The default TCP/IP ports are recommended as they do not interfere with other defined interfaces on the DeviceMaster EIP-MOD gateways. For a complete list of defined TCP/IP ports, please go to https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers.

Page 6: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 6

2.3 Modbus RTU/ASCII over Ethernet TCP/IP Master(s)

To connect a Modbus Master that communicates using Modbus RTU/ASCII messages over Ether-net TCP/IP connections, go to the Modbus over TCP configuration page:

Up to total of six connections can be supported per Modbus over TCP configuration.• Enable must be selected.• One Connect To connection can be made by setting the Connect To Mode to Connect-Al-

ways and configuring the Connect Port and Connect IP Address to that of the listening application.

• Up to six Listen type connections can made by selecting Listen and configuring the Listen Port. The default Listen Port is acceptable in most instances.

Page 7: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 7

3. COMMUNICATE VIA A CLASS1 CONNECTION

This method involves setting up a Class1 connection to the DeviceMaster EIP-MOD gateway on the EtherNet/IP PLC.

The EtherNet/IP Class1 interface allows an EtherNet/IP Controller to directly communicate to the Shared Memory on the DeviceMaster EIP-MOD gateway. The Class 1 interface definition directly correlates to the Shared Memory configuration. In order to change Class 1 interface definition, the Shared Memory must be re-configured.

Page 8: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 8

3.1 SharedMemoryConfiguration

The DeviceMaster EIP-MOD gateway provides a configurable Class 1 interface to and from the Shared Memory blocks. While some EtherNetIP controllers restrict the data size of Class1 con-nections to no more than 512 bytes, other controllers provide for larger Class1 connections. You will need to obtain the capabilities of your EtherNet/IP controller in order to create the maxi-mum sized Class1 interface for your system.

3.1.1DefaultConfiguration

The default Shared Memory configuration provides the following Class1 interface:• Read access from Holding Register block 1 and Coils block 1. • Write access to Holding Register block 2 and Coils block 2.

Page 9: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 9

The EtherNet/IP Class 1 interface web page displays the Class 1 parameters:

Where the following Class1 interfaces are supported:

Instance Length (in bytes)

Input (To PLC)

Holding Register Block 1 Only 101 1 - 400Coil Block 1 Only 109 1 - 40Both Holding Register Block 1 and Coil Block 1 101 1 - 440Output (From PLC)

Holding Register Block 2 Only 118 400

Coil Block 2 Only 126 40

Both Holding Register Block 2 and Coil Block 2 118 440

Default Shared Memory Configuration

Page 10: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 10

3.1.2CreatingaCustomClass1Interface

If the default Class 1 interface is not suitable for your system, then you can create a custom Class 1 interface by changing the Shared Memory configuration.

To change the Class 1 interface on the DeviceMaster EIP-MOD gateway, you will need to make the following changes to the Shared Memory Configuration.• Modifying the Read (Input) Access:

• To add additional Shared memory blocks, select the Class1 Read Enable option for the desired block.

• To remove existing Shared memory blocks, deselect the Class1 Read Enable option for the desired block.

• Modifying the Write (Output) Access: • To add additional Shared memory blocks, set the Write Master(s) option to EIP Class1

for the desired block. • To remove a Shared memory block from write access, change to Write Master(s) op-

tion to a setting other than EIP Class1 such as All (Except Class).• Click on Apply Settings to save the configuration settings.• The custom Class 1 interface will now be displayed on the Data Mapping/EtherNetIP Class1

embedded web page.

Page 11: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 11

3.2ConfiguringanI/OEthernetModuleonaControlLogixPLC

In RsLogix, each DeviceMaster EIP-MOD gateway must be set up as a Generic Ethernet Module to interface to the PLC via a Class 1 connection. The class 1 interface, as shown above, is dis-played on the EtherNetIP Class1 web page:

1. First, right click on the Ethernet module on RSLogix5000 and select New Module….2. Click on Communications.3. Scroll down and select Generic Ethernet Module.

4. Click on OK. The following pane will appear.

a. Enter a Name.b. Select the Comm Format as Data-INT.

Page 12: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 12

c. Enter the IP Address of the gateway.d. Using the data displayed on the Class 1 Overview web page, enter the Connection Param-eters.

5. Click on OK. The following pane will appear:

a. The faster allowable RPI is 10 ms.b. Both Unicast, (point-to-point), and Multicast, (one-to-many), connections are supported.

6. Click on OK. The module will be added.7. View the corresponding Input and Output data tags created when the gateway module was

added. Once the PLC has connected to the DeviceMaster EIP-MOD gateway, these tags will communicate directly to the configured Shared Memory blocks.

Input tag:

Page 13: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 13

Output tag:

Page 14: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 14

3.3Class1ConnectionExample

The following details an example of using a Class 1 connection to communicate between an Eth-erNet/IP controller and a Modbus master.The following setup will be used:• The Class1 connection defined above will be used to connect the ControlLogix PLC to the De-

viceMaster EIP-MOD gateway. • The default Shared Memory configuration displayed above will also be used. This will pro-

vide:• Input (to PLC) Class1 connection between Shared Memory Holding Register block 1

and Shared Memory Coils block 1. • Output (from PLC) Class1 connection between Shared Memory Holding Register block

2 and Shared Memory Coils block 2.• A Modbus TCP master writing to the Shared Memory Holding Register block 1 and reading

from Shared Memory Holding Register block 2.• A Modbus TCP master writing to the Shared Memory Coil block 1 and reading from Shared

Memory Coil block 2.

Relevant diagnostics pages will be shown for the running connection.

Page 15: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 15

3.3.1ModbusMaster(s)Configuration

The Modbus Poll application was used to demonstrate Modbus TCP master functionality. Avail-able Modbus masters include:• Modbus TCP master(s) via socket port 502 as well as up to seven configurable socket ports.• Modbus/RTU and/or Modbus/ASCII serial master(s) vis a serial port.• Modbus/RTU and/or Modbus/ASCII over Ethernet TCP/IP masters via the TCP/IP Configura-

tion(s).

3.3.1.1ModbusTCPMastertoHoldingRegistersConfiguration

Read 100 words of data received from EtherNet/IP PLC via Shared Memory Holding Registers block 2:

Where: • Slave ID = 252 (Device ID of Shared Memory)• Address = 201 (Start address of Holding Registers block 2)• Quantity = 100 registers (valid range: 1-125)

Page 16: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 16

Write 100 words of data to be sent to the EtherNet/IP PLC via Shared Memory Holding Registers block 1:

Where: • Slave ID = 252 (Device ID of Shared Memory)• Address = 1 (Start address of Holding Registers block 1)• Quantity = 100 registers (valid range: 1-123)

Page 17: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 17

3.3.1.2ModbusTCPMastertoCoilsConfiguration

Read 100 coils of data received from EtherNet/IP PLC via Shared Memory Coil block 2:

Where: • Slave ID = 252 (Device ID of Shared Memory)• Address = 321 (Start address of Coil block 2)• Quantity = 100 coil (valid range: 1-2240)

• Note: 320 is the size of each coil block. To read only the coils in Shared Memory Coil block 2, the length should be set to no larger than 320.

Page 18: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 18

Write 100 coils of data to be sent to the EtherNet/IP PLC via Shared Memory Coil block 1:

Where: • Slave ID = 252 (Device ID of Shared Memory)• Address = 1 (Start address of Coil block 1)• Quantity = 100 coils (valid range: 1-320)

• Note: 320 is the size of each coil block – not the maximum size of a Write Coils Modbus message. The next Shared Memory Coil block, block 2, is connected to the Class con-nection and is not writeable by a Modbus master.

Page 19: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 19

3.3.2ExampleofaRunningSystem3.3.2.1 PLC Class1 Memory3.3.2.1.1InputData

The next two diagrams display the input data received from the Shared Memory on the GW EIP/ASCII.

The first 200 INTs are received directly from Holding Registers block 1:The last 20 INTs contain coil data received directly from Coil block 1:

Page 20: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 20

3.3.2.1.2OutputData

The next two diagrams display the output data sent to the Shared Memory on the GW EIP/ASCII.

The first 200 INTs are sent directly to Holding Registers block 2.

The last 20 INTs contain coil data are sent directly to Coil block 2:

Page 21: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 21

3.3.2.2 Modbus TCP/Controller(s) Data

This diagram displays the Modbus TCP master:• Reading Shared Memory Holding Registers block 2 starting at address 201.• Writing Shared Memory Holding Registers block 1 starting at address 1.

Page 22: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 22

This diagram displays the Modbus TCP master:• Reading Shared Memory Coil block 2 starting at address 321.• Writing Shared Memory Coil block 1 starting at address 1.

Page 23: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 23

3.3.2.3DeviceMasterEIP-MODGatewayEmbeddedDiagnosticPages3.3.2.3.1 EtherNet/IP Interface Statistics

This page displays the EtherNet/IP statistics for the running system.

Page 24: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 24

3.3.2.3.2 Modbus TCP Statistics

This page displays the Modbus TCP interface statistics:

Page 25: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 25

3.3.2.3.3 Shared Memory Contents

These pages display the contents and statistics for the applicable Shared Memory blocks.Holding Register Block1 – Data Received from Modbus TCP Master and Sent to EtherNet/IP PLC:

Coil Block1 – Data Received from Modbus TCP Master and Sent to EtherNet/IP PLC:

Page 26: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 26

Holding Register Block 2 – Data Received from EtherNet/IP PLC and read by the Modbus TCP master:

Coil Block 2 – Data Received from EtherNet/IP PLC and read by the Modbus TCP master:

Page 27: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 27

4. COMMUNICATE VIA PLC TAGS AND FILES

This method involves configuring the Data Mapping feature on the DeviceMaster EIP-MOD gate-way to provide an interface between the EtherNetIP controllers memory and the Shared Memo-ry. This method is only possible if your EtherNet/IP controller supports CIP table read and write or PCCC messages.

Page 28: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 28

4.1 SharedMemoryConfiguration

The Shared Memory interface in the DeviceMaster EIP-MOD gateway operates in the same man-ner towards the Data Mapping system as it does towards other Modbus controllers. It treats the Data Mapping subsystem as another type of Modbus controller.

The Data Mapping subsystem can access the Shared Memory blocks if the following guidelines are followed:• The Shared Memory must be enabled.• The Shared Memory device Id must not conflict with any Modbus slaves attached to the gate-

way either directly or remotely. If this occurs, the Modbus slave device will not be accessibl

• All Data Mapping configurations that access the Shared Memory must:• Use the configured Shared Memory device Id.• Use valid address/length ranges for the Shared Memory. Any out of address range

configurations will be rejected.• For Data Mapping write accesses, the Shared Memory block Write Master(s) setting

must be set to:• For Tag/File to Modbus Data Mapping configurations either:

• All (Except Class1)• EIP TAG/FILE and the IP address of the EtherNet/IP controller.

• For Modbus to Modbus Data Mapping configurations either:• All (Except Class1)• Modbus to Modbus

• The appropriate function codes must be used.• Valid read function codes for Holding Register blocks are:

• Read Holding Registers (03)• Read Input Registers (04)

• Valid read function codes for Coil blocks are:• Read Coil Status (01)• Read Input Status (02)

• Valid write function codes for Holding Register blocks are:• Write Single Register (06)• Write Multiple Holding Registers (16)

• Valid write function codes for Coil blocks are:• Write Single Coil (01)• Write Multiple Coils (15)

Page 29: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 29

4.2 PLCTagDefinitions

PLC tags are memory variables defined in RSLogix5000 and similar PLC programs. The tags must have the following characteristics:• Tags must be public so that other EtherNet/IP controllers can read and/or write to them. In

RSLogix5000, these tags are Controller type tags with the External Access attribute set to Read/Write or Read Only.

• Tags must be either single entry or one-dimensional arrays. • The Tag Name should NOT include brackets, whether the tag is single entry or an array. • The tag data type must correlate to the Data Type selected for the tag.• The tag must be long enough to contain all required data.

Data Type RSLogix5000 Data Type(s) Example(s) Required Modbus Memory

SINT Can be either:• Single SINT• Array of SINTs

Name Data Type

varSint SINTvarSintArray SINT[40]

One Holding or Input Register for every two SINTs

INT Can be either:• Single INT• Array of INTs

Name Data Type

varlint INTvarlintArray INT[20]

One Holding or Input Register for each INT

DINT Can be either:• Single DINT• Array of DINTs

Name Data Type

varDint DINTvarDintArray DINT[10]

Two Holding or Input Registers for each DINT

BOOL Can only be:• Single BOOL

Name Data Type

varBOOL BOOLOne Coil or Input Status for each BOOL.One Holding or Input Register per BOOL.

BIT ARRAY Can only be:• Array of BOOLs

Name Data Type

varBOOLArray BOOL[320]One Coil or Input Status for each BOOL array entry.A Holding or Input Register can contain up to 16 BOOLs.

FLOAT Can be either:• Single FLOAT• Array of FLOATs

Name Data Type

varFloat FLOATvarFloat Array FLOAT[10]

Two Holding or Input Registers for each FLOAT entry.

4.3 PLCFileDefinitions

PLC files are memory tables defined in RSLogix500, RS Logix5 and similar PLC programs. They are used in EtherNet/IP controllers such as MicroLogix, SLC 5/05 and PLC-5 PLCs. The files must have the following characteristics:

Page 30: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 30

• Files must be public so that other EtherNet/IP controllers can read and/or write to them. In RSLogix500, the Scope of the file must be set to Global.

• The File Name must be of the proper format to specify the entry or bit. • The file data type must correlate to the Data Type selected for the file.• The file must be long enough to contain all required data.

Data Type RSLogix5000 Data Type(s) Example(s) Required Modbus Memory

SINT N/A N/A N/A

INT A file of type N (INTEGER) Name Data Type

N10:0 N (INTEGER)N11:100 N (INTEGER)

One Holding or Input Register for each INT

DINT N/A N/A N/A

BOOL A file of type B (BINARY)• Only requires a single binary bit.

Name Data Type

B32:0 B (BINARY) bit 0B32:0/12 B (BINARY) bit 12

One Coil or Input Status for each BOOL.One Holding or Input Register per BOOL.

BIT ARRAY A file of type B (BINARY) Name Data Type

B32:0 B (BINARY) starting at bit 0B32:0/12 B (BINARY) Starting at bit 12

One Coil or Input Status for each BINARY bit entry.A Holding or Input Register can contain up to 16 bits.

FLOAT A file of type F (FLOAT) Name Data Type

F30:0 F (FLOAT)F30:28 F (FLOAT)

Two Holding or Input Registers for each FLOAT entry.

Page 31: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 31

4.4 ExampleofTagto/fromModbusCommunicationBetweenan EtherNet/IP PLC and a Modbus Master

The following is an example configuration that will move 100 holding registers between a Mod-bus TCP master and a ControlLogix PLC via Tags.

4.4.1EtherNet/IPTagDefinitions

The tags must be defined in the ControlLogix PLC.The configuration of the input tag (FromModbusMaster):

The configuration of the output tag (ToModbusMaster):

Page 32: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 32

4.4.2DeviceMasterEIP-MODConfiguration

The Shared Memory must be enabled. For this example, we will use the Shared Memory in its default configuration.

Two Data Mapping configurations are required in the DeviceMaster EIP-MOD to move the data between the EtherNet/IP PLC Tags and the Shared Memory. For this example, we will be using Shared Memory holding Register Holding Register block 7, (EtherNet/IP to Modbus), and block 8 (Modbus to EtherNet/IP).

Page 33: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 33

4.4.2.1ModbustoEtherNet/IPTagConfiguration

This configuration:• Reads 100 holding registers from the start of Shared Memory Holding Register Block 8.• Writes the data to the “FromModbusMaster” tag in the ControlLogix PLC.• Repeats cycle every 2000 ms (2 seconds).

4.4.2.2EtherNet/IPTagtoModbusConfiguration

This configuration:• Reads 100 integers from the “ToModbusMaster” tag in the ControlLogix PLC.• Writes the data beginning at the start of Shared Memory Holding Register Block 7.• Repeats cycle every 2000 ms (2 seconds).

Page 34: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 34

4.4.3ModbusMasterConfiguration

The Modbus Poll application was used to demonstrate Modbus TCP master functionality. Avail-able Modbus masters include:• Modbus TCP master(s) via socket port 502 as well as up to seven configurable socket ports.• Modbus/RTU and/or Modbus/ASCII serial master(s) vis a serial port.• Modbus/RTU and/or Modbus/ASCII over Ethernet TCP/IP masters via the TCP/IP Configura-

tion(s).

4.4.3.1ModbusTCPMastertoHoldingRegistersConfiguration

Read 100 words of data received from the EtherNet/IP PLC tag “ToModbusMaster” via Shared Memory Holding Registers block 7:

Where: • Slave ID = 252 (Device ID of Shared Memory)• Address = 1201 (Start address of Holding Registers block 7)• Quantity = 100 registers (valid range: 1-125)

Page 35: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 35

Write 100 words of data to be sent to the EtherNet/IP PLC tag “FromModbusMaster” via Shared Memory Holding Registers block 8:

Where: • Slave ID = 252 (Device ID of Shared Memory)• Address = 1401 (Start address of Holding Registers block 8)• Quantity = 100 registers (valid range: 1-123)

Page 36: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 36

4.4.4ExampleRunningSystem

4.4.4.1InputTag

Based on the Read Modbus Write Tag/File configuration, the DeviceMaster EIP-MOD gateway writes the data from Holding Registers block 8 to the “FromModbusMaster” tag:

Page 37: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 37

4.4.4.2OutputTag

Based on the Read Tag/File Write Modbus configuration, the DeviceMaster EIP-MOD gateway reads the data from the “ToModbusMaster” tag and then writes it into Holding Registers block 7:

Page 38: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 38

4.4.4.3 Modbus TCP/Controller Data

This diagram displays the Modbus TCP master:• Reading Shared Memory Holding Registers block 7 starting at address 1201.• Writing Shared Memory Holding Registers block 8 starting at address 1401.

Page 39: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 39

4.4.4.4DeviceMasterEIP-MODGatewayEmbeddedDiagnosticPages

4.4.4.4.1 EtherNet/IP Interface Statistics

This page displays the EtherNet/IP statistics for the running system.

Page 40: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 40

4.4.4.4.2 Modbus TCP Statistics

This page displays the Modbus TCP interface statistics:

Page 41: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 41

4.4.4.4.3 Shared Memory Contents

These pages display the contents and statistics for the applicable Shared Memory blocks.

Holding Register Block 7 – Data Received from EtherNet/IP PLC and read by the Modbus TCP master:

Page 42: EtherNet/IP Controller to Modbus Master Communication via ... · • Modbus TCP master(s) via socket port 502 as well as up to seven conigurable socket ports. • Modbus/RTU and/or

For more information: 1.800.926.6876 | 763.957.6000 | www.comtrol.com 42

Holding Register Block8 – Data Received from Modbus TCP Master and Sent to EtherNet/IP PLC: