I'm working on a gateway using a modbus RTU client to collect data from the field and then push it through BACnet or HTTP to higher levels.
right now there's only the modbus RTU in the BACEND, but i'm wondering if a modbus TCP client can cohabit with it.
The only difference that i saw between them is in the frame where the TCP has a header and the RTU has a CRC, but would be there any conflict since they would be using the same interface? apart from the frame difference i couldn't find another. did anyone noticed something that can cause trouble making them cohabit? or is the idea just dumb?
MODBUS RTU is normally serial, RS232, RS485, etc.
MODBUS TCP is normally carried over Ethernet.
There is MODBUS RTU over TCP, which is MODBUS RTU wrapped in a TCP packet.
TCP uses port numbers and an IP address. Default port for MODBUS TCP is 502; the port can be any allowable number.
Assuming only one IP address.
If you have a device that accepts MODBUS RTU over TCP and MODBUS TCP on the same port number then no problem. That is normally not the case.
You could have MODBUS TCP on port 502 and MODBUS RTU over TCP on port 503. Or whatever port numbers you configure and have no problem.
You need to check with the device vendor for what is supported.
Hello Mark and thanks for your answer.
By coexisting i was searching also for differences between them to see if i can make a soft to manage them both (at the higher level of course). apart from the missing function code in the TCP and the connection modes, i don't see differences.
I don't understand how client from Modbus TCP can cohabit with Modbus RTU. Modbus RTU means one master and several slaves which always keep silent until master orders them to do something. In Modbus TCP there is one server and several clients. Any client anytime can ask server for something. Am I wrong?
Assuming, a multi-drop hardware loop, yes RTU allows 1 master and 1 or more slaves.
For TCP, there are servers (slaves) and clients (masters). If you have multiple servers and only 1 client then you effectively have the same configuration as multi-drop RTU.
Yes you are right, but the client can communicate with a slave using RTU and in the same time communicate with another server using TCP. so is using them both in the same could generate any trouble, and is there any differences between them apart from the bus and function code?
I think there is some confusion.
TCP is a point to point protocol.
A message from client (A) sent to server (B) is not seen by any other server. A message has an IP address and a port number.