/// <summary> /// Processes a modbus server request /// </summary> /// <param name="serverEvents">An instance of server events provider</param> /// <returns>An instance of modbus server response for current request</returns> IModbusServerResponse IModbusServerRequest.Process(IServerEventsExecutor serverEvents) { this._logger.Log(String.Format("Received a request to write {0} words", this.NumberOfPoints)); var args = new WriteMultipleRegistersEventArgs(this); serverEvents.OnWriteMultipleRegistersRequest(args); if (!args.Handled) { this._logger.Log(PROCESS_ERROR, Category.ERROR, Priority.HIGH); Guard.Throw <ServerRequestException>(PROCESS_ERROR); } return(new WriteMultipleRegistersResponse(this.SlaveAddress, this.FunctionCode, this.Address, this.NumberOfPoints)); }