Communication Tutorial HMI Tutorial PLC Tutorial Technical Tutorial

Overview of Modbus Protocol

Written by October

Modbus gateway is considered an indispensable device in the 4.0 era when all devices are communicated via Ethernet. Everything used is getting smarter, faster and safer. Modbus gateway plays an increasingly important role when only a single device can connect with many different signals to PLC / Scada quickly and securely via Ethernet.

So do you know what modbus is? How is Modbus gateway related to modbus RTU and modbus TCP-IP. Let’s learn about Modbus with plctop.com

1. What is Modbus?

Modbus is a new communication standard compared to traditional Digital and Analog. Modbus uses communication technology on the principle of Master – Slave ie master – slave relationship. Devices that only need to share a modbus RTU RS485 standard do not need to care about which brand or origin. This is the superiority of modbus communication in the industry compared to other standards such as Profibus, Profinet…

Modbus distinguishes Slave ie devices that transmit signals and Master ie devices that receive signals. The system has only one or more masters to read all the underlying slaves, but the slaves cannot communicate with each other.

Working principle of modbus RS485

The signal transmission system via Modbus will have two components:

+ Signal transmission equipment: water level sensor, flow meter, Modbus RTU signal converter

+ Signal reading device: PLC, Scadar, HMI…

Signal transmission devices will have unique identifiers: Address ( address ), Baud ( baud rate ) as specified by the manufacturer.

Signal reading devices: must read these addresses correctly to read data from the devices below. I will take a specific example for everyone to understand better.

Assume the system has 5 different tanks. Including 1 ultrasonic sensor ULM-70N with output signal as Modbus RTU and 4 other water level sensors output 4-20mA signal. The PLC has built-in Modbus RTU communication or uses the modbus RTU communication standard expansion module.

+ The ULM-70N ultrasonic sensor has an integrated modbus RTU communication standard, so the PLC can read it directly through the RS485 standard on two Rx and Tx wires.

+ For the remaining 4 water level sensors, we will use 1 Z-4AI signal converter because Z-4AI can receive 4 4-20mA / 0-10V Analog sensors at the same time to convert to Modbus RTU.

At Z-4AI, by default, there will be 4 registers: 40017, 40018, 40019, 40020 corresponding to Input 1, input 2, input 3, input 4.

At ULM-70N, we have register 100 corresponding to the output signal 0-6m or 0-10m depending on the measuring distance of the sensor.

All devices choose the same Baud rate 9600. Then the PLC will scan the addresses: 100, 40017, 40018, 40019, 40020. Measured values ​​(if any) will be displayed on the PLC. We can scale to convert these values ​​into actual numeric values.

Thus, the operating principle of Modbus RTU is quite simple. We just need to have standard and commonly used equipment to easily handle requests when we need support.

2. Modbus-RTU RS485

Modbus RTU RS 485 is most commonly used because it is the simplest. All sensors will be connected with 2 wires RS485 A ( + ) and RS485 B ( – ). The devices can be connected in parallel or in series, the PLC can be read easily. Due to only going 1 wire 2 cores for all devices connected to the Modbus RTU network, it will save a huge amount of wires compared to traditional digital and analog standards.

Long distance transmission 1200 is the most prominent feature of the Modbus RTU communication standard because compared to Digital or Analog standards, the limit is only about 200m back. Long-distance transmission solves a huge headache for industrial system designers.

Modbus RTU communication standard is extremely anti-interference when the transmitted signals are only transmitted according to logic 0 or 1. When there is an external impact, it will cause voltage drop or surge, and both wires will be affected at the same time. the same. Therefore, the signal is still guaranteed not to be distorted when there is an external impact.

Thus, the Modbus RTU communication standard has many advantages compared to the traditional ways of Analog, Digital. That is the reason why sensors that output digital or analog signals all use signal converters to convert to Modbus RTU for transmission to the PLC.

3. Modbus TCP/IP Protocol

Modbus TCP/IP Protocol works based on Modbus RTU platform but connects using RJ45 port and communicates via Ethernet network. In other words, the TCP-IP modbus standard will use the ethernet network to transmit signals to another location in the same network layer. Of course you can access anywhere if you NAT PORT from your network.

Modbus TCP-IP communication method minimizes wire connections as well as creates a new way of accessing the internet.

The PLC or other Master devices only need to access the IP address of the gateway device. From this gateway will contain the addresses of Modbus RTU. Inside the RTU modbus converters, there are many small registers – each of which corresponds to a pressure or temperature measuring device.

4. Modbus Gateway

Modbus gateway is an intermediate device used to convert from modbus RTU to modbus TCP-IP. Since it is a converter, essentially the signals and addresses of the below measuring devices do not change in terms of Adress, Baud rate and value.

Modbus gateway plays an important role in simplifying connections in the process of connecting hardware to PLC. Instead of having to connect a lot of signal wires together, when there is a modbus gateway, it all boils down to 1 RJ45 wire plugged directly into the PLC or LAN.

Another convenient point when you use the modbus gate is that common devices in the same network layer can access the address of this gateway to get the signal. That is, with only one device, many independent devices can connect and get signals together.

The biggest advantage of using a modbus gateway is that the cabinets are connected to a modbus gateway to the router. PLCs or monitoring devices can be accessed remotely without being physically connected to this Gateway. With the current relatively fast transmission speed, the signal is always transmitted in real time to the center quickly.

We will have two types of modbus gateways: modbus TCP ethernet IP and modbus gateway wifi. Both of these devices work the same. The difference is that a device uses RJ45 physical wire to connect and a device uses Wifi waves to connect.

5. Modbus-TCP Ethernet IP

R-KEY-LT is a TCP Ethernet IP modbus gateway used to interface meters, actuators, sensors, flow meters, etc. all put together into R-KEY-LT and connect Connect to the Internet through the RJ45 port. All plant equipment will be communicated with each other over the internet. R-KEY-LT acts as an intermediary between devices.

Mode of operation of signal conversion from modbus RTU to modbus TCP ethernet IP. Instead of previously, the devices will be identified as an address #1 … #128, when through the R-KEY-LT, it will be converted to IP: 192.168.1.1.xx. As for the R-KEY-LT, it is possible to configure the IP address through its SDD software, which is provided free of charge.

When there are many gateway devices in the same network layer, we need to choose many different IP addresses to avoid conflicts and confusion between clients.

To use Modbus TCP Ethernet IP at every point in the factory network, we connect the devices to the Routers. These routers need to have the same network layer or NAT Port if different. This is also quite simple, nothing complicated.

So plctop.com has learned about Modbus with you, if you have any questions, please comment. Thank you!

About the author

October

Leave a Comment