I am trying to simulate an TCP Modbus slave.

I extended the class TcpSlave for this and added some Process Images.

Unfortunately, the TcpSlave provides only the port to set.

How can I set the IP Address of the slave ?

I tried to add the following code snippet in TcpSlave but it doesn't help :

    public void start() throws ModbusInitException {
        try {
            serverSocket = new ServerSocket(port);

           //Socket socket;

          //this should be the ip address of the slave
           Socket socket = new Socket("", 502);

            while (true) {
                socket = serverSocket.accept();
                TcpConnectionHandler handler = new TcpConnectionHandler(socket);

Can someone help me ?