setCoil(b);
}//constructor
public ModbusResponse createResponse() {
WriteCoilResponse response = null;
DigitalOut dout = null;
//1. get process image
ProcessImage procimg = ModbusCoupler.getReference().getProcessImage();
//2. get coil
try {
dout = procimg.getDigitalOut(this.getReference());
//3. set coil
dout.set(this.getCoil());
//if(Modbus.debug) System.out.println("set coil ref="+this.getReference()+" state=" + this.getCoil());
} catch (IllegalAddressException iaex) {
return createExceptionResponse(Modbus.ILLEGAL_ADDRESS_EXCEPTION);
}
response = new WriteCoilResponse(this.getReference(), dout.isSet());
//transfer header data
if (!isHeadless()) {
response.setTransactionID(this.getTransactionID());
response.setProtocolID(this.getProtocolID());
} else {