code: public InputRegister[] readInputRegisters(int unitId, int ref, int count) throws ModbusException {
          checkTransaction();
          if (readInputRegistersRequest == null) {
              readInputRegistersRequest = new ReadInputRegistersRequest();
          }
          readInputRegistersRequest.setUnitID(unitId);
          readInputRegistersRequest.setReference(ref);
          readInputRegistersRequest.setWordCount(count);
          transaction.setRequest(readInputRegistersRequest);
          transaction.execute();
          return ((ReadInputRegistersResponse) getAndCheckResponse()).getRegisters();
      }
docs: Reads a given number of input registers from the slave.
  
  Note that the number of input registers returned (i.e. array length)
  will be according to the number received in the slave response.
  
  @param unitId the slave unit id.
  @param ref    the offset of the input register to start reading from.
  @param count  the number of input registers to be read.
  
  @return a <tt>InputRegister[]</tt> with the received input registers.
  
  @throws ModbusException if an I/O error, a slave exception or
  a transaction error occurs.