[go: up one dir, main page]

0% found this document useful (0 votes)
101 views66 pages

Protocol Converter For Modbus RTU/ASCII To Modbus TCP: User Manual

This document provides information about a protocol converter that allows communication between Modbus RTU/ASCII and Modbus TCP. It describes the product, installation, configuration, diagnostics and maintenance. Application examples are also provided to illustrate how to use different features.

Uploaded by

Tiago Ramos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views66 pages

Protocol Converter For Modbus RTU/ASCII To Modbus TCP: User Manual

This document provides information about a protocol converter that allows communication between Modbus RTU/ASCII and Modbus TCP. It describes the product, installation, configuration, diagnostics and maintenance. Application examples are also provided to illustrate how to use different features.

Uploaded by

Tiago Ramos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

Protocol converter for Modbus RTU/ASCII to

Modbus TCP
User manual
UM EN GW MODBUS TCP/RTU
User manual
Protocol converter for Modbus RTU/ASCII to Modbus TCP

UM EN GW MODBUS TCP/RTU, Revision C 2021-08-11

This user manual is valid for:


Designation Version
GW MODBUS TCP/RTU 1E/1DB9 2702764
GW MODBUS TCP/RTU 1E/2DB9 2702765
GW MODBUS TCP/RTU 2E/2DB9 2702766
GW MODBUS TCP/RTU 2E/4DB9 2702767
3762_en_C

PHOENIX CONTACT GmbH & Co. KG • Flachsmarktstraße 8 • 32825 Blomberg • Germany


phoenixcontact.com
Table of contents

Table of contents
1 For your safety ............................................................................................................................ 3
1.1 Labeling of warning notes...................................................................................... 3
1.2 Qualification of users ............................................................................................. 3
1.3 Field of application of the product.......................................................................... 3
1.3.1 Product changes .................................................................................... 3

2 Description.................................................................................................................................. 5
2.1 Structure................................................................................................................ 6

3 Installation ................................................................................................................................11
3.1 Safety regulations and installation notes ............................................................. 11
3.2 Mounting ............................................................................................................. 11
3.3 Data interfaces .................................................................................................... 13
3.3.1 Connecting the V.24 (RS-232) cable ................................................... 13
3.3.2 Connecting the RS-422 cable .............................................................. 14
3.3.3 Connecting the RS-485 cable .............................................................. 15
3.3.4 Connecting the Ethernet cable ............................................................. 15
3.4 Connecting the power supply .............................................................................. 16

4 Configuration and startup.......................................................................................................... 17


4.1 Default settings.................................................................................................... 17
4.2 Web-based management .................................................................................... 17
4.3 Login ................................................................................................................... 17
4.4 Home screen ....................................................................................................... 18
4.5 General settings .................................................................................................. 19
4.6 LAN settings ........................................................................................................ 20
4.6.1 IP address ............................................................................................ 20
4.6.2 Security ................................................................................................ 21
4.7 Serial settings ...................................................................................................... 22
4.7.1 Port configuration ................................................................................. 23
4.8 Modbus settings .................................................................................................. 27
4.8.1 Modbus TCP configuration .................................................................. 28
4.8.2 Remote Modbus addressing ................................................................ 29
4.8.3 TCP/IP connection ............................................................................... 30
4.8.4 Shared memory ................................................................................... 31
4.8.5 Device ID aliasing ................................................................................ 34
4.9 Diagnostics.......................................................................................................... 36
4.9.1 Modbus TCP ........................................................................................ 37
4.9.2 TCP Statistics ...................................................................................... 39

3762_en_C PHOENIX CONTACT 1/66


GW MODBUS TCP/RTU...

4.9.3 Modbus server devices ........................................................................ 40


4.9.4 Serial logs ............................................................................................ 42
4.9.5 Alias statistics ...................................................................................... 43
4.9.6 Write violations .................................................................................... 43
4.10 Maintenance........................................................................................................ 44
4.10.1 Passwords ........................................................................................... 44
4.10.2 Restore defaults ................................................................................... 45
4.10.3 Log files ............................................................................................... 46
4.10.4 Configuration files ................................................................................ 47
4.10.5 Update firmware .................................................................................. 47

5 Application examples................................................................................................................49
5.1 Serial Modbus RTU/ASCII server to Modbus TCP client ..................................... 49
5.2 Modbus TCP server to serial Modbus RTU/ASCII client...................................... 49
5.3 Modbus RTU/ASCII over TCP/IP using virtual COM port..................................... 50
5.3.1 COM port redirector software ............................................................... 50
5.4 Addressing Modbus RTU/ASCII devices with fixed IDs using device aliasing ..... 52
5.5 Modbus client-to-client communication using shared memory ............................ 52
5.6 Serial Modbus devices with the same device ID on a multiport GW MODBUS TCP/
RTU..................................................................................................................... 53
5.7 Limiting access to Modbus devices using private networks................................. 54

6 Troubleshooting........................................................................................................................ 55
6.1 Resetting the device ............................................................................................ 55
6.1.1 Hardware reset .................................................................................... 55
6.1.2 Software reset ...................................................................................... 55
6.2 LEDs.................................................................................................................... 55

A Appendixes...............................................................................................................................57
A1 List of figures ...................................................................................................... 57
A2 List of tables ....................................................................................................... 59
A3 Index................................................................................................................... 61

2/66 PHOENIX CONTACT 3762_en_C


1 For your safety
Read this user manual carefully and keep it for future reference.

1.1 Labeling of warning notes


This symbol indicates hazards that could lead to personal injury.
There are three signal words indicating the severity of a potential injury.
DANGER
Indicates a hazard with a high risk level. If this hazardous situation is not avoided,
it will result in death or serious injury.
WARNING
Indicates a hazard with a medium risk level. If this hazardous situation is not
avoided, it could result in death or serious injury.
CAUTION
Indicates a hazard with a low risk level. If this hazardous situation is not avoided,
it could result in minor or moderate injury.
This symbol together with the NOTE signal word warns the reader of actions that
might cause property damage or a malfunction.
Here you will find additional information or detailed sources of information.

1.2 Qualification of users


The use of products described in this manual is oriented exclusively to qualified application
programmers and software engineers. The users must be familiar with the relevant safety
concepts of automation technology as well as applicable standards and other regulations.

1.3 Field of application of the product

1.3.1 Product changes


Changes or modifications to hardware and software of the device are not permitted.
Incorrect operation or modifications to the device can endanger your safety or damage the
device. Do not repair the device yourself. If the device is defective, please contact
Phoenix Contact.

3762_en_C PHOENIX CONTACT 3/64


GW MODBUS TCP/RTU...

4/64 PHOENIX CONTACT 3762_en_C


Description

2 Description
The GW MODBUS TCP/RTU... devices provide enhanced connectivity from a wide variety
of Modbus® clients to a wide variety of Modbus servers, advanced client-to-client connec-
tivity, and connectivity from legacy Modbus serial networks to Modbus TCP networks. Sup-
ported Modbus clients include:
– Modbus TCP
– Modbus RTU
– Modbus ASCII
Supported Modbus servers include:
– Modbus TCP
– Modbus RTU serial
– Modbus ASCII serial
Connectivity is achieved between any client(s) and any server(s) anywhere on an Ethernet
network. Combined with a GW MODBUS TCP/RTU... device, both serial and Ethernet de-
vices can be accessed anywhere on a network from any Modbus client.
GW MODBUS TCP/RTU... devices are designed to greatly enhance system maintenance
capabilities, including comprehensive device and port-specific diagnostic web pages that
display status, message response timing, timeouts, other error counts, and overall message
statistics. A serial log provides message level diagnosis for serial devices.
The family consists of universal RS232/422/485 1-, 2-, and 4-port serial versions, with one
or two Ethernet ports to fit any application.
This user manual is valid for:

Table 2-1 GW MODBUS TCP/RTU... types

Type Description Order No.


GW MODBUS TCP/RTU 1E/1DB9 2702764
GW MODBUS TCP/RTU 1E/2DB9 2702765
GW MODBUS TCP/RTU 2E/2DB9 2702766
GW MODBUS TCP/RTU 2E/4DB9 2702767

3762_en_C PHOENIX CONTACT 5/64


GW MODBUS TCP/RTU...

2.1 Structure
GW MODBUS TCP/RTU 1E/1DB9
The GW MODBUS TCP/RTU 1E/1DB9 features one Ethernet port and one
RS-232/422/485 serial port with a D-SUB 9 connector.

Figure 2-1 GW MODBUS TCP/RTU 1E/1DB9

7
3
6
4
5

Table 2-2 GW MODBUS TCP/RTU 1E/1DB9 structure

Item Description
1 Power connector
2 P1 D-SUB 9 connector
3 Ethernet port (RJ45)
4 Status LED
5 Reset button
6 Ethernet activity status LED
7 Ethernet link status LED

6/64 PHOENIX CONTACT 3762_en_C


Description

GW MODBUS TCP/RTU 1E/2DB9


The GW MODBUS TCP/RTU 1E/2DB9 features one Ethernet port and two RS-232/422/485
serial ports with D-SUB 9 connectors.

Figure 2-2 GW MODBUS TCP/RTU 1E/2DB9

2
8

3
5

Table 2-3 GW MODBUS TCP/RTU 1E/2DB9 structure

Item Description
1 Power connector
2 P1 D-SUB 9 connector
3 Ethernet port (RJ45)
4 P2 D-SUB 9 connector
5 Status LED
6 Ethernet activity status LED
7 Ethernet link status LED
8 Reset button

3762_en_C PHOENIX CONTACT 7/64


GW MODBUS TCP/RTU...

GW MODBUS TCP/RTU 2E/2DB9


The GW MODBUS TCP/RTU 2E/2DB9 features two Ethernet ports with integrated switch
functionality and two RS-232/422/485 serial ports with D-SUB 9 connectors.

Figure 2-3 GW MODBUS TCP/RTU 2E/2DB9

11

10 3

4
9
5
8

Table 2-4 GW MODBUS TCP/RTU 2E/2DB9 structure

Item Description
1 Power connector
2 P1 D-SUB 9 connector
3 Ethernet link status LED
4 E2 Ethernet port (RJ45)
5 Ethernet activity status LED
6 P2 D-SUB 9 connector
7 Status LED
8 Ethernet activity status LED
9 E1 Ethernet port (RJ45)
10 Ethernet link status LED
11 Reset button

8/64 PHOENIX CONTACT 3762_en_C


Description

GW MODBUS TCP/RTU 2E/4DB9


The GW MODBUS TCP/RTU 2E/4DB9 features two Ethernet ports with integrated switch
functionality and four RS-232/422/485 serial ports with D-SUB 9 connectors.

