You are on page 1of 6

GW MODBUS TCP/RTU shared memory

Modbus master-to-master communication

Quick Reference Guide


QRG_916_EN_02_GW-MODBUS-shared-memory.docx
© PHOENIX CONTACT 2019-10-18

Pos. Qty. Order-No. Type-Description Description


1 1 2702764 GW MODBUS TCP/RTU 1E/1DB9 Modbus gateway (shown in this Guide)
2 2702765 GW MODBUS TCP/RTU 1E/2DB9 Modbus gateway variants with multiple ports
2702766 GW MODBUS TCP/RTU 2E/2DB9
2702767 GW MODBUS TCP/RTU 2E/4DB9
3 2 Modbus master

1 Overview
This document provides guidance to connect, install and configure the GW MODBUS TCP/RTU… to enable
communication between two Modbus masters using the Shared Memory. These Modbus masters may be either Modbus
TCP or RTU. This guide will use one of each as shown in Figure 1: Master-to-Master example.
The GW MODBUS TCP/RTU… will allow the two Modbus masters to communicate by allowing the Modbus masters to
read and write to the Shared Memory.
This document assumes the user understands basic electrical concepts including Modbus, serial and Ethernet
communication.

Figure 1: Master-to-Master example

Make sure you always use the latest documentation.


It can be downloaded at: www.phoenixcontact.net/products
GW MODBUS TCP/RTU shared memory

2 Firmware update
Ensure the latest firmware revision is running on the GW MODBUS TCP/RTU gateway. If necessary, download the latest
firmware from http://www.phoenixcontact.net/qr/2702764/softw and install the firmware by following the instructions
documented in the user manual.

3 Login
Set the IP address of the connected PC to the subnetwork of the GW MODBUS TCP/RTU...: for example, IP =
192.168.254.10, subnetwork = 255.255.255.0.
Open a web browser and enter the IP address of the GW MODBUS TCP/RTU... in the “Address” field. The default IP
address is 192.168.254.254.
If the web server does not load, first check the IP parameters of the PC. If everything is set correctly, check to see if there
are any proxy settings loaded in the web browser. The proxy setting must be set to “Load automatically” or “Deactivated”
to properly establish communication.
Enter the credentials to access the web server configuration pages. The default credentials are:
• User name: Admin
• Default password: admin

4 Configure Modbus TCP


Modbus TCP port 502 is open by default on the GW MODBUS TCP/RTU… Up to seven additional ports may be enabled
under the Modbus TCP configuration tab if desired. No additional settings are necessary for Modbus TCP communication.

Figure 2: Modbus TCP configuration

QRG_916_EN_02_GW-MODBUS-shared-memory.docx PHOENIX CONTACT 2


GW MODBUS TCP/RTU shared memory

5 Configure serial communication


Navigate to the Serial Settings tab and configure the settings to match the serial settings of the Modbus RTU master.
Under the Serial Devices field, Select Modbus RTU Master and click the Apply Changes button.

Figure 3: Serial communication settings

QRG_916_EN_02_GW-MODBUS-shared-memory.docx PHOENIX CONTACT 3


GW MODBUS TCP/RTU shared memory

6 Configure Shared Memory


Navigate to the Shared Memory tab under the Modbus Settings. The Shared Memory configuration options are broken into
three sections, Shared Memory Configuration, Shared Holding Registers and Shared Coils.

6.1 Shared Memory Configuration


The Shared Memory Configuration section is used to enable the Shared Memory, define the Slave ID and define the
starting address for the holding registers and coils.
• Enable Shared Memory: Click the Enable Shared Memory check box.
• Shared Memory Device ID: Enter a Modbus device ID for the GW MODBUS TCP/RTU.... The device ID must be
unique within the Modbus network. The valid range of values is 1 to 255 although Modbus org recommends using
values between 1-247.
• Holding Register Start Address (Base 1): Enter the starting address of the GW MODBUS TCP/RTU... holding
registers. The GW MODBUS TCP/RTU supports extended holding register addressing. Therefore, the valid
starting address range is 40001 to 463935.
• Coil Block Start Address (Base 1): Enter the starting address of the GW MODBUS TCP/RTU... coils. The GW
MODBUS TCP/RTU supports extended coil addressing. Therefore, the valid starting address range is 1 to
64255.

QRG_916_EN_02_GW-MODBUS-shared-memory.docx PHOENIX CONTACT 4


GW MODBUS TCP/RTU shared memory

6.2 Shared Holding Registers


The Shared Holding Registers consists of eight blocks of 200 registers. The first address in Block 1 begins at the Holding
Register Start Address configured above. Every master may read any of the Blocks. Each Block may be configured to limit
write access to a specific Modbus master or may allow any master to write to the address range. Precaution must be taken
to prevent Modbus masters from overwriting each other if all masters are permitted to write to a Block.
In this example, any master may write to Block 1 (40001-40200). Only the master connected to serial port 1 may write to
Block 2 (40201-40400). Only the master with the IP address of 192.168.254.11 may write to Block 3 (40401-40600).
Every master may read any of the Blocks.

6.3 Shared Coils


The Shared Coils consists of eight blocks of 160 coils. The first address in Block 1 begins at the Coil Block Start Address
configured above. Every master may read any of the Blocks. Each Block may be configured to limit write access to a
specific Modbus master or may allow any master to write to the address range. Precaution must be taken to prevent
Modbus masters from overwriting each other if all masters are permitted to write to a Block.
In this example, any master may write to Block 1 (00001-00160). Only the master connected to serial port 1 may write to
Block 2 (00161-00320). Only the master with the IP address of 192.168.254.11 may write to Block 3 (00321-00480).
Every master may read any of the Blocks.

QRG_916_EN_02_GW-MODBUS-shared-memory.docx PHOENIX CONTACT 5


GW MODBUS TCP/RTU shared memory

6.4 Display
The Display button shows the Shared Memory Contents. Viewing the Shared Memory Contents is useful to verify that the
expected data is being written to the correct location. Easily navigate between Blocks of memory using the drop-down
menu. Change the Display Format and Data lines per row for easier viewing.

PHOENIX CONTACT GmbH & Co. KG • 32825 Blomberg • Germany 6


www.phoenixcontact.com

You might also like