Jamod Slave Example, can not connect to slave

690 views Asked by At

I tried to execute this java modbus slave example http://pastebin.com/uLJNiscj using jamod library. I can compile the package with no errors and run it on my local PC. But when I try to connect over port 502, no connection can be established. The port is open. Other modbus master tools can be connected to my PC. Any ideas?

1

There are 1 answers

0
knuppel On
 **InetAddress addr = InetAddress.getByName("0.0.0.0"); // Neu** 
 if (Modbus.debug) System.out.println("Listening...");
 listener = new ModbusTCPListener(100);
 **listener.setAddress(addr);  // Neu**

Added the lines with comment // Neu and now it works!