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