How many maximum modbus slave devices can be connected to a single RS485 port or TCP/IP of Modbus Master?

We are trying to develop a Modbus Slave Simulator which communicates to Modbus Master over RTU/ TCP/IP.
Modbus Slave Simulator application will be running on a PC and communicates to the Modbus Master over RTU/TCP/IP.

My question is how many max slaves can I simulate in a PC? As PC will be having single RTU and single ethernet port. How many max Slaves can I simulate over RTU and How many max Slaves can be simulated over ethernet port?

If I have to simulate max 255 slave devices, do I need any additional hardware to be considered. What additional hardware I need if I need have to simulate over RTU and TCP/IP?
I am trying to develop this Modbus slave simulator app in LabVIEW. As I am new to Modbus protocol, I do not have much information, hence posting this question.

Thanks in advance.

Assuming you are asking “what is practical & expected”, not what is possible.

A Modbus/TCP slave limited to only 1 client is pretty unusable. The most common situations are:

  1. customer has 2 clients (master & backup) plus maybe a field tool, so needs at least 3 sockets.
  2. during network hiccups, a client might go away and need to reconnect BEFORE your server frees up the socket, so a few sockets need to be available.

If I were creating such a tool, I’d offer AT LEAST 4 sockets, but 8, 10 or even 16 is safer. However, I think if you offer 4, no one can throw MUD at you! But don’t go less than 4. 255 is crazy (& why stop at 255? TCP ports are 16-bit, so you could support 10 or 20 thousand clients! :-] )

As for serial, that is always 1 master/client per RTU serial port.