public ModbusResponse createResponse() {
ReadInputDiscretesResponse response = null;
DigitalIn[] dins = null;
//1. get process image
ProcessImage procimg = ModbusCoupler.getReference().getProcessImage();
//2. get inputdiscretes range
try {
dins = procimg.getDigitalInRange(this.getReference(), this.getBitCount());
} catch (IllegalAddressException iaex) {
return createExceptionResponse(Modbus.ILLEGAL_ADDRESS_EXCEPTION);
}
response = new ReadInputDiscretesResponse(dins.length);
//transfer header data