Modbus TCP/IP. Two flavors?

zmanvortex

Member
Join Date
Apr 2002
Location
Nebraska
Posts
216
Is there just one standard concerning Modbus TCP/IP?

If you compare this quote:

The MODBUS/TCP protocol uses binary encoding of data and TCP/IP's error detection mechanism for detection of transmission errors.

with this one:



MODBUS TCP/IP is essentially the serial MODBUS RTU protocol encapsulated in a TCP/IP wrapper.​

It appears to be two different standards.​
One flavor appears to be standard Modbus/TCP and the other appears to be Modbus RTU over TCP/IP.​

Is there a difference?​

Can somebody clarify this for me?​

Thanks.​
 
Modbus TCP is basically Modbus RTU over TCP/IP. Add a header (called the MBAP) and chop off the CRC from the Modbus RTU packet and you have Modbus TCP. The first quote in your post is referring to the fact that you remove the serial CRC from the Modbus RTU packet because the ethernet packet will generate it's own CRC anyway.

EDIT: Actually that first quote could be referring to TCP's 'guaranteed' packet delivery methodology. In TCP, every packet (in both directions) should get acknowledged. If an acknowledgment doesn't occur within a given time frame, the device should resend the data. This, of course, is a simplified explanation of TCP but if you do a search on the subject you will find tons of literature on it.
 
Last edited:
Thanks cjh. I guess I am referring to the binary encoded part of the first quote.

Basically is binary encoding the RTU protocol the same as ecapsulating the RTU protocol?


Encapsulated Modbus RTU master protocol. This protocol is also known as RTU over TCP or RTU/IP
 
Last edited:
I will give you my explanation of binary encoding, which may not be the best.
ASCII encoding is the binary representation of a character. For example: 0x31 or 00110001 is the equivalent of the character '1'. ASCII encoding is pretty much a universal standard.

Binary encoding is a binary representation of something that is only meaningful to that protocol or device that is using that data. Binary encoding can be much more efficient in that you can convey more information with less data but it is also far less portable to other devices than ASCII encoding.

If you've ever looked at protocols on comm. analyzer, this would probably make more sense to you. If you look at Modbus RTU on a comm. analyzer in ASCII format, you will see that there is no character representation. So Modbus RTU would be considered a Binary Encoded protocol. The same is true of TCP/IP. If you look at the data being sent back from a bar code scanner in ASCII format, you would see character representation.

Encapsulation simply means to embed data within another piece of data. In this example, the Modbus RTU application protocol is encapsulated within the TCP/IP protocol.

Does that make any sense?
 
Yes it does. Thanks.

I think I can rest assured that there is only one flavor of Modbus TCP/IP, and that would be Modbus RTU encapsulated in TCP/IP.

Thanks for the help.
 
Last edited:
One more question. Do you know where I can get a Modbus TCP/IP to Modbus serial converter?


I have a master that uses Modbus TCP/IP and a slave that is Modbus RTU serial.

Thanks.
 
B&B Electronics sells a converter for Modbus ASCII/RTU slave to Modbus TCP/IP master - Model MES1A.
 
The Modbus master programming library that I am looking at using on the pc end lists the following supported protocols:



Delivery includes:
  • Modbus RTU protocol
  • Modbus ASCII protocol
  • MODBUS/TCP protocol
  • TCP/IP based Encapsulated Modbus RTU protocol
From this I am wondering why they would list items 3 and 4 separately if they are the same thing.

It appears to be two different flavors of Modbus TCP/IP?
 
DeviceMaster UP

The DeviceMaster UP offers not only Modbus RTU to Modbus/TCP, but it also allows for a second application to access the serial port as well (for example - send modbus TCP messages to a PLC, and send same serial device data to a monitoring application running on a pc). The products are available with 1 or 4 serial ports.

Please contact me directly if you might be interested in testing and evaluating the unit free of charge.

I'd be happy to send you additional details also.
 
Maybe what they are saying is that they put the 'exact' Modbus RTU packet into the application layer of the TCP/IP protocol? Meaning, no MBAP header and they don't strip out the CRC.
This is certainly not Modbus TCP though.

I would try to get more clarification from the manufacturer of this device that you are looking at.
www.modbus.org describes the Modbus TCP protocol in great detail.
 

Similar Topics

Hello gentlemen, Im working on a small project on TIA Portal, about establishing a Modbus TCP connection between my ET200SP plc and a socomec...
Replies
11
Views
240
If a device has Modbus RTU over serial and Modbus RTO over TCP and Modbus TCP then there is a difference between Modbus RTU over TCP vs Modbus TCP...
Replies
7
Views
436
Hi There. I have PC to get few tags from PLC into C# windows forms application. What is the best and fastest way? I could not find Omron in...
Replies
3
Views
230
I contacted Hach and bought a kit they recommended for a customer to add Modbus TCP capability to his Chlorine Analyzer with a SC4500 controller...
Replies
8
Views
214
I’m trying to read values from a device that can either send registers as 32 bit or a pair of 16 bit but if I understand right, the micro can only...
Replies
26
Views
792
Back
Top Bottom