TECHNOLOGY

Modbus Flavors: ASCII, TCP, And RTU

Modbus is an application protocol (seventh) of the OSI model (Open Systems Interconnection model). It does not depend on the lower levels. Can use it in conjunction with other protocols, for example, Ethernet TCP / IP or UDP / IP. 

It uses serial interfaces RS-232, RS-422, RS-485, fiber optics, radio channels, and others as a physical medium for signal transmission. Let’s describe the differences between the most famous implementations of the Modbus protocol: RTU, ASCII, and TCP.

Modbus RTU (Remote Terminal Unit). This type of protocol most often uses the RS-485 serial interface as the physical layer of the network, less often RS-232 and RS-422. All these interfaces define communication using twisted pairs but differ in characteristics such as the maximum cable length, the number of nodes, etc.

The Modbus RTU packet format is broadly the same as the generalized form previously described: no additional fields are used. Packet integrity is monitored using the CRC-16 algorithm. An essential feature of Modbus RTU is that time pauses with at least 3.5 * t, where t is the transmission time of one byte in the current network, must be used to separate packets.

And the transfer of data bytes within one package is performed sequentially with a time interval between adjacent bytes no more than 1.5 * t. Otherwise, the transfer will be considered false. These rules prevent the use of Modbus RTU on slow, e.g., modem networks. Modbus ASCII. This is a kind of protocol that also works over RS-232 / RS-485 interfaces but uses ASCII characters to encode messages. 

Compared to Modbus RTU, two more fields are added in the packet format – special characters for marking the beginning and end of a message: colon and carriage return/line feed characters. There is no need for time pauses between packets. 

The LRC-8 algorithm is used to check the integrity. Generally, this version of the protocol is rarely used due to the complexity of the encoding and messages. However, it can be an excellent alternative to Modbus RTU on network delays and equipment with less accurate timers. Modbus TCP. It is an implementation of ModBus on Ethernet networks. Works on top of the TCP / IP stack. Unlike Modbus RTU and ASCII, in Modbus TCP, a connection is established with a specific device using TCP / IP. 

Therefore, the address in the Modbus packet is most often ignored, and broadcast messages are not used. 

The address may be required if the connection is established with gateway outputs to the RS485 network to further communicate with devices already in the Modbus language. Packet integrity control is also provided using the TCP / IP protocol, so there is no need for its Modbus implementation.

Along with the address, the Modbus TCP packet header contains several additional fields: 

Transaction ID (Or Exchange ID)

Most often filled with zeros. It is necessary for cases when the client device sends several messages without waiting for a response to the previous ones to then associate responses with requests. 

Protocol ID

Always filled with zeros, reserved for future use

Remaining Bag Length

The length of the remainder of the packet: addresses and PDUs (function code and data). We have considered only the open and most common implementations of the Modbus protocol. But there are many more, for example, MODBUS Plus, a proprietary protocol from Schneider Electric that supports Multi-Master mode.

Also Read: What Development Problems Does DevOps Help Solve?

 

Technology Hunger

We, at Technology Hunger, publish and promote all the latest technology news and updates. We cover all the trending areas of technology and bring all the latest news for our viewers.

Recent Posts

YouTube Audio Ripper: Unlocking Seamless Audio Extraction

Unlock Audio Effortlessly With The Best YouTube Audio Ripper Tools Description: Discover how to use…

2 weeks ago

Exploring 5etools: A Comprehensive Review Of The D&D Companion Platform

If you enjoy Dungeons & Dragons (D&D), you have come across many tools to improve…

4 weeks ago

Review of Indown.io: The Go-To Tool for Downloading Instagram Stories

The existence of several accounts in miscellaneous social networks allowed me to understand that one…

2 months ago

My Experience With ChatGPT Login: A Seamless Journey From Login To Daily Use

Introduction Access to new technologies and artificial intelligence has become vital in today's digital era.…

5 months ago

Looking Into chrome://net-internals: Everything You Need to Know About Chrome’s Network Diagnostics Tool.

Google Chrome is the most used browser today due to its speed, reliability, and versatility…

6 months ago

Tech Winks: Elevating Your Instagram Game And Keeping You Tech-Savvy

Staying relevant in the dynamic digital environment is impossible. Besides influencers, small business owners, and…

7 months ago