Project #002 Modbus RTU over TCP/IP

We move the changes!

Modbus RTU over TCP/IP
Modbus RTU over TCP/IP
Table of contents

Premise

This manual explain how to use and configure the Moxa NPort 5130A for connecting the Xcom-485i in your Local Area Network in order to using Modbus RTU Protocol over TCP/IP. Take this document as reference and feel free to modify according to your solution. This solution will not transform the Modbus RTU protocol into Modbus TCP/IP protocol.

MOXA NPort 5150A

1 Modbus

Modbus is a serial communication protocol developed by Modicon published by Modicon® in 1979 for use with its programmable logic controllers (PLCs). In simple terms, it is a method used for transmitting information over serial lines between electronic devices.

The device requesting the information is called the Modbus Master and the devices supplying information are Modbus Slaves. In a standard Modbus network, there is one Master and up to 247 Slaves, each with a unique Slave Address from 1 to 247. The Master can also write information to the Slaves. The official Modbus specification can be found at www.modbus.org/specs.php .

1.1 Protocol versions

Versions of the Modbus protocol exist for serial port and for Ethernet and other protocols that support the Internet protocol suite. There are many variants of Modbus protocols:

Modbus RTU: This is used in serial communication and makes use of a compact, binary representation of the data for protocol communication. The RTU format follows the commands/data with a cyclic redundancy check checksum as an error check mechanism to ensure the reliability of data. Modbus RTU is the most common implementation available for Modbus. A Modbus RTU message must be transmitted continuously without inter-character hesitations. Modbus messages are framed (separated) by idle (silent) periods.

This one is available by Studer Innotec with standard Xcom-485i alone.

Modbus ASCII: This is used in serial communication and makes use of ASCII characters for protocol communication. The ASCII format uses a longitudinal redundancy check checksum. Modbus ASCII messages are framed by leading colon («:») and trailing newline (CR/LF).

Modbus TCP/IP or Modbus TCP: This is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

Modbus over TCP/IP or Modbus over TCP or Modbus RTU/IP: This is a Modbus variant that differs from Modbus TCP in that a checksum is included in the payload as with Modbus RTU. Data model and function calls are identical for the previous 4 variants of protocols; only the encapsulation is different.

This solution is the one proposed by Euclide Innovation.

2 What I need?

The NPort device server will make Studer’s devices network-ready in an instant, with a compact size and just one serial port 485 the Nport 5130A is ideal for connecting to IP-based Ethernet LAN for our scope. Other NPort models from the series N5100 could be used depending on request.

  • Moxa NPort 5130A
  • CBL-RJ45F9-150
  • Xcom-485i

All devices could be bought from Euclide Innovation

3 Configuration Xcom-485i

The Xcom-485i must be configured according to your specifications. In our case we will keep it as much as default possible, keeping standard bus speed (9600bps) and modifying only the jumpers according to our DB9 to RJ45 cable (CBL-RJ45F9-150) mentioned earlier.

Jumpers configuration according to CBL-RJ45F9-150

4 Wiring diagram

Once you configured the jumpers according to your cable, close the case of the Xcom-485i and connect it from the RJ45 port side “External” to our Raspberry Pi USB. Follow Studer’s Innotec rules for Xcom-485i position on Studer’s bus. If the Xcom-485i is the last device on your chain, must be put in “T” position on the switch for termination.

5 Configuration MOXA NPort 5130A

Once connected to your ethernet infrastructure, the configuration file of MOXA Nport 5130A is available to be downloaded and imported to your device. It’s required to use the official Moxa software for configuring the device.

NPort Administration Suite for Windows V3.1 Mar 31, 2021

6 Testing

Testing procedure is just to ensure your Xcom-485i and MOXA Nport 5130A are well configured and ready to use with your PLC/SCADA systems or utilities software.
For testing the configuration you could use the follow software:
Serial to Ethernet Connector Downloads (14 days free)
This software will allow to connect your computer to MOXA Nport 5130A for receiving/transmitting data and create a virtual COM port for using your SCADA/PLC system.
QModMaster
QModMaster is a free Qt-based implementation of a ModBus master application. A graphical user interface allows easy communication with ModBus RTU and TCP slaves. QModMaster also includes a bus monitor for examining all traffic on the bus. We use this software like a PLC for reading data from Studer’s devices.

Please follow the steps on the right.

6.1 Serial to Ethernet Connector

6.2 QModMaster

Conclusion

Communication between Studer Xcom-485i and Moxa NPort 5130A is correctly working, you can now start modify or use it as it the devices for your application.

All contents (text, images, graphics, layout, etc.) on this manual belong to their respective owners.