@Test
public void testReadHoldingRegisters() {
ReadMultipleRegistersResponse res =(ReadMultipleRegistersResponse)readRequest(Modbus.READ_HOLDING_REGISTERS, 1, 1);
System.out.println(res.getRegisterValue(0));
//assertEquals("Incorrect value for holding register 1", 251, res.getRegisterValue(0));
}
Error
2018-05-25 12:36:49 INFO utils.AbstractTestModbusTCPMaster - Got error for request to localhost:502 (FC:3, Reg:1, Cnt:1) - Connection failed for /192.168.0.110:502
Modbus4j tested successfully, j2mod reported as above error
Using j2mod, Siemens s7 1200 test failed, modbus slave test succeeded
@Test public void testReadHoldingRegisters() { ReadMultipleRegistersResponse res =(ReadMultipleRegistersResponse)readRequest(Modbus.READ_HOLDING_REGISTERS, 1, 1); System.out.println(res.getRegisterValue(0)); //assertEquals("Incorrect value for holding register 1", 251, res.getRegisterValue(0)); } Error 2018-05-25 12:36:49 INFO utils.AbstractTestModbusTCPMaster - Got error for request to localhost:502 (FC:3, Reg:1, Cnt:1) - Connection failed for /192.168.0.110:502
Modbus4j tested successfully, j2mod reported as above error
Using j2mod, Siemens s7 1200 test failed, modbus slave test succeeded