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

Unleashing The Power Of UUCMS Login

A college education is now of great significance, and technology is the key factor in…

3 days ago

How2Invest: Empowering Investors With Knowledge And Tools

How2Invest is a tool that can give you inside information and professional money advice. Like…

3 weeks ago

SEO Secrets For eCommerce Growth: Strategies You Can’t Afford To Miss

With the digital marketplace expanding rapidly, robust search engine optimization (SEO) strategies become crucial for…

4 weeks ago

Play Games And Earn Money Online With SkillClash

The industry of gaming has become a global powerhouse with millions of users across the…

1 month ago

Improving Nursing Education: The Key To Better Patient Outcomes

In the shifting sands of healthcare, the stalwart of patient outcomes often rests on the…

2 months ago

Human Resources On Organizational Culture And Employee Engagement

Key Takeaways The evolving role of HR is critical in aligning workplace practices with broader…

2 months ago