trans.setRequest(req);
//7. Execute the transaction repeat times
int k = 0;
do {
trans.execute();
res = (ReadInputDiscretesResponse) trans.getResponse();
if (Modbus.debug) System.out.println("Response: " + res.getHexMessage());
BitVector inputs = res.getDiscretes();
byte ret[] = new byte[inputs.size()];