Hello.
When I run the next code I can see that the master.getValue(el), send the message to the server to close the socket.
In the attached whireshark picture you can see it. In the whireshark picture the 192.168.2.101 is the controller (modbus tcp server) and the 192.168.2.69 is my computer.
In this moment I have problems reading values every 500ms from one controller because every time that I read the master.getValue close the socket.
Do you know How can we close the socket only at the end of the readings?
Thanks.
NumericLocator el = new NumericLocator(255, RegisterRange.HOLDING_REGISTER, 0, DataType.TWO_BYTE_INT_UNSIGNED);
NumericLocator fjk = new NumericLocator(255, RegisterRange.HOLDING_REGISTER, 1, DataType.TWO_BYTE_INT_UNSIGNED);
for (int i = 0; i < 1113; i++) {
try {
System.out.println("el: " + master.getValue(el));
System.out.println("fjk: " + master.getValue(fjk));
}
catch (Exception e) {
e.printStackTrace();
}
}
Attachment: download link