code: @Override
      public ModbusResponse createResponse(AbstractModbusListener listener) {
          WriteMultipleRegistersResponse response;
  
          if (nonWordDataHandler == null) {
              Register[] regs;
              // 1. get process image
              ProcessImage procimg = listener.getProcessImage(getUnitID());
              // 2. get registers
              try {
                  regs = procimg.getRegisterRange(getReference(), getWordCount());
                  // 3. set Register values
                  for (int i = 0; i < regs.length; i++) {
                      regs[i].setValue(this.getRegister(i).getValue());
                  }
              }
              catch (IllegalAddressException iaex) {
                  return createExceptionResponse(Modbus.ILLEGAL_ADDRESS_EXCEPTION);
              }
              response = (WriteMultipleRegistersResponse)getResponse();
              response.setReference(getReference());
              response.setWordCount(getWordCount());
          }
          else {
              int result = nonWordDataHandler.commitUpdate();
              if (result > 0) {
                  return createExceptionResponse(result);
              }
  
              response = (WriteMultipleRegistersResponse)getResponse();
              response.setReference(getReference());
              response.setWordCount(nonWordDataHandler.getWordCount());
          }
  
          return response;
      }
docs: createResponse - Returns the <tt>WriteMultipleRegistersResponse</tt> that
  represents the answer to this <tt>WriteMultipleRegistersRequest</tt>.
  
  The implementation should take care about assembling the reply to this
  <tt>WriteMultipleRegistersRequest</tt>.
  
  This method is used to create responses from the process image associated
  with the listener. It is commonly used to implement Modbus
  slave instances.
  
  @return the corresponding ModbusResponse.
  <p>
  
  createResponse() must be able to handle the case where the word
  data that is in the response is actually non-word data. That is,
  where the slave device has data which are not actually
  <tt>short</tt> values in the range of registers being processed.