Figure 2-4 GW MODBUS TCP/RTU 2E/4DB9

13
2
12

11 3

4
10
5
9

8 6

Table 2-5 GW MODBUS TCP/RTU 2E/4DB9 structure

Item Description
1 Power connector
2 P3 D-SUB 9 connector
3 Ethernet link status LED
4 E2 Ethernet port (RJ45)
5 Ethernet activity status LED
6 P4 D-SUB 9 connector
7 P2 D-SUB 9 connector
8 Status LED
9 Ethernet activity status LED
10 E1 Ethernet port (RJ45)
11 Ethernet link status LED
12 Reset button
13 P1 D-SUB 9 connector

3762_en_C PHOENIX CONTACT 9/64


GW MODBUS TCP/RTU...

10/64 PHOENIX CONTACT 3762_en_C


Installation

3 Installation

3.1 Safety regulations and installation notes


Installation, operation, and maintenance may be carried out only by qualified electricians.
Follow the specified installation instructions. The applicable specifications and safety direc-
tives (including the national safety directives), as well as the general technical regulations,
must be observed during installation and operation. The technical data should be taken
from the packaging instructions and the certificates (conformity assessment, other possible
approvals).
Opening the device or making changes to it is not permitted. Do not repair the device your-
self, but replace it with an equivalent device. Repairs may be carried out only by the manu-
facturer. The manufacturer is not liable for any damage caused by violation of the pre-
scribed regulations.
The IP20 degree of protection (EN 60529) of the device is intended for a clean and dry en-
vironment.
Do not subject the device to any load that exceeds the prescribed limits.
The device is not designed for use in environments with danger of dust explosions.

3.2 Mounting
To mount on the DIN rail:
1. Place the device onto the DIN rail from above (A), so that the upper housing keyway
hooks onto the top edge of the DIN rail.
2. Hold the device by the housing cover and carefully push the device toward the mount-
ing surface (B).
3. After the foot is snapped onto the DIN rail, verify that it is attached securely.

Figure 3-1 DIN rail mounting

3762_en_C PHOENIX CONTACT 11/64


GW MODBUS TCP/RTU...

To remove:
1. Use a suitable screwdriver to release the locking mechanism (A) on the snap-on foot of
the device.
2. Hold on to the device by the housing cover and carefully tilt it upward (B).
3. Remove the device from the DIN rail (C).

Figure 3-2 DIN rail removal

12/64 PHOENIX CONTACT 3762_en_C


Installation

3.3 Data interfaces

3.3.1 Connecting the V.24 (RS-232) cable


The D-SUB 9 connector may function as an RS-232, RS-422, or RS-485 interface. The
RS-232 interface is a data terminal equipment (DTE) device that behaves like a personal
computer (PC). A null modem cable or adapter is required to connect to a PC.
The V.24 (RS-232) interface of the GW MODBUS TCP/RTU... is a DTE assignment.

Connect the GW MODBUS TCP/RTU... to the V.24 (RS-232) device to be connected (for
example, a PC) by way of the PSM-KA-9SUB 9/BB/2 METER V.24 (RS-232) cable (Order
No. 2799474). The cable is an interface cable with 1:1 connected contacts.

Table 3-1 D-SUB 9 to RS-232 pin out

GW MODBUS TCP/RTU... End device


RS-232 D-SUB 9 D-SUB 9 D-SUB 25 D-SUB 25
(DCE) (DTE) (DCE) (DTE)
1 DCD 1 4 8 20
2 RxD 2 3 3 2
3 TxD 3 2 2 3
4 DTR 4 1, 6 20 6, 8
5 GND 5 5 7 7
6 DSR 6 4 6 20
7 RTS 7 8 4 5
8 CTS 8 7 5 4
9 RI 9 - 22 -

3762_en_C PHOENIX CONTACT 13/64


GW MODBUS TCP/RTU...

3.3.2 Connecting the RS-422 cable


Figure 3-3 Pin 1 location

In RS-422 mode, a point-to-point connection can be established. Use a twisted-pair, com-


mon shielded bus cable to connect the I/O device.
To connect the RS-422 cable:
1. Connect the individual conductors of the data cable to the GW MODBUS TCP/RTU...
using a SUBCON 9/F SH (Order No. 2761499).
2. Make sure the signal assignment is correct.
This operating mode supports full duplex transmission mode.

Table 3-2 D-SUB 9 to RS-422 and RS-485 pin out

GW MODBUS TCP/RTU... End device


RS-422 RS-485 RS-422 RS-485
2 T(A) – D(A) –
3 D(A) D(A) T(A) D(A)
5 GND GND GND GND
7 D(B) D(B) T(B) D(B)
8 T(B) – D(B) –

14/64 PHOENIX CONTACT 3762_en_C


Installation

3.3.3 Connecting the RS-485 cable


In RS-485 mode, an RS-485 network with several I/O devices can be created. Use a
twisted-pair, common shielded bus cable to connect the I/O devices.
Connect the individual conductors of the data cable to the GW MODBUS TCP/RTU... using
a SUBCON 9/F SH (Order No. 2761499) (see Table 3-2).
NOTE:
Observe the polarity of the RS-485 cable.
Fit this bus cable with a termination network at the two furthest points of the RS-485
network.
The termination resistors are integrated in the GW MODBUS TCP/RTU... and can be
switched on through the web-based management interface.

3.3.4 Connecting the Ethernet cable


The GW MODBUS TCP/RTU... has an Ethernet interface on the front in RJ45 format, to
which only twisted-pair cables with an impedance of 100 Ω can be connected. The data
transmission rate is either 10 or 100 Mbps. The GW MODBUS TCP/RTU... supports the
auto negotiation function for automatic selection of the transmission speed, as well as an
automatic crossover feature for the selection of line or crossover cabling.
Push the Ethernet cable with the crimped RJ45 connector into the
GW MODBUS TCP/RTU... until it engages with a click.

3.3.4.1 Models with two Ethernet ports


When using two Ethernet ports, the GW MODBUS TCP/RTU... is classified as a switch.
When using only one port, it is a simple end node device. The maximum number of daisy-
chained GW MODBUS TCP/RTU... units, and the maximum distance between units, is
based on the Ethernet standards, and is determined by the environment and conformity of
the network to these standards. There may be some performance degradation on the de-
vices at the end of the chain, so it is recommended to overload and test for performance in
the environment. The application may also limit the total number of ports that may be in-
stalled. Some basic guidelines are listed below.
– Ethernet 10BASE-T rules
– The maximum number of repeater segments is four.
– Use Category 3 or 5 twisted-pair 10BASE-T cables. The maximum length of each
cable is 100 m (328 ft.).
– Fast Ethernet 100BASE-TX rules
– The maximum number of repeater segments is two (for a Class II hub). A Class II
hub can be connected directly to one other Class II Fast Ethernet hub. A Class I hub
cannot be connected directly to another Fast Ethernet hub.
– Category 5 twisted-pair cable must be used. The maximum length of each twisted-
pair cable is 100 m (328 ft.).
– The total length of twisted-pair cabling (across directly connected hubs) must not
exceed 205 m (672 ft.).
– IEEE 802.3 specification: A network using repeaters between communicating stations
(PCs) is subject to the 5-4-3 rule of repeater placement on the network:
– The maximum number of segments connected on a network is five.
– Four repeaters is the maximum that can be applied to a network.
– Only three segments can have user connections. The other two segments must act
as repeaters with no user connections.

3762_en_C PHOENIX CONTACT 15/64


GW MODBUS TCP/RTU...

3.4 Connecting the power supply


CAUTION:
Incorrect connection may result in damage to equipment and/or serious personal in-
jury.
Only qualified personnel may connect the power, start up, and operate this device.
According to the safety instructions in this text, qualified personnel are persons who
are authorized to start up, to ground, and to mark devices, systems, and equipment
according to the standards of safety technology. In addition, these persons must be
familiar with all warning instructions and maintenance measures in this text.
Disregarding this warning may result in damage to equipment and/or serious personal
injury.
The device can be connected to a single power source or two power sources for redun-
dancy. The GW MODBUS TCP/RTU... is powered using a +24 V DC SELV power supply.
The power supply is connected by way of COMBICON plug-in screw terminal blocks (24 V
and 0 V).

Figure 3-4 Single power supply connection

Figure 3-5 Redundant power supply connection

16/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

4 Configuration and startup

4.1 Default settings


The default network settings of the GW MODBUS TCP/RTU... are:
IP address: 192.168.254.254
Subnet mask: 255.255.255.0
Gateway: 0.0.0.0
The default settings are invoked whenever the system is reset.

4.2 Web-based management


The user-friendly, web-based management interface, a graphical user interface (GUI), can
be used to manage the GW MODBUS TCP/RTU... from anywhere in the network using a
standard browser. Comprehensive configuration and diagnostic functions, including a wide
range of information about the device itself, the current parameters, and the operating state,
are clearly displayed.

4.3 Login
To log in:
1. 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.
2. Open a web browser and enter the IP address of the GW MODBUS TCP/RTU... in the
“Address” field (default = 192.168.254.254).

Figure 4-1 “Login” screen

The web server responds immediately.


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 es-
tablish communication.

3. Enter the credentials to access the web server configuration pages. The default cre-
dentials are:

3762_en_C PHOENIX CONTACT 17/64


GW MODBUS TCP/RTU...

User name: Admin


Default password: admin
Powering multiple devices with factory default IP addresses causes a network conflict,
and incorrect parameters may be set in the GW MODBUS TCP/RTU... modules.
When programming modules for the first time, it is important to apply power to only
one at a time, and change the IP address of each module to a unique IP address.
Once all devices have a unique IP address, they can be powered on together while on
the same network.

4.4 Home screen


Immediately after login, the “Home” screen is displayed. From the “Home” screen, the basic
settings of the GW MODBUS TCP/RTU... can be immediately configured by clicking on the
appropriate Ethernet port or serial port in the diagram of the module.

Figure 4-2 “Home” screen

Advanced settings can be accessed through the menu at the top of the screen. The “Home”
screen can be accessed at any time by clicking the “Home” button in the upper-left corner
of the web-based management interface.

18/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

4.5 General settings


To view and edit general settings:

Figure 4-3 Click the “General Settings” tab to view and edit general information about
the GW MODBUS TCP/RTU.... “General Settings” page

4. View the listed information.


5. If desired, change the listed information.
The “Device Identification” group provides fields for entering descriptive information
about individual devices.
Device Name: Enter a name for the device. The field accepts up to 16 characters.
Contact: Enter the name of a contact person, group, or department responsible for this
device. The field accepts up to 16 characters.
6. Click the “Apply Changes” button to save the configuration.

3762_en_C PHOENIX CONTACT 19/64


