//5. Execute the transaction repeat times
int k = 0;
do {
trans.execute();
res = (ReadInputDiscretesResponse) trans.getResponse();
//ReadCoilsResponse res = (ReadCoilsResponse) trans.getResponse();
if (Modbus.debug) System.out.println("Response: " + res.getHexMessage() );