Multiple Masters on Modbus-TCP

arunsinha

Member
Join Date
Feb 2009
Location
Murrieta CA
Posts
20
With Ethernet/Modbus-TCP, if a device is a Modbus Master, can it be polled by another Modbus Master? That is, "act like a slave", for lack of a more technical term.

Thanks,

Arun
 
Hi,

I would say typically no.

In some HMIs you could maybe solve this case by using two drivers (Modbus Master and Modbus Slave) and exchanging data between them.

Isn't it possible for the second Modbus Master to connect directly to the Modbus Slave instead? Or does the Modbus Slave only allow limited number of connections?

//Supporter
 
It depends on the brand/model/device as to whether there is slave functionality AND master functionality.

Honeywell's HC-900 PAC controller is a native Modbus/TCP slave where each function block and tag are automatically allocated registers in the Modbus slave map, unless custom Modbus mapping is selected.

The controller can be configured as a Modbus master with its function blocks.

The slave function is routinely used by OPC servers or HMI's that query for the controller for its data. The Master function is used as needed with field devices or a slave HMI. Both can run simultaneously (technically in sequence, but both can run at the same time without interfering with one another).

Is it possible? Yes. Does every device do it? No, it depends.
 
Thanks for your help. WRT your question: The application I'm looking at doesn't have a slave. The two devices are both "Masters". I think you're on to something in reference to the limited number of connections. That may be the key. Certain devices have a connection limit designed in (I'm looking at one of our PAC Controllers here at Opto and it is specified to have a Modbus connection limit of two).
 
Modbus TCP, as a protocol does not limit the number of masters or slaves you can have on a device or network, so it is all up to the device. It makes more sense to call the masters clients and the slaves servers, because the slaves have the data registers and listen for connections from masters, so I will use server/client terminology.

You can technically have 247 servers on each TCP port, and there are 65535 ports per IP address; that's around 16 millions servers per network interface. You can have infinite clients on a device, the only limiting factor is device CPU/RAM. Communication only works between a client and a server, servers don't talk to each other and clients don't talk to each other. If a software package or device chooses to only give you 1 client and/or server, that is a completely arbitrary limitation of the product you are using.

ModbusTCP communication works by a client opening a TCP connection to a specified IP address and port number (this is called a socket). Once the connection is made sends a standard ModBus command to that port and the command format still contains a spot to say what node number you are talking to. This is how you can have multiple servers on the same port. The server responds and usually the client closes the socket to make the connection available to a different client. Typically though, it is much easier to simply have one server on the port that responds to all node numbers, so many implementations only allow the 65535 servers per network interface. Others require you to use a certain port, but still let you run 247 servers on it; sometimes these setups are sophisticated and can handle multiple client requests on different ports and direct them to the "same" server. Unfortunately, most implementations are hack jobs that hard code the port and node number, limiting you to one server per network interface. Still, there is no reason to limit the number of clients (that's like a web site only allowing one visitor at a time, it doesn't make sense).
 
Last edited:
A guy with the Modbus.org is mad at me. The default server port is 502 and the node number section (Unit Identifier) is only intended for communication to a Modbus TPC/RTU gateway. Also, clients are only supposed to use ports above 1024, leaving them a paltry 64512 ports available.

However, even the official line says you should be able to change from the default server port to any port you want and never actually says you can only host one server at a time. I still like the idea of using the Unit Identifier to have multiple servers on a single port and I have machines in the field doing just that to communicate to peripherals that had hard coded client communication settings.
 

Similar Topics

Have anyone experience with use of Siemens S7-300 (CP341 card) and use of multiple masters. I have a client with a SCADA system there have Modbus...
Replies
0
Views
3,402
Hi all, I recently ran into a problem with my latest project. I am using a MicroLogix 1100 PLC, and have 4 remote IO modules that talk to it via...
Replies
12
Views
8,938
If an IPC with Codesys runtime on it has two separate ethernet ports, is it possible to have an Ethercat master on each of them? I do not find...
Replies
3
Views
523
Could anyone from a Siemens background offer me some advice here. I have a spec here which is requesting a system where until normal control a...
Replies
11
Views
6,371
I have several small individual stations, each controlled with a 314C-2DP processor. Right now, a multiproject is used to contain all of the...
Replies
2
Views
2,789
Back
Top Bottom