GW MODBUS TCP/RTU...

4.6 LAN settings

4.6.1 IP address
To enter the IP address:
1. From the “LAN Settings” page, click the “IP Address” tab to access the “IP Address”
page.

Figure 4-4 “LAN Settings/IP Address” page

2. Select the method for assigning the LAN IP address.


If a DHCP server assigns IP addresses, click the “Automatic address assignment
(DHCP)” button.
If using static IP addresses, click the “Manual address assignment” button and enter the
appropriate information in the various fields.
MAC Address: The MAC address of the GW MODBUS TCP/RTU... is displayed.
3. Click the “Apply Changes” button to save the configuration.

20/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

4.6.2 Security
The GW MODBUS TCP/RTU... includes several security options for data encryption and
device authentication. It is possible to configure the GW MODBUS TCP/RTU.... so that only
authorized client applications can connect using SSL/TLS. For secure operation, the
GW MODBUS TCP/RTU... uses a set of four keys and certificates. These keys and certifi-
cates are configurable.
To configure security settings:

Figure 4-5 From the “LAN Settings” page, click the “Security” tab.“LAN Settings/Secu-
rity” page

4. Configure the GW MODBUS TCP/RTU... so that only authorized client applications can
connect using SSL/TLS.
For secure operation, the GW MODBUS TCP/RTU... uses a set of four keys and certif-
icates. These keys and certificates may be configured.
RSA Key pair used by SSL and SSH servers: This is a private/public key pair that is
used for two purposes:
– It is used by some cipher suites to encrypt the SSL/TLS handshaking messages.
Possession of the private portion of this key pair allows an eavesdropper to decrypt
traffic on SSL/TLS connections that use RSA encryption during handshaking.
– It is used to sign the RSA server certificate in order to verify that the
GW MODBUS TCP/RTU... is authorized to use the RSA server identity certificate.
Possession of the private portion of this key pair allows others to pose as the
GW MODBUS TCP/RTU....

If the RSA server key is to be replaced, a corresponding RSA identity certificate must
also be generated and uploaded, or clients cannot verify the identity certificate.
RSA Server Certificate used by SSL servers: This is the RSA identity certificate that
the GW MODBUS TCP/RTU... uses during SSL/TLS handshaking to identify itself. It is
used most frequently by SSL server code in the GW MODBUS TCP/RTU... when cli-
ents open connections to the GW MODBUS TCP/RTU... secure web server or other
secure TCP ports. If a GW MODBUS TCP/RTU... serial port configuration is set up to
open (as a client) a TCP connection to another server device, the
GW MODBUS TCP/RTU... also uses this certificate to identify itself as an SSL client if
requested by the server.
In order to function properly, this certificate must be signed using the RSA server key.
This means that the RSA server certificate and RSA server key must be replaced as a
pair.
DH Key pair used by SSL servers: This is a private/public key pair that is used by
some cipher suites to encrypt the SSL/TLS handshaking messages.

3762_en_C PHOENIX CONTACT 21/64


GW MODBUS TCP/RTU...

Possession of the private portion of the key pair allows an eavesdropper to decrypt
traffic on SSL/TLS connections that use DH encryption during handshaking.

The key or certificate notation changes from factory or none to user when the
GW MODBUS TCP/RTU... is secure.
Certificates and keys to be uploaded to the GW MODBUS TCP/RTU... must be in the
.DER binary file format, not in the .PEM ASCII file format. (The openssl tools can cre-
ate files in either format and can convert files back and forth between the two formats.)

4.7 Serial settings


To configure serial settings:
1. Click the “Serial Settings” tab to configure the serial port(s).
The “Overview” page provides a quick summary of the current configuration of the serial
port(s).
2. Click the appropriate configuration tab to edit the configuration of that port.

Figure 4-6 “Serial Settings/Overview” page

22/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

4.7.1 Port configuration


Figure 4-7 “Serial Settings/Port 1 Configuration” page

4.7.1.1 Serial port configuration


To configure serial ports:
1. From the “Serial Settings” page, click the “Port Configuration” tab.
2. In the “Serial Port Configuration” group, specify the settings of each serial port to match
the connected serial device.

Figure 4-8 “Serial Port Configuration” page

Port Name: Enter a label for the port. This could correspond to the connected device,
“Shipping Label” for example, for easy identification.
Port Mode: Select the port operating mode. Available settings are RS-232, RS-422,
RS-485 2-wire, RS-485 4-wire (M), and RS-485 4-wire (S), where “M” indicates client
and “S” indicates server. When RS-485 4-wire (M) is selected, the RS-485 transmitter
is always enabled on the GW MODBUS TCP/RTU.... When RS-485 4-wire (S) is se-
lected, the RS-485 transmitter is enabled only when the GW MODBUS TCP/RTU... has
data to send. This is important when a four-wire RS-485 multidrop network is installed.
Baud rate: Select the baud rate of the serial port; 300, 600, 1200, 2400, 4800, 9600,
19200, 38400, 57600, 115200, and 230400 bps are supported.

3762_en_C PHOENIX CONTACT 23/64


GW MODBUS TCP/RTU...

Parity: Select odd, even, mark, space, or none.


Data Bits: Select 5, 6, 7, or 8 data bits.
Stop Bits: Select 1 or 2 stop bits.
Flow Control: Available options for RS-232 flow control are hardware RTS/CTS, soft-
ware Xon/Xoff, half duplex, and none.
RS-485 Terminating Resistor: The terminating resistor is used only in RS-485 net-
works. If the GW MODBUS TCP/RTU... is the last device in the RS-485 network, en-
able the terminating resistor.
DTR Mode: Select on all the time or off all the time when a connection is established
on this port.
Rx timeout between packets: This is the maximum spacing between received bytes
allowed before the received Modbus serial message is expected to be complete. The
default value is 200 ms.
Discard packets with errors: If enabled, all packets with parity, framing, or overrun
errors are dropped.

4.7.1.2 Modbus configuration


To configure serial ports:
1. From the “Serial Settings” page, click the “Port Configuration” tab.
2. In the “Modbus Configuration” group, specify Modbus settings.

Figure 4-9 “Modbus Configuration” page

Serial Device: Select the type of serial Modbus device(s) that is connected to this port.
– Modbus RTU Slaves configures the serial port to communicate to Modbus RTU
servers.
– Modbus ASCII Slaves configures the serial port to communicate to Modbus AS-
CII servers.
– Modbus RTU Master configures the serial port to communicate to a Modbus RTU
client.
– Modbus ASCII Master configures the serial port to communicate to a Modbus AS-
CII client.
– Modbus RTU Master/Slaves configures the serial port to communicate to servers
on its own private serial bus as well as public servers on a Modbus network. In this
configuration, a serial client can communicate to:
– Modbus ASCII Master/Slaves configures the serial port to communicate to a se-
rial bus with a Modbus ASCII client and Modbus ASCII servers. In this configura-
tion, a serial client can communicate to:

24/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

a) A serial Modbus client can communicate to servers on it’s own private serial bus,
as well as public servers on a Modbus network. In this configuration a serial client
can communicate to:
– Modbus RTU/ASCII server(s) on its own serial bus.
– Public Modbus RTU/ASCII serial server(s) connected to the same
GWGW MODBUS TCP/RTU... .
– Modbus TCP servers.
– Remote public Modbus RTU/ASCII serial server(s) via an Ethernet connection to
another GW MODBUS TCP/RTU... gateway.
– All other Modbus client(s) on the Modbus network via the Shared Memory function-
ality.
b) The Modbus servers on the serial bus are private to the client on that serial bus.
– The server device(s) are effectively protected from all other Modbus clients on the
Modbus network.
– The client has total control of communication to the servers on its own serial bus.
– The client can provide data to/from the server(s) to the Modbus network and other
Modbus clients, via the Shared Memory functionality.
Response timeout: This is to maximum allowable time for a server device to respond
to a message before the message is considered timed out. The default is 1000 ms.
Inactivity wait time before Tx: This is the minimum time that the GW MODBUS
TCP/RTU… waits after receiving a response or transmitting a Modbus request before
transmitting the next request. The default is 0 ms.
Lost device search enable: If multiple routes are available and a Modbus server times
out, the GW MODBUS TCP/RTU... will search ports with this feature enabled in an ef-
fort to find communication from the server device.
Timeout delays can be caused when the “Lost device” search feature is enabled.

Send write messages first: When enabled, any write messages are sent before
transmitting any read messages that may have already been queued for transmission.
Write Mode: This configures the ability to write messages on the server. Select Read
Only to prevent devices from writing messages and select Read/Write to allow all
Modbus messages to be sent to the server.
Device ID offset mode: The “Device ID Offset” functionality allows modification of de-
vice IDs when messages are transmitted to serial Modbus server devices. When con-
figured, the “Device ID Offset” functionality modifies the device ID received in the mes-
sage to match the actual device ID range of the serial device(s). The device ID range is
effectively either increased or decreased depending on the serial port device ID offset
configuration. Select Add to message ID to add the device offset to the message de-
vice ID. Select Subtract from message ID to subtract the device ID offset from the
message device ID. Select Off to disable this functionality.
Device ID offset: Enter a value from 0 to 254. This value is added to, or subtracted
from, the device ID of the Modbus message before it is transmitted out of the serial port.

3762_en_C PHOENIX CONTACT 25/64


GW MODBUS TCP/RTU...

The following table demonstrates several device ID offset examples:


Table 4-1 Device ID offset examples

Device ID offset Device ID Valid device ID Offset ID range Description


mode offset range
Off 0 1…255 1…255 Default mode. Device IDs are unchanged.
Add to message ID 50 1…205 51…255 Increase device ID range by 50. Examples:
Device ID 1 is converted to 51; Device ID
10 is converted to 60; Device ID 120 is con-
verted to 170.
Subtract from mes- 100 101…255 1…155 Decrease device ID range by 100. Exam-
sage ID ples: Device ID 101 is converted to 1; De-
vice ID 150 is converted to 50; Device ID
225 is converted to 125.

Use caution when configuring the “Device ID Offset” functionality. Verify the following
when configuring the device ID offset:
– Check for device ID overlaps. Be certain that no two devices have same device ID.
– Check for conflicts with the alias device ID configuration. The device ID offset con-
figuration must coincide with any alias device ID configurations.
– Verify that the valid device ID ranges are sufficient to address all serial devices.
Forward broadcasts from serial master: When enabled, all broadcast messages
from the serial client are forwarded to the Modbus TCP network.
Modbus Exception Responses: The GW MODBUS TCP/RTU... serves as a Modbus
gateway and has the ability to respond to Modbus messages addressed to devices not
present on the network with an exception code. The Modbus Exception Responses set-
ting allows the user to configure this behavior.
a) Enable all sends exception responses from server devices not present on the net-
work and server devices connected to the network.
b) Disable all prevents the GW MODBUS TCP/RTU... from sending exception re-
sponses to messages addressed to server devices not present on the network and
server devices connected to the network.
c) Disable gateway prevents the GW MODBUS TCP/RTU... from sending exception
responses to messages addressed to server devices not present on the network.
d) Disable slaves prevents the GW MODBUS TCP/RTU... from sending exception
responses from server devices connected to the network.
Private slave device ID range: On a serial port configured to Modbus RTU Mas-
ter/Slaves, only the client on the private serial bus has access to the serial servers on
that serial bus. However, the client can also communicate to public devices and shared
memory anywhere on the Modbus network. This range defines the expected server de-
vice ID range on the serial bus. Modbus request messages received on this port within
this device ID range are not forwarded to the Modbus network, and all communication
to device(s) in that range must occur between the Modbus client and server(s) on that
serial bus.
Using this feature, a serial Modbus client can communicate to servers on its own private
serial bus as well as public servers on a Modbus network. The Modbus servers on the
serial bus are private to the client on that serial bus, and the server device(s) are effec-
tively protected from all other Modbus clients on the Modbus network.
Enter a value from 1 to 255 in the “min” and “max” fields.
The GW MODBUS TCP/RTU... has a built-in auto-detect algorithm for detecting pri-
vate server device(s) with ID(s) not defined within the private device ID range.

26/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

4.8 Modbus settings


To configure Modbus settings:
1. Click the “Modbus Settings” tab to configure the Modbus settings.
The “Overview” page provides a quick summary of the current configuration of the serial
port(s).
2. Click the appropriate configuration tab to edit the Modbus configuration.

Figure 4-10 “Modbus Settings” page

The “Modbus Overview” page provides a brief explanation of each configuration page.

3762_en_C PHOENIX CONTACT 27/64


GW MODBUS TCP/RTU...

4.8.1 Modbus TCP configuration


The “Modbus TCP Configuration” page allows specification of TCP port numbers that the
GW MODBUS TCP/RTU... uses for Modbus TCP communication.
To enter Modbus TCP configuration information:
1. From the “Modbus Settings” page, click the “Modbus TCP” tab.
2. In the “Modbus TCP Configuration” group, specify Modbus TCP settings.

Figure 4-11 “Modbus TCP” page

3. Enter a TCP Port number.


4. Check the box to enable listening on that port.
The default TCP Port for the Modbus TCP protocol is 502.
Modbus Exception Responses: The GW MODBUS TCP/RTU... serves as a Modbus
gateway and has the ability to respond to Modbus messages addressed to devices not
present on the network with an exception code. The Modbus Exception Responses set-
ting allows the user to configure this behavior.
Enable all sends exception responses from server devices not present on the network
and server devices connected to the network.
Disable all prevents the GW MODBUS TCP/RTU from sending exception responses
to messages addressed to server devices not present on the network and server de-
vices connected to the network.
Disable gateway prevents the GW MODBUS TCP/RTU from sending exception re-
sponses to messages addressed to server devices not present on the network.
Disable slaves prevents the GW MODBUS TCP/RTU from sending exception re-
sponses from server devices connected to the network.

28/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

4.8.2 Remote Modbus addressing


The “Remote Modbus addressing” feature allows the GW MODBUS TCP/RTU... to connect
a serial Modbus RTU/ASCII client to Modbus TCP servers, or to Modbus RTU/ASCII serv-
ers connected to other GW MODBUS TCP/RTU... devices.
To add a remote Modbus device to the table:
1. From the “Modbus Settings” page, click the “Remote Modbus” tab.
2. In the “Remote Modbus Addressing” group, specify settings.

Figure 4-12 “Remote Modbus” page

3. Click the “Add” button. A new row is added to the table.


4. Enter information in the fields provided.
Device ID: Enter the Device ID the controller will use to address the remote Modbus
TCP server. The range is 1 to 255.
Remote IP Address: Enter the IP address of the remote Modbus TCP device in stan-
dard AAA.BBB.CCC.DDD format.
Remote TCP Port: Enter the TCP port to connect to on the remote device. The default
Modbus TCP port is 502.
Timeout: Enter the maximum time period from 1 to 65535 ms that a remote device
should respond to a message. The default value is 1000 ms.
Enable Substitute Device ID: A Substitute Device ID may be helpful when connecting
to multiple remote devices with the same device ID. When Substitute Device ID is en-
abled, the GW MODBUS TCP/RTU... gateway replaces the Device ID received from
the Modbus client and uses the Substitute Device ID when communicating with the re-
mote Modbus TCP server. Use in conjunction with the Substitute Device ID.
Substitute Device ID: Enter the device ID of the Modbus TCP server. This field is only
used when Substitute Device ID is enabled.
Dedicated Connection: If selected, a dedicated Modbus TCP connection is used to
connect to this remote device.
This is most commonly used when connecting to another gateway, multiple devices
are being accessed, and maximum bandwidth is desired.

Send Writes First: If selected, the GW MODBUS TCP/RTU... forward writes mes-
sages before forwarding any pending read messages.
This is most commonly used when multiple messages may be queued for the remote
device(s) and low latency for write messages is desired.

3762_en_C PHOENIX CONTACT 29/64


GW MODBUS TCP/RTU...

Disable broadcast messages: If selected, the GW MODBUS TCP/RTU... disables


broadcasts to this remote device.
Route on pre-alias device ID: This setting only applies to a Modbus message if the
Modbus message device ID has been aliased, or changed, as a result of a correspond-
ing device ID alias configuration (see Section 4.8.5, “Device ID aliasing”), and a remote
Modbus addressing configuration exists for the pre-aliased, or original, device ID. In
this case, the remote Modbus addressing configuration for the pre-aliased device ID is
applied to the Modbus message.
5. After entering the parameters, click the “Apply Changes” button to save the configura-
tion.
The fields may be edited at any time. Be sure to click the “Apply Changes” button to
save the modifications.
6. To delete an entry, click the “Delete Entry” check box next to the row to remove, and
then click the “Apply Changes” button.
7. To delete the entire table, check the “Delete all entries” box, and then click the “Apply
Changes” button.

4.8.3 TCP/IP connection


The “TCP/IP Connection” feature is for applications that require Modbus ASCII or RTU pro-
tocols to be encapsulated in an Ethernet TCP/IP frame, but not converted to Modbus TCP.
For example, this can be used with the “COM port redirector” software to create a virtual
COM port for a Modbus application on a PC.
The number of Ethernet TCP/IP connections supported by the GW MODBUS TCP/RTU...
is equal to the number of serial ports on the device, but the TCP/IP connections are not di-
rectly linked to a particular serial port. Each TCP/IP connection provides connectivity to ei-
ther Modbus RTU or Modbus ASCII clients. Messages received on all Ethernet TCP/IP con-
figurations are routed to all local and remote Modbus server devices.
To add a remote Modbus device to the table:
1. From the “Modbus Settings” page, click the “TCP/IP Connection” tab.
2. In the “TCP Interface Connection” group, specify the Modbus TCP settings.

Figure 4-13 “TCP/IP Connection” page

3. Enter information in the fields provided.


Enable: This must be enabled to use the port as a socket connection.

30/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

Application is a: This selection configures the TCP/IP connection to communicate


with a Modbus RTU or a Modbus ASCII client.
Listen: Check the “Listen” check box so that the GW MODBUS TCP/RTU... listens for
incoming TCP/IP socket connections on the port number specified in the “Listen Port”
field.
On port: Enter the TCP port number on which the GW MODBUS TCP/RTU... listens for
connections. Up to six connections from external applications are supported.
The Modbus TCP port 502 cannot be used.

Connect: Determines how to connect to an application. If Never is selected, the


GW MODBUS TCP/RTU... does not attempt to make a connection. If Always is se-
lected, the GW MODBUS TCP/RTU... maintains a permanent connection to the device
specified by the “Connected to IP address” and “Connect to port” fields.
Connect to port: Enter a TCP port number to which the GW MODBUS TCP/RTU... ini-
tiates a connection.
Connect to IP address: Enter an IP address to which the GW MODBUS TCP/RTU...
initiates a connection. Use the standard AAA.BBB.CCC.DDD format.
Disconnect: This field determines how the GW MODBUS TCP/RTU... should discon-
nect from the application. Select Never to maintain the connection when there is no
data. Select Idle to close the connection after a period of inactivity specified by the “Idle
timeout” field.
Idle timeout: The Idle Timeout is the number of milliseconds before a disconnect oc-
curs if the Disconnect Idle option is selected.
Rx timeout between packets: This determines the receive timeout between packets,
in msec. This is the maximum spacing between received bytes allowed before the re-
ceived Modbus message is expected to be complete. The range is 0 to 65565 ms.
4. After entering the parameters, click the “Apply Changes” button to save the configura-
tion.
The fields may be edited at any time. Be sure to click the “Apply Changes” button to
save the modifications.
Modbus Exception Responses: The GW MODBUS TCP/RTU… serves as a Modbus
gateway and has the ability to respond to Modbus messages addressed to devices not
present on the network with an exception code. The Modbus Exception Responses set-
ting allows the user to configure this behavior.
Enable all sends exception responses from server devices not present on the network
and server devices connected to the network.
Disable all prevents the GW MODBUS TCP/RTU… from sending exception re-
sponses to messages addressed to server devices not present on the network and
server devices connected to the network.
Disable gateway prevents the GW MODBUS TCP/RTU… from sending exception re-
sponses to messages addressed to server devices not present on the network.
Disable slaves prevents the GW MODBUS TCP/RTU… from sending exception re-
sponses from server devices connected to the network.

4.8.4 Shared memory


The “Shared Memory” feature provides a simple and robust method for Modbus client-to-
client communication. In this case, the GW MODBUS TCP/RTU... emulates a Modbus
server, and each Modbus client can read or write to the “shared” memory in order to ex-
change data. Any Modbus client (Modbus TCP, serial Modbus RTU/ASCII, and Modbus
RTU/ASCII over Ethernet TCP/IP) can access the shared memory.

3762_en_C PHOENIX CONTACT 31/64


GW MODBUS TCP/RTU...

The “Shared Memory” interface contains eight blocks of 200 holding registers and eight
blocks of 160 coils. Write access can be controlled to each holding register block and coil
block. Each block can be configured to provide all clients write access or be restricted to a
port-specific serial client, a Modbus TCP client, or an Ethernet TCP/IP client.
The “Shared Memory” contents can be displayed and cleared by way of the
GW MODBUS TCP/RTU... web server, and diagnostics for each block include read, write,
and blocked write message counts. Blocked write messages are recorded in the “Write Vi-
olation” log.
The following Modbus function codes are supported:
Table 4-2 Modbus function codes

Function code Description


01 Read coils
03 Read holding registers
05 Write single coil
06 Write single register
15 Write multiple coils
16 Write multiple registers
22 Write mask register
23 Read write registers

Figure 4-14 “Shared Memory Configuration” page

To configure the Shared Memory:


1. From the “Modbus Settings” page, click the “Shared memory” tab.
2. In the “Shared Memory Configuration” group, specify settings.
3. Enter information in the fields provided.
Enable Shared Memory: If selected, enables the “Shared Memory” functionality.

32/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

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.
Holding Register Start Address (Base 1): Enter the starting address of the
GW MODBUS TCP/RTU... holding registers. The valid range is 400001 to 463935.
The holding registers are broken up into eight blocks of 200 holding registers in the
memory of the GW MODBUS TCP/RTU.... The Modbus register address range for
each block is listed next to the block number.
Coil Block Start Address (Base 1): Enter the starting address of the
GW MODBUS TCP/RTU... coils. The valid range is 1 to 64255.
The coils are broken up into eight blocks of 160 coils in the memory of the
GW MODBUS TCP/RTU.... The Modbus register address range for each block is listed
next to the block number
Accept Broadcast Messages: If selected, the Shared Memory block(s) accepts
broadcast messages addressed to their memory block(s).
Write Master(s): This selection determines which Modbus clients have write access
to the shared memory block. Select All to allow all clients to have write access to the
block. Select a Serial Port to allow only serial Modbus clients connected to the specific
serial port to have write access. Select Modbus TCP or Ethernet TCP/IP to allow cli-
ents at a specific IP address to have write access. The IP address of the client must be
entered in the “Select Port/IP Address” field.
Serial Port/IP Address: If write access is limited to a specific Modbus client, enter the
serial port or the IP address of the Modbus client.
Description: Each block may be labeled with a description, for example, ‘Compressor
Station #1’ for simple identification of the registers.
4. Click the “Display” button next to each “Shared Holding Registers” block to view the
contents of the Modbus registers.
5. Click the “Display” button next to each block to view the contents of the Modbus coils.

Figure 4-15 “Shared Coils” page

6. After entering the parameters, click the “Apply Changes” button to save the configura-
tion.
The fields may be edited at any time. Be sure to click the “Apply Changes” button to
save the modifications.

3762_en_C PHOENIX CONTACT 33/64


GW MODBUS TCP/RTU...

Figure 4-16 “Holding Registers” page

4.8.5 Device ID aliasing


Many Modbus devices have fixed device IDs that can cause problems when multiple de-
vices are connected to a single network. The “Device ID Alias” functionality allows masking
Modbus device IDs to simulate unique devices on the network.
When configured, a Modbus client sends a command and receives responses using the Rx
Device ID. Internally, the command is routed to the device ID alias using the “Device ID
Alias” table. The following table demonstrates several device ID aliasing examples:

Table 4-3 Device ID alias examples

Rx device ID Device ID Routed mes- Description


alias sage device
ID
1 10 10 Convert messages with received de-
vice ID 1 to 10. Route message with
device ID 10.
50 5 5 Convert messages with received de-
vice ID 50 to 5. Route message with
device ID 5.
100 254 254 Convert messages with received de-
vice ID 100 to 254. Route message
with device ID 254.
10 10 10 Invalid configuration attempt. No
change to device ID is performed.

34/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

Figure 4-17 “Device ID Alias” page

To add a device ID aliasing rule to the table:


1. From the “Modbus Settings” page, click the “Devices Alias ID” tab.
2. In the “Device ID Alias” group, specify settings the settings.
Rx Device ID: Enter the device ID received from the Modbus client.
Alias Device ID: Enter the device ID that the GW MODBUS TCP/RTU... addresses.
This is the “artificial” ID of the Modbus server.
Modbus TCP Master: If selected, this applies the alias configuration to messages re-
ceived from Modbus TCP clients.
Serial Modbus Master: If selected, this applies the alias configuration to messages re-
ceived from serial Modbus clients.
TCP/IP Master: If selected, this applies the alias configuration to messages received
from Modbus RTU/ASCII over Ethernet TCP/IP clients.
The number of alias conversions performed by the GW MODBUS TCP/RTU… is avail-
able for each rule, and indicates which type of client originated the Modbus message.
After entering the parameters, click the “Apply Changes” button to save the configura-
tion.
3. To delete an entry, check the “Delete Entry” box next to the rule to remove it, and then
click the “Apply Changes” button.
4. To delete the entire table, check the “Delete all” box, and then click the “Apply Changes”
button.

3762_en_C PHOENIX CONTACT 35/64


GW MODBUS TCP/RTU...

4.9 Diagnostics
A variety of packet statistics can be used to diagnose a configuration or application problem.
To view any diagnostics data:
1. Click the “Diagnostics” tab to view a variety of packet statistics that can be used to di-
agnose a configuration or application problem.

Figure 4-18 “Diagnostics Serial Statistics” page

2. Click the “Serial Statistics” tab.


The “Communication Statistics” page provides an overview of the activity on each serial
port and TCP socket connection. The values can be reset to zero at any time by clicking
the “Reset Statistics” button.
3. View the “Serial Port Statistics” group.
TX Byte Count (To Device): This displays the number of bytes transmitted out the se-
rial port.
TX Message/Response Count: This displays the number of messages or responses
transmitted out the serial port.
RX Byte Count (From Device): This displays the number of bytes received on the se-
rial port.
RX Message/Response Count: This displays the number of messages or responses
received on the serial port.
TX or RX Broadcast Msg Count: This displays the number of broadcast messages
transmitted out the serial port.
Master/Slaves Private Messages: This displays the number of private messages de-
tected, those between a client and private server(s), on a serial port configured in Mas-
ter/Slaves mode.
Parity Error Count: This displays the number of parity errors received on the serial
port. Typically occurs due to an incorrect parity setting.
Framing Error Count: This displays the number of framing errors received on the se-
rial port. Typically occurs due to an incorrect baud rate or stop bit setting.
Overrun Error Count: This displays the number of overrun errors received on the se-
rial port. This typically occurs due to one of the following events: incorrect flow control,
incorrect baud rate, incorrect data size, or incorrect stop bit setting.

36/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

Dropped Message/Response Count: This displays the number of messages or re-


sponses dropped due to either an incomplete message or response, or if the
GW MODBUS TCP/RTU... did not receive valid start and/or end characters (Mod-
bus/ASCII only).
Invalid Message/Response Count: This displays the number of invalid messages or
responses received because either the message was received after the timeout period
(this may require increasing the device response timeout), an incorrect device ID was
detected in the response message, or there was an incorrect function code in the re-
sponse message.
Device Timeouts: This displays the number of device timeouts that occurred when
there was no response for a Modbus message.
Blocked Write Messages: This displays the number of Modbus write messages that
were not transmitted as a result of the “Write Mode” option being set to Read Only (see
“Modbus configuration” on page 24).
4. If desired, click the “Reset Statistics” button to refresh the statistics shown.

4.9.1 Modbus TCP


The “Modbus TCP Statistics” page displays information specific to the Modbus TCP com-
munication on TCP port 502.
To view Modbus TCP statistics:
1. Click the “Diagnostics” tab.
2. Click the “Modbus TCP” tab.

Figure 4-19 “Modbus TCP” page

Slave Mode Specific Sta- Active Modbus TCP Slave Connections: This displays the current number of active
tistics Modbus TCP server connections initiated by a controller.
Modbus TCP Slave Connections Opened: This displays the total number of Modbus
TCP server connections that have been opened.
Modbus TCP Slave Connections Closed: This displays the total number of Modbus
TCP server connections that have been closed.

3762_en_C PHOENIX CONTACT 37/64


GW MODBUS TCP/RTU...

Messages Received From Modbus TCP Master(s): This displays the total number
of Modbus TCP messages received from Modbus TCP client(s).
Responses Sent To TCP Master(s): This displays the total number of Modbus TCP
responses sent to Modbus TCP client(s).
Modbus Broadcasts Received From Modbus TCP Master: This displays the num-
ber of Modbus broadcast messages received from Modbus TCP clients.
Invalid Command Lengths: This displays the number of messages received with in-
valid command lengths.
Invalid Message Data Errors: This displays the number of messages received with
invalid message data errors. These errors occur when the GW MODBUS TCP/RTU...
receives a message that cannot be processed due to improper message data.
Invalid Request Protocol Types: This displays the number of messages received
with invalid protocol errors. This occurs when a message is received with a protocol
other than the Modbus TCP protocol value of zero.

Master Mode Specific Sta- Active Modbus TCP Master Connections: This displays the current number of active
tistics Modbus TCP client connections initiated by the GW MODBUS TCP/RTU... to a Mod-
bus TCP server.
Modbus TCP Master Connections Opened: This displays the total number of Mod-
bus TCP client connections that have been opened.
Modbus TCP Master Connections Closed: This displays the total number of Mod-
bus TCP client connections that have been closed.
Messages Sent To Modbus TCP Slave(s): This displays the total number of Modbus
messages sent to remote Modbus TCP servers.
Responses Received From Modbus TCP Slave(s): This displays the total number
of Modbus responses received from the Modbus TCP servers.
Invalid Response Data Errors From Modbus TCP Slave(s): This displays the num-
ber of response data errors to polling requests returned from the Modbus TCP servers.
Possible causes include an incorrect transaction ID, message command length, or de-
vice ID in response.
Remote Modbus TCP Device Timeouts: This displays the number of messages to
remote devices that were determined to have timed out by the
GW MODBUS TCP/RTU...
Unexpected Responses From Modbus TCP Slave(s): This displays the number of
responses received when no response was expected.
Error Responses From Modbus TCP Slave(s): This displays the number of re-
sponses received from Modbus TCP servers with errors indicated. This may be caused
by device timeouts detected by a server Modbus TCP device, an invalid device ad-
dress, device ID, or message data.
Unexpected Response Function Codes From Modbus TCP Slave(s): This dis-
plays the number of unexpected response function codes from Modbus TCP servers.
This occurs when a response was received with a different function code than what was
sent.
Invalid Response Protocol Types From Modbus TCP Slave(s): This displays the
number of responses with invalid protocol errors. This occurs when a response is re-
turned with a protocol other than the Modbus TCP protocol value of zero.
Failed Modbus TCP Connection Attempts To Modbus TCP Slave(s): This displays
the number of failed Modbus TCP connection attempts to the specified PLC IP address.
Modbus TCP Connection Problems: This displays the number of Modbus TCP con-
nection attempt problems. This occurs when the device responds and the connection
is made, but there are problems setting up the connection.
Unexpected Dropped Connections: This displays the number of Modbus TCP con-
nections that were unexpectedly dropped.

38/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

No Available Modbus TCP Connection Errors: This displays the number of connec-
tions aborted when there are no available Modbus TCP connections. This error occurs
when the maximum number of Modbus TCP connections has been reached and the
GW MODBUS TCP/RTU... is attempting to form another Modbus TCP connection.

Non-mode Specific Statis- Improper Configuration Errors: This displays the number of errors that were caused
tics Diagnostics by improper configuration.
System Resource Errors: This displays the numbers of system resource errors.
These errors are typically caused by congestion and/or non-responding devices.
First Error Description: This displays the first error detected.
Last Error Description: This displays the last or most recent error detected.

Slave Mode (from Master) Remote Connection: This displays the Modbus/TCP client connection in “IP Address:
Modbus TCP Connections Port Number” format.
(only displayed if active Local IP Port: The local TCP port on the GW MODBUS TCP/RTU.... The standard
connections) Modbus TCP port of 502 is always enabled. Optionally, up to seven additional Modbus
TCP ports may also be enabled.
Rx Requests: This displays the number of Modbus requests that have been received
since the connection was opened.
Tx Responses: This displays the number of Modbus responses that have been trans-
mitted since the connection was opened.
Time Since Open: This is the time that has elapsed since the connection was opened.

Master Mode (To Slave) Remote Connection: This displays the Modbus/TCP client connection in “IP Address:
Modbus/TCP Connec- Port Number” format.
tions (only displayed if ac- Tx Requests: This displays the number of Modbus requests that have been transmit-
tive connections). ted since the connection was opened.
Rx Responses: This displays the number of Modbus responses that have been re-
ceived since the connection was opened.
Dedicated: This indicates if the connection is dedicated for a specified Modbus device
ID.
Device ID: This displays the device ID of the associated device. If device ID offset or
alias device ID is enabled, the device ID used to communicate with the device is dis-
played.
Time Since Open: This is the time that has elapsed since the connection was opened.
3. If desired, click the “Reset Statistics” button to refresh the statistics shown.

4.9.2 TCP Statistics


To view TCP statistics:
1. Click the “Diagnostics” tab.
2. Click the “TCP Statistics” tab.

3762_en_C PHOENIX CONTACT 39/64


GW MODBUS TCP/RTU...

Figure 4-20 “TCP Statistics” page

TX Byte Count (To Application): This displays the number of bytes transmitted out of
the TCP/IP connection(s).
TX Response Count: This displays the number of responses transmitted out of the
TCP/IP connection(s).
Dropped TX Responses: This displays the number of responses that were intended
to be transmitted over the TCP/IP connection(s) but were dropped. This typically occurs
when one or more connections close unexpectedly.
RX Byte Count (From Application): This displays the number of bytes received on
the TCP/IP connection(s).
RX Message Count: This displays the number of messages received on the TCP/IP
connection(s).
Dropped RX Messages Due to Congestion: This displays the number of messages
that were dropped because the GW MODBUS TCP/RTU… was overloaded. This typi-
cally occurs when the application(s) send messages faster than the server device(s)
can respond.
Dropped Invalid Or Incomplete RX Messages: This displays the number of mes-
sages from the application(s) that were dropped due to an invalid Modbus message for-
mat or an incomplete Modbus message.
Dropped RX Messages Due To Invalid CRCs: This displays the number of mes-
sages from the application(s) that were dropped due to an invalid Modbus/RTU CRC or
Modbus/ASCII LRC.
3. If desired, click the “Reset Statistics” button to refresh the statistics shown.

4.9.3 Modbus server devices


The “Modbus Slaves” page provides device-specific status and statistics for each device
connected locally to one or more of the serial ports, or remotely through a remote Modbus
TCP device configuration.
To view Modbus server statistics:
1. Click the “Diagnostics” tab.
2. Click the “Modbus Slaves” tab.

40/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

Figure 4-21 “Modbus Slaves” page

Device ID: Displays the device ID associated with this device.


If Device ID Offset Mode is enabled, the actual device ID transmitted out the serial port
displays as (SP=xxx).

Active: Displays the status of device: Yes indicates that the last request received a
valid response and did not time out. No indicates that the last request timed out or the
device has not yet received a message.
IP Address: Displays the IP address and port in “IP Address: Port Number” format of
remote Modbus devices.
Tx Req: Displays the number of Modbus messages transmitted to this device.
Rx Rsp: Displays the number of Modbus responses received from this device.
Timeouts: Displays the number of response timeouts associated with this device.
Last Rsp Time: Displays the last response time from the Modbus device.
Avg Rsp Time: Displays the average response time from the Modbus device.
Min Rsp Time: Displays the minimum response time from the Modbus device.
Max Rsp Time: Displays the maximum response time from the Modbus device.
Error Rsp: Displays the number of responses with Modbus errors.
No Path: This displays the number of times the network path could not be connected.
This could be a result of a Modbus TCP device not responding, an incorrect IP address,
or a lack of remaining Modbus TCP connections.
Invalid Responses: Displays the number of invalid messages or responses received
because either a message was received after the timeout period (this may require in-
creasing the device response timeout), an incorrect device ID was received in the re-
sponse message, or an incorrect function code was received in the response message.
Blocked Writes: Displays the number of Modbus write messages that were not trans-
mitted for this device. This only occurs when the “Write Mode” option is set to Read
Only (see “Modbus configuration” on page 24)
Tx Broadcasts: Displays the number of Modbus broadcast messages transmitted to
this device.
3. If desired, click the “Reset Statistics” button to refresh the statistics shown.

3762_en_C PHOENIX CONTACT 41/64


GW MODBUS TCP/RTU...

4.9.4 Serial logs


This page displays the serial messages transmitted and received during normal operation.
To view serial log statistics:
1. Click the “Diagnostics” tab.
2. Click the “Serial Log” tab.

Figure 4-22 “Serial Log” page

The log format is as follows: Pkt(N): ddd:hh:mm:ss.mss Rx/Tx>(data)


ddd: days since last system restart
hh: hours since last system restart
mm: minutes since last system restart
ss: seconds since last system restart
mss: milliseconds since last system restart
(data): Modbus/RTU or Modbus/ASCII message data
Private messages between the client and servers on the client/server ports are indicated as
(Private). All other messages are those routed through the Modbus gateway to the Modbus
network or shared memory.
3. Click the “Reset Log” button to clear the log.

42/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

4.9.5 Alias statistics


To view miscellaneous statistics:
1. Click the “Diagnostics” tab.
2. Click the “Alias Statistics” tab.

Figure 4-23 “Alias Statistics” page

3. If desired, click the “Reset Statistics” button to refresh the statistics shown.

4.9.6 Write violations


To view miscellaneous statistics:
1. Click the “Diagnostics” tab.
2. Click the “Write Violations” tab.

Figure 4-24 “Write Violations” page

Entry: The log entry number.


Time Since Startup: The time since the GW MODBUS TCP/RTU… was started due
to a power on/cycle or a system reset. The format displays in the ddd:hh:mm:ss:mss
format.
Source: The source or sender of the Modbus write message. The IP address is dis-
played for all Modbus TCP and Modbus over Ethernet TCP/IP clients. The serial port
number is displayed (SP=<port number>) for serial Modbus clients.
Protocol: The protocol of the received Modbus message. Possible values are Modbus
TCP, Modbus RTU (serial or Ethernet), Modbus/ASCII (serial or Ethernet).
Device ID: Displays the device ID associated with the received write message.
If this message underwent a device ID alias operation, the originally received device
ID is displayed as (Rx=xxx).

Function Code: Displays the Modbus write function code.


Address: Displays the address of the intended write message.

3762_en_C PHOENIX CONTACT 43/64


GW MODBUS TCP/RTU...

If this message was addressed to shared memory, the shared memory address is dis-
played followed by (Shared memory).

Count: The number of items the write message intended to modify. For write register
messages, this is the number of 16-bit registers. For write coil messages, this is the
number of coils. For write file record messages, this is the number of records.
Data: The data the write message intended to write to the specified address. For write
register messages, the data is displayed in 16-bit hex word format. For all other write
messages, the data is displayed in 8-bit, or byte, hex format.

4.10 Maintenance
Click the “Device Maintenance” tab to access the available maintenance functions of the
GW MODBUS TCP/RTU....

4.10.1 Passwords
To change passwords:
1. Click the “Device Maintenance” page.
2. Click the “Passwords” tab to change the password used to access the web server.

Figure 4-25 “Password” page

The GW MODBUS TCP/RTU... has administrator-level passwords. The administrator-


level user may make changes to the configuration.
The default user name and password are:
User name: Admin
Password: admin
The “Password” field is case sensitive. The user name is fixed and cannot be modified.
3. Enter the current password and the new password (twice) in the appropriate fields.
4. Click the “Apply Changes” button to save changes.

44/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

4.10.2 Restore defaults


To restore defaults:
1. From the “Device Maintenance” page, click the “Restore Defaults” tab to return the
GW MODBUS TCP/RTU... to the original factory defaults, including the IP address.

Figure 4-26 “Restore Defaults” page

2. Check the “Check the box to confirm...” box.


3. Click the “Apply Changes” button.
Note that the IP address returns to the factory defaults and may require modification
to prevent multiple devices on the network from trying to use the same address.

3762_en_C PHOENIX CONTACT 45/64


GW MODBUS TCP/RTU...

4.10.3 Log files


To view log files:
1. From the “Device Maintenance” page, click the “Log Files” tab to review the log files of
the device, which can be used for advanced troubleshooting.

Figure 4-27 “Log Files” page

2. Click the “Save Logfile” button to save the log as a text file for future use, or review the
log in the web browser.
The log displays information about the device, such as when a PC created or broke a
connection to the GW MODBUS TCP/RTU....
The “Device Snapshot” feature allows a user to capture the system log, configuration
data, and other information that can be used for advanced troubleshooting or for “As
Configured” record keeping as a single text file.

46/64 PHOENIX CONTACT 3762_en_C


Configuration and startup

4.10.4 Configuration files


For fast and easy commissioning of a replacement unit, or in the event that many devices
need the same configuration, it is possible to create and load a configuration file into the
GW MODBUS TCP/RTU....
To save and load configuration files:
1. From the “Device Maintenance” page, click the “Config Files” tab.

Figure 4-28 “Config Files” page

2. Enter a password that is used to protect the file.


The password prevents unauthorized users from applying the system configuration file
to an unapproved node to gain access to the network.
3. Click the “Save Configuration” button to open a dialog box where the file name and stor-
age location on the PC are selected.
4. To load a configuration file to a GW MODBUS TCP/RTU..., click the “Browse” button to
open a dialog box and browse to the configuration file location on the PC.
5. After selecting the appropriate configuration file, enter the password for the file and click
the “Load Configuration” button.

4.10.5 Update firmware


To update firmware:
1. From the “Device Maintenance” page, click the “Update Firmware” tab to install a new
version of the firmware.

Figure 4-29 “Update Firmware” page

3762_en_C PHOENIX CONTACT 47/64


GW MODBUS TCP/RTU...

Occasionally, a new version of firmware may be provided to enhance operation of the


GW MODBUS TCP/RTU....
2. Download the firmware to a local drive on the connected computer.
3. Click the “Browse” button and navigate to the file in the “Browse” dialog box.
4. Highlight the file to select it, and then click the “Close” button.
5. Click the “Apply Changes” button to install the firmware.
NOTE:
Ensure that a reliable power connection is available during the firmware update. Do
not restart the module or disconnect the Ethernet cable during this process.
When firmware is updated, the device configuration is maintained.

48/64 PHOENIX CONTACT 3762_en_C


Application examples

5 Application examples

5.1 Serial Modbus RTU/ASCII server to Modbus TCP


client
Serial Modbus devices can be integrated into a Modbus TCP network. For flexibility, Mod-
bus TCP connections are configured on multiple TCP ports. Refer to “Modbus TCP config-
uration” on page 28 for configuration details.

Figure 5-1 Serial Modbus RTU/ASCII server to Modbus TCP client

RS-232/422/485

LAN/WAN Modbus RTU


server

Modbus TCP client

Modbus RTU
server

5.2 Modbus TCP server to serial Modbus RTU/ASCII


client
The “Remote Modbus Addressing” feature configures the GW MODBUS TCP/RTU... to
connect a serial Modbus RTU/ASCII client to Modbus TCP servers, or to Modbus RTU/AS-
CII servers connected to other GW MODBUS TCP/RTU... devices.

Figure 5-2 Modbus TCP server to serial Modbus RTU/ASCII client

RS-232/422/485
LAN/WAN
Modbus
RTU/ASCII client
Modbus TCP server
Remote Addressing IP Address:192.168.254.254

Device ID: 15
IP Address:192.168.254.254

Refer to section “Remote Modbus addressing” on page 29 for configuration details.

3762_en_C PHOENIX CONTACT 49/64


GW MODBUS TCP/RTU...

5.3 Modbus RTU/ASCII over TCP/IP using virtual COM


port
Most modern PCs no longer have serial ports, yet there are still a large number of installed
Modbus devices. By creating a virtual COM port on the PC, the GW MODBUS TCP/RTU...
can be used to connect serial Modbus devices over TCP/IP.

Figure 5-3 Modbus RTU/ASCII over TCP/IP using virtual COM port

RS-232/422/485
LAN/WAN
Modbus RTU
Modbus over
server
TCP/IP
COM Port Redirector
COM 3 = 192.168.254.254:8000
COM 4 = 192.168.254.254:8001 IP = 192.168.254.254
Serial Port = TCP port 8000
Serial Port = TCP port 8001 Modbus RTU
server

5.3.1 COM port redirector software


The redirector application is a special peer-to-peer connection. It runs as an application on
the PC and allows up to eight virtual COM ports to be set up.

5.3.1.1 Configure the GW MODBUS TCP/RTU...


Configure the TCP connection settings for the serial port in the following manner.

Table 5-1 TCP connection settings

Parameter GW DEVICE SERVER (A) Explanation


Enable TCP connection Enabled Use the TCP/IP protocol
Listen Enabled The COM port redirector ini-
tiates the connection
On Port 8000 Connect on TCP port 3001
Connect to IP address – The COM port redirector ini-
tiates the connection
Target port –
Source port –
Connect Data The connection is started
when the COM port redirec-
tor sends data
Disconnect Idle If no data is received for the
period set by the Idle Timer
field, disconnect

50/64 PHOENIX CONTACT 3762_en_C


Application examples

5.3.1.2 Install the COM port redirector software


Download the COM port redirector software from phoenixcontact.com. Double-click the
icon to start the installation process and follow the on-screen prompts.

5.3.1.3 Configure the COM port redirector software


To use virtual COM ports:
1. Double-click the desktop icon to launch the software. Click the “New Port” button on the
upper left corner.

Figure 5-4 “Create New Port” dialog box

2. Click the “Client” button to select the virtual port type.


3. Enter a port number from the “Virtual COM port” drop-down menu.
4. Enter the IP address of the GW MODBUS TCP/RTU... in the “Device IP address” field.
5. Enter 8000 in the “TCP port” field.
6. Click the “OK” button to close the dialog box.
7. Click “Test Connection” button to verify communication to the
GW MODBUS TCP/RTU....

5.4 Addressing Modbus RTU/ASCII devices with fixed


IDs using device aliasing
Many Modbus devices have fixed device IDs, which can cause problems when multiple de-
vices are connected to a single network. The “Device ID Aliasing” functionality allows mod-
ification of Modbus device IDs to simulate unique devices on the network.

3762_en_C PHOENIX CONTACT 51/64


GW MODBUS TCP/RTU...

Figure 5-5 Addressing Modbus RTU/ASCII devices with fixed IDs using device ID
aliasing

RS-232/422/485
LAN/WAN Modbus RTU
Server ID = 1

Modbus TCP client


Device ID Alias
Receive Device ID: 15
Alias Device ID: 1

When configured, a Modbus message from a client with the specified device ID alias is con-
verted to the device ID alias, the message is then routed internally using the alias device ID.
All responses are returned to the client with the original received message device ID.
Table 4-3 “Device ID alias examples” demonstrates several device ID aliasing examples.
Alternately, use the device ID offset functionality shown in Table 4-1 “Device ID offset ex-
amples”, which modifies the device ID contained in a Modbus request sent to a serial Mod-
bus server by adding or subtracting a user specified value.

5.5 Modbus client-to-client communication using


shared memory
The “Shared Memory” feature provides a simple and robust method for Modbus client-to-
client communication. In this case, the GW MODBUS TCP/RTU... emulates a Modbus
server, and each Modbus client can read or write to the “shared” memory in order to ex-
change data. Any Modbus client (Modbus TCP, serial Modbus RTU/ASCII, and Modbus
RTU/ASCII over Ethernet TCP/IP) can access the shared memory.

Figure 5-6 Modbus client-to-client communication using shared memory

RS-232/422/485

Modbus RTU
LAN/WAN
client

Modbus TCP client Shared Memory


Modbus server ID: 5
Holding register start address: 400001
Coil status register start address: 000001

The shared memory interface contains eight blocks of 200 holding registers and eight
blocks of 160 coils. Write access is controlled to each holding register block and coil block.
Each block is configured to provide all clients write access or be restricted to a port-specific
serial client, a Modbus TCP client, or an Ethernet TCP/IP client (see Table 4-2 on page 32).

52/64 PHOENIX CONTACT 3762_en_C


Application examples

5.6 Serial Modbus devices with the same device ID on


a multiport GW MODBUS TCP/RTU...
When multiple serial Modbus devices with fixed device IDs are connected to multiple serial
ports on the GW MODBUS TCP/RTU..., it is possible to address them separately using the
device ID offset functionality.

Figure 5-7 Serial Modbus devices with the same device ID on a multiport
GW MODBUS TCP/RTU...
Modbus RTU server
Device ID = 1

RS-232/422/485
LAN/WAN

Modbus TCP RS-232/422/485


client
Device ID Offset Modbus RTU server
Port 1 Device ID offset = 0 Device ID = 1
Port 2 Device ID offset = +1
Port 3 Device ID offset = +2
Port 4 Device ID offset = +3

Refer to Table 4-1 “Device ID offset examples” for details.


For example, if a GW MODBUS TCP/RTU 4P/2E has a serial Modbus device connected to
each port with Device ID 1, configure the device ID offset for each serial port according to
the following table:

Table 5-2 GW MODBUS TCP/RTU 4P/2E to serial Modbus example

Serial Original Device ID offset mode Device ID Result-


port device ID offset value ing
device ID
1 1 Off – 1
2 1 Add to message ID 1 2
3 1 Add to message ID 2 3
4 1 Add to message ID 3 4

The result is that each device may be addressed with a unique device ID by the Modbus cli-
ent.

3762_en_C PHOENIX CONTACT 53/64


GW MODBUS TCP/RTU...

5.7 Limiting access to Modbus devices using private


networks
The GW MODBUS TCP/RTU... supports the connection of both Modbus clients and serv-
ers on the same serial port. This allows a serial Modbus client to communicate to servers on
its own “private” serial bus as well as “public” servers on a Modbus TCP network. In this con-
figuration, a serial client can communicate to:
– Modbus RTU/ASCII server(s) on its own serial bus.
– Public Modbus RTU/ASCII serial server(s) connected to the same
GW MODBUS TCP/RTU....
– Modbus TCP servers, remote public Modbus RTU/ASCII serial server(s) by way of an-
other GW MODBUS TCP/RTU....
– Other Modbus client(s) on the Modbus network by way of the Shared Memory function-
ality.

Figure 5-8 Limiting access to Modbus devices using private networks

RS-485

Modbus RTU server LAN/WAN

Device ID = 1

Modbus TCP client


Private Device
ID Range
Modbus RTU server Min = 2
Device ID = 2 Max = 3

Modbus RTU server Modbus TCP client


Device ID = 3

Additionally, the Modbus servers on the serial bus are private to the client on that serial bus,
so the server device(s) cannot be accessed by Modbus clients on the Modbus TCP net-
work. In the event the GW MODBUS TCP/RTU... is powered off, the client and servers on
the serial bus can still communicate.
Specify the range of device IDs that should be considered private on the serial bus. Refer
to “Modbus TCP configuration” on page 28 for configuration details.

54/64 PHOENIX CONTACT 3762_en_C


Troubleshooting

6 Troubleshooting

6.1 Resetting the device

If, for some reason, the module needs to be reset to factory settings, there are two methods
available: hardware reset and software reset.

6.1.1 Hardware reset

The reset button allows resetting the device without the use of a PC.
To force a hardware reset:
1. With the device powered off, press and hold the reset button. Apply power and hold the
reset button for at least five seconds. Reinitializing the module and firmware reset may
take some time. Do not disconnect from power (see Section 2.1, “Structure” for the
location of the reset button on the GW MODBUS TCP/RTU...).
2. After a successful reset, the module returns to the factory default address
(192.168.254.254).

6.1.2 Software reset

To force a software reset:


