Using ETH port as Modbus Master and Slave

Hi,

We have a project where we have a PLC as Master to Robot as Slave over modbus and need to add a 3rd party machine over modbus. I am wondering is this is possible using different ports (502 as master and 503 as slave for example)

There are 2 tricky points to this. The machine is also connected via modbus to a server to run independently of the PLC (such as if you turn the PLC off, the machine run manually and transfer info to the server). The connection between server and machine is not yet defined.
It also looks like the machine has much less support for being a slave than a master, so the question is raised if the PLC can be a master to one set of machines and a slave to another set?

Modbus TCP/IP can be used simultaniously as a Master and Slave.

For the master a port number is not specified, only slaves specify the modbus TCP port. Masters use an automatically assigned port for sending the requests.

1 Like

So if I understand correctly
If I set Master on and set the Slave setting on to port 503,
then in the hardware configuration, set the ports for the robot (slave) to 502 and machine (master) to 503 it should work? likewise do both on the machine and robot,

This depends on your other devices. Would need a bit more detailed description of who is the master in which communication pairs.

Example:
PLC (Master) ↔ Robot(Slave)
In this case if you are using ModbusTcp_any device for communicating with the robot then you need to set the Slave port of the Robot (defined in the robot) to the ModbusTcp_any device.

Machine (Master) ↔ PLC(Slave)
Here you set the PLC slave port in the PLC configuration and when configuring the Master you need to specify which port the PLC has been set to serve as a slave (Modbus default port is usually 502)

The PLC slave and Robot slave can both have port 502 as their port.