[go: up one dir, main page]

0% found this document useful (0 votes)
15 views18 pages

Ah en Modbus Poll 111008 en 00

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 18

MODBUS POLL

Simulating and checking data communication


with Modbus Poll

Application note
111008_en_00 © Phoenix Contact 2023-03-13

1 Description
This application note describes how to check Modbus com-
munication via a Modbus gateway to your end device (Mod-
bus server). For this purpose use Modbus Poll as a Modbus
client simulator.
You will need the following products:
Designation Item No. Connection Link to item
Ethernet Serial
One of the following gateways:
FL COMSERVER UNI 232/422/485 2313452 1 1 phoenixcontact.net/product/2313452
GW MODBUS TCP/RTU 1E/1DB9 2702764 1 1 phoenixcontact.net/product/2702764
GW MODBUS TCP/RTU 1E/2DB9 2702765 1 2 phoenixcontact.net/product/2702765
GW MODBUS TCP/RTU 2E/2DB9 2702766 2 2 phoenixcontact.net/product/2702766
GW MODBUS TCP/RTU 2E/4DB9 2702767 2 4 phoenixcontact.net/product/2702767
USB-to-serial converter, e.g.:
CM-KBL-RS232USB 2881078 - - phoenixcontact.net/product/2881078

WARNING:
This application note does not replace the device-specific documents.
Observe the safety information, conditions, and limits of use specified in the product documentation. Comply with them.
Make sure you always use the latest documentation. It can be downloaded using the links provided above.
MODBUS POLL

Table of contents
1 Description.................................................................................................................................. 1
2 Application.................................................................................................................................. 3
3 Installing Modbus Poll................................................................................................................. 3
4 Determining the end device settings ........................................................................................... 4
5 Configuring the Modbus gateway ............................................................................................... 7
5.1 FL COMSERVER UNI 232/422/485 ............................................................................................................... 7
5.2 GW MODBUS TCP/RTU... ........................................................................................................................... 10

6 Configuring Modbus Poll............................................................................................................12


7 Checking the connection ...........................................................................................................15
7.1 FL COMSERVER UNI 232/422/485 ............................................................................................................. 15
7.2 GW MODBUS TCP/RTU... ........................................................................................................................... 17

8 Troubleshooting.........................................................................................................................18

111008_en_00 Phoenix Contact 2 / 18


MODBUS POLL

2 Application
Often an end device, with the device role as Modbus/RTU
server, must be integrated into a controller via Modbus/TCP.
The controller manufacturers work with different engineer-
ing tools. This can make operating the tools or programming
the blocks for data communication very challenging.
This application note describes how to simulate a controller
as a Modbus/TCP client on a PC and how to poll the end de-
vice. To do this, use the Modbus Poll program.
The goal is that the communication from the end device via
the Modbus gateway to Modbus Poll on the PC works. Then
you can replace Modbus Poll on the PC with the final con-
troller as a Modbus client.

Figure 1 Overview

3 Installing Modbus Poll


In this example, Modbus Poll is used on a computer with
Windows® 10.
Modbus Poll can be found at
https://www.modbustools.com/modbus_poll.html

• Download the program.


• Install Modbus Poll on your computer.

111008_en_00 Phoenix Contact 3 / 18


MODBUS POLL

4 Determining the end device settings


In this example, end devices from Phoenix Contact are
used:
– Communication module RAD-RS485-IFS, 2702184
– I/O extension module RAD-DI4-IFS, 2901535
You can also proceed as described here for end devices
from other manufacturers.

You will require the following information:


– Interface used:
RS-232, RS-485, or RS-422
– Connection assignment of the serial interface
– Modbus ID of the end device to be polled
– Register address
– Function code
For this information, refer to the data sheet of the de-
vice.

Serial interface

Figure 2 Extract from the data sheet of RAD-RS485-IFS

111008_en_00 Phoenix Contact 4 / 18


MODBUS POLL

Serial connection assignment

Figure 3 Extract from the data sheet of RAD-RS485-IFS

111008_en_00 Phoenix Contact 5 / 18


MODBUS POLL

Modbus process data of the end device

Figure 4 Extract from the data sheet of RAD-DI4-IFS

In this example, the RAD-RS485-IFS communication mod-


ule is connected to the Modbus gateway via the RS-485 in-
terface.
The interface parameters are:
– 19,200 baud
– 8 data bits
– Even parity
– 1 stop bit

The Modbus data is:


– Modbus ID: 10
– Modbus function code: 04
– Number of registers: 2
– The white thumbwheel for the I/O MAP address on the
extension module is set to 22 in this example. There-
fore, the register addresses are: 30220, 30221

111008_en_00 Phoenix Contact 6 / 18


MODBUS POLL

5 Configuring the Modbus gateway


5.1 FL COMSERVER UNI 232/422/485
– Default IP address: 192.168.0.254
– Password: private

Setting the IP address

Figure 5 Setting the IP address on the FL COMSERVER

• Customize the IP address accordingly.


In this example:
– IP address: 192.168.1.253
– Subnet mask: 255.255.255.0
– Gateway address: 192.168.1.1
• Save with “Confirm”.

111008_en_00 Phoenix Contact 7 / 18


MODBUS POLL

Setting the serial parameters

Figure 6 Setting the serial parameters