1. Start the web server and navigate to the “Device Maintenance/Restore Defaults” page.
2. Click the check box on the page.
3. Click the “Apply Changes” button.
4. After a successful reset, the module returns to the factory default address
(192.168.254.254).

6.2 LEDs

Table 6-1 LEDs


LED Color Meaning
STATUS Green The STATUS LED flashes while the device is booting
(approximately 15 seconds).
After booting, the LED blinks approximately every ten seconds.
An internal error is indicated by three flashes every five
seconds.
Green Link LED. On indicates Ethernet network is connected.1
Yellow Activity LED. Flashing indicates data transfer activity.1
1 LEDs on Ethernet ports are not labeled. See Section 2.1, “Structure” for LED location.

3762_en_C PHOENIX CONTACT 55/64


GW MODBUS TCP/RTU...

56/64 PHOENIX CONTACT 3762_en_C


Appendixes

A Appendixes

A1 List of figures

Section 2
Figure 2-1: GW MODBUS TCP/RTU 1E/1DB9 ...................................................... 6
Figure 2-2: GW MODBUS TCP/RTU 1E/2DB9 ...................................................... 7
Figure 2-3: GW MODBUS TCP/RTU 2E/2DB9 ...................................................... 8
Figure 2-4: GW MODBUS TCP/RTU 2E/4DB9 ...................................................... 9

Section 3
Figure 3-1: DIN rail mounting ............................................................................... 11
Figure 3-2: DIN rail removal ................................................................................. 12
Figure 3-3: Pin 1 location ..................................................................................... 14
Figure 3-4: Single power supply connection ........................................................ 16
Figure 3-5: Redundant power supply connection ................................................. 16

Section 4
Figure 4-1: “Login” screen .................................................................................... 17
Figure 4-2: “Home” screen ................................................................................... 18
Figure 4-3: Click the “General Settings” tab to view and edit general information
about the GW MODBUS TCP/RTU.... “General Settings” page ......... 19
Figure 4-4: “LAN Settings/IP Address” page ........................................................ 20
Figure 4-5: From the “LAN Settings” page, click the “Security” tab.“LAN Settings/
Security” page .................................................................................... 21
Figure 4-6: “Serial Settings/Overview” page ........................................................ 22
Figure 4-7: “Serial Settings/Port 1 Configuration” page ........................................ 23
Figure 4-8: “Serial Port Configuration” page ......................................................... 23
Figure 4-9: “Modbus Configuration” page ............................................................ 24
Figure 4-10: “Modbus Settings” page ..................................................................... 27
Figure 4-11: “Modbus TCP” page .......................................................................... 28
Figure 4-12: “Remote Modbus” page ..................................................................... 29
Figure 4-13: “TCP/IP Connection” page ................................................................. 30
Figure 4-14: “Shared Memory Configuration” page ................................................ 32
Figure 4-15: “Shared Coils” page ........................................................................... 33
Figure 4-16: “Holding Registers” page ................................................................... 34

3762_en_C PHOENIX CONTACT 57/64


GW MODBUS TCP/RTU...

Figure 4-17: “Device ID Alias” page ....................................................................... 35


Figure 4-18: “Diagnostics Serial Statistics” page .................................................... 36
Figure 4-19: “Modbus TCP” page .......................................................................... 37
Figure 4-20: “TCP Statistics” page ......................................................................... 40
Figure 4-21: “Modbus Slaves” page ....................................................................... 41
Figure 4-22: “Serial Log” page ............................................................................... 42
Figure 4-23: “Alias Statistics” page ........................................................................ 43
Figure 4-24: “Write Violations” page ....................................................................... 43
Figure 4-25: “Password” page ................................................................................ 44
Figure 4-26: “Restore Defaults” page ..................................................................... 45
Figure 4-27: “Log Files” page ................................................................................. 46
Figure 4-28: “Config Files” page ............................................................................. 47
Figure 4-29: “Update Firmware” page .................................................................... 47

Section 5
Figure 5-1: Serial Modbus RTU/ASCII server to Modbus TCP client .................... 49
Figure 5-2: Modbus TCP server to serial Modbus RTU/ASCII client .................... 49
Figure 5-3: Modbus RTU/ASCII over TCP/IP using virtual COM port ................... 50
Figure 5-4: “Create New Port” dialog box ............................................................. 51
Figure 5-5: Addressing Modbus RTU/ASCII devices with fixed IDs using device ID
aliasing ............................................................................................... 52
Figure 5-6: Modbus client-to-client communication using shared memory .......... 52
Figure 5-7: Serial Modbus devices with the same device ID on a multiport
GW MODBUS TCP/RTU... ................................................................ 53
Figure 5-8: Limiting access to Modbus devices using private networks ............... 54

58/64 PHOENIX CONTACT 3762_en_C


List of tables

A2 List of tables

Section 2
Table 2-1: GW MODBUS TCP/RTU... types........................................................... 5
Table 2-2: GW MODBUS TCP/RTU 1E/1DB9 structure ......................................... 6
Table 2-3: GW MODBUS TCP/RTU 1E/2DB9 structure ......................................... 7
Table 2-4: GW MODBUS TCP/RTU 2E/2DB9 structure ......................................... 8
Table 2-5: GW MODBUS TCP/RTU 2E/4DB9 structure ......................................... 9

Section 3
Table 3-1: D-SUB 9 to RS-232 pin out .................................................................. 13
Table 3-2: D-SUB 9 to RS-422 and RS-485 pin out .............................................. 14

Section 4
Table 4-1: Device ID offset examples ................................................................... 26
Table 4-2: Modbus function codes ....................................................................... 32
Table 4-3: Device ID alias examples..................................................................... 34

Section 5
Table 5-1: TCP connection settings...................................................................... 50
Table 5-2: GW MODBUS TCP/RTU 4P/2E to serial Modbus example ................. 53

Section 6
Table 6-1: LEDs.................................................................................................... 55

3762_en_C PHOENIX CONTACT 59/64


GW MODBUS TCP/RTU...

60/64 PHOENIX CONTACT 3762_en_C


Index

A3 Index

A L
Addressing Modbus RTU/ASCII devices .....................52 LAN settings ................................................................ 20
Alias statistics ..............................................................43 LEDs ............................................................................ 55
Application examples Limiting access to Modbus devices ............................. 54
Modbus RTU/ASCII over TCP/IP using virtual COM Login ............................................................................ 17
port .........................................................................50
Modbus TCP slave to serial Modbus RTU/ASCII M
master ....................................................................49
Maintenance ................................................................ 44
Serial Modbus RTU/ASCII slave to Modbus TCP
master ....................................................................49 Modbus configuration ..................................................24
Modbus master-to-master communication................... 52
C Modbus settings........................................................... 27
Modbus slave devices ................................................. 40
COM port redirector software.......................................50
Modbus TCP configuration .......................................... 28
Modbus TCP................................................................ 37
D Mounting ...................................................................... 11
Data interfaces.............................................................13 Multiport GW MODBUS TCP/RTU............................... 53
Default settings ............................................................17
Description.....................................................................5 P
Device ID aliasing ........................................................34
Port configuration......................................................... 23
Diagnostics ..................................................................36
Power supply ............................................................... 16
Private networks .......................................................... 54
E
Ethernet cable ..............................................................15 R
Remote Modbus addressing........................................ 29
G Removal....................................................................... 12
General settings ...........................................................19 Resetting the device .................................................... 55
GW MODBUS TCP/RTU 1E/1DB9 ................................6 RS-232 cable ............................................................... 13
GW MODBUS TCP/RTU 1E/2DB9 ................................7 RS-422 cable ............................................................... 14
GW MODBUS TCP/RTU 2E/2DB9 ................................8 RS-485 cable ............................................................... 15
GW MODBUS TCP/RTU 2E/4DB9 ................................9
S
H Safety............................................................................. 3
Hardware reset ............................................................55 Security........................................................................21
Home screen................................................................18 Serial logs .................................................................... 42
Serial port configuration ............................................... 23
I Serial settings .............................................................. 22
Installation....................................................................11 shared memory ............................................................52
IP address....................................................................20 Shared memory ........................................................... 31
Software reset.............................................................. 55
Structure ........................................................................ 6

3762_en_C PHOENIX CONTACT 61/64


GW MODBUS TCP/RTU...

T
TCP Statistics ..............................................................39
TCP/IP connection .......................................................30
Troubleshooting ...........................................................55

V
V.24 cable ....................................................................13

W
Web-based management.............................................17
Write violations.............................................................43

62/64 PHOENIX CONTACT 3762_en_C


Please observe the following notes
General terms and conditions of use for technical documentation
Phoenix Contact reserves the right to alter, correct, and/or improve the technical
documentation and the products described in the technical documentation at its own
discretion and without giving prior notice, insofar as this is reasonable for the user. The
same applies to any technical changes that serve the purpose of technical progress.
The receipt of technical documentation (in particular user documentation) does not
constitute any further duty on the part of Phoenix Contact to furnish information on
modifications to products and/or technical documentation. You are responsible to verify the
suitability and intended use of the products in your specific application, in particular with
regard to observing the applicable standards and regulations. All information made
available in the technical data is supplied without any accompanying guarantee, whether
expressly mentioned, implied or tacitly assumed.
In general, the provisions of the current standard Terms and Conditions of Phoenix Contact
apply exclusively, in particular as concerns any warranty liability.
This manual, including all illustrations contained herein, is copyright protected. Any
changes to the contents or the publication of extracts of this document is prohibited.
Phoenix Contact reserves the right to register its own intellectual property rights for the
product identifications of Phoenix Contact products that are used here. Registration of such
intellectual property rights by third parties is prohibited.
Other product identifications may be afforded legal protection, even where they may not be
indicated as such.

PHOENIX CONTACT 63/64


64

How to contact us
Internet Up-to-date information on Phoenix Contact products and our Terms and Conditions can be
found on the Internet at:
phoenixcontact.com
Make sure you always use the latest documentation.
It can be downloaded at:
phoenixcontact.net/products

Subsidiaries If there are any problems that cannot be solved using the documentation, please contact
your Phoenix Contact subsidiary.
Subsidiary contact information is available at phoenixcontact.com.

Published by PHOENIX CONTACT GmbH & Co. KG


Flachsmarktstraße 8
32825 Blomberg
GERMANY
PHOENIX CONTACT Development and Manufacturing, Inc.
586 Fulling Mill Road
Middletown, PA 17057
USA
Should you have any suggestions or recommendations for improvement of the contents and
layout of our manuals, please send your comments to:
tecdoc@phoenixcontact.com

64/64 PHOENIX CONTACT GmbH & Co. KG • Flachsmarktstraße 8 • 32825 Blomberg • Germany
phoenixcontact.com

You might also like