• Set the serial parameters.


• Save with “Confirm”.

111008_en_00 Phoenix Contact 8 / 18


MODBUS POLL

Setting the operation mode

Figure 7 Setting the operation mode

• To activate the Modbus gateway operation mode, go to


“Application”.
• Under “Operation Mode” select “MODBUS/TCP”.
• Leave the value “0” for “Remote TCP port” and “Remote
IP address”. Any Modbus client can then connect.
• If a Modbus server is connected to the serial port, select
the “Slave” option under “Device type”.
• Save with “Confirm”.
• Restart the device to adopt these settings. To do this,
click “Save & Reboot”.
⇒ Configuration of the FL COMSERVER is now complete.

111008_en_00 Phoenix Contact 9 / 18


MODBUS POLL

5.2 GW MODBUS TCP/RTU...


– Default IP address: 192.168.254.254
– User name: Admin
– Password: admin

Setting the IP address

Figure 8 Setting the IP address on the GW MODBUS TCP/RTU...

• Customize the IP address accordingly.


In this example:
– IP address: 192.168.254.242
– Subnet mask: 255.255.255.0
– Gateway address: 192.168.254.1

111008_en_00 Phoenix Contact 10 / 18


MODBUS POLL

Setting the serial parameters and operation mode

Figure 9 Setting the serial parameters and operation mode

• Set the serial parameters.


⇒ Configuration of the GW MODBUS TCP/RTU... is now
complete.

111008_en_00 Phoenix Contact 11 / 18


MODBUS POLL

6 Configuring Modbus Poll


The Modbus gateway converts Modbus/TCP to Modbus/
RTU. Therefore, the Modbus client must communicate with
the gateway via Modbus/TCP.

Establishing a TCP connection

Figure 10 Establishing a TCP connection

• Open the Modbus Poll program (Modbus client simula-


tor).
• Click “Connection, Connect”.

Figure 11 Connection Setup

• Select the “Modbus TCP/IP” option under “Connection”.


• Enter the IP address and the port of the “Remote Mod-
bus Server”.
Depending on the application, this is the address of the
Modbus converter, the FL COMSERVER, or the
GW MODBUS TCP/RTU...

111008_en_00 Phoenix Contact 12 / 18


MODBUS POLL

Polling the Modbus data

Figure 12 Polling the Modbus data

• To poll the Modbus data, click “Setup, Read/Write Defi-


nition...”

Figure 13 Read/Write Definition

• Apply the settings from the “Read/Write Definition”


screenshot.

Figure 14 Display, Binary

• Click “Display, Binary”.

111008_en_00 Phoenix Contact 13 / 18


MODBUS POLL

Figure 15 Polled Modbus data

The polled Modbus data is displayed in Modbus Poll as fol-


lows:
– Modbus ID: 10
– Register 1: Module type of the I/O extension module
30220: 0000 0000 0000 0001
– Register 2: Digital inputs
30210: 0000 0000 0000 1111

111008_en_00 Phoenix Contact 14 / 18


MODBUS POLL

7 Checking the connection


7.1 FL COMSERVER UNI 232/422/485
If the controller or, in this case, the PC with Modbus Poll has
established a TCP connection, this appears under “Device
Information, General”.

Figure 16 Checking the TCP connection on the FL COMSERVER

111008_en_00 Phoenix Contact 15 / 18


MODBUS POLL

Checking the serial connection

Figure 17 Checking the serial connection on the FL COMSERVER

– If data is sent on the serial port:


TD LED (12) lights up
– If data is received on the serial port:
RD LED (11) lights up

111008_en_00 Phoenix Contact 16 / 18


MODBUS POLL

7.2 GW MODBUS TCP/RTU...


If the controller or, in this case, the PC with Modbus Poll has
established a TCP connection, this appears under “Modbus
TCP”.

Figure 18 Checking the TCP connection on the GW MODBUS TCP/RTU...

111008_en_00 Phoenix Contact 17 / 18


MODBUS POLL

Checking the serial connection


• In web-based management, go to the “Diagnostics”
menu item.

Figure 19 Checking the serial connection on the GW MODBUS TCP/RTU...

8 Troubleshooting
Error Cause Solution
The network connection to the Modbus – Modbus gateway is not accessible • Go to web-based management and
gateway is not established in the network. check the settings on the device.
Error message in Modbus Poll: – FL COMSERVER UNI 232/422/
485 is not in Modbus operation
“Modbus Connection Failed. Connect
mode
Timeout“
Error message in Modbus Poll: – The serial connection parameters • Check the serial settings of the
“Gateway target device failed to re- are not correct (RS-485, RS-232, Modbus gateway and the end de-
spond“ RS-422). vice.
– Incorrect serial interface configured • Check the wiring on the Modbus
Tx and Err counters incrementing
in the Modbus gateway gateway and on the end device.
– Faulty wiring
– Incorrect slave ID in Modbus Poll
Error message in Modbus Poll: – Incorrect Modbus register values in • Enter the correct Modbus register
“Illegal Data Value“ Modbus Poll values under “Read/Write Defini-
tion”.
Tx and Err counters incrementing

111008_en_00 Phoenix Contact GmbH & Co. KG • Flachsmarktstraße 8 • 32825 Blomberg • Germany 18 / 18
phoenixcontact.com

You might also like