public IBS_G4_Drv(string Name) { this._name = Name != null ? Name : nameof(IBS_G4_Drv); this.diagnostic = new Diagnostic(this._name); this.diagnostic.OnException += new ExceptionHandler(this._diagnostic_OnException); this._connectionDTI = ""; this._connectionMXI = ""; this.ticker = TickerFactory.Create(Name, this._tIntervall, this._tPriority); this.hdTicker = new TickerHandler(this._ticker_OnTick); this.ChangeState(IBS_G4_Drv.DriverState.Idle); }
private void RunDispose() { if (this._mxiHandle > 0 && this.hdCreateEvent != 0) { PhoenixContact.DDI.DDI.DeleteIB_Event(this._mxiHandle); this.hdCreateEvent = 0; } if (this.evHandel_IB > 0) { PhoenixContact.DDI.DDI.SetNamedEvent(this.evHandel_IB); PhoenixContact.DDI.DDI.CloseNamedEvent(this.evHandel_IB); this.evHandel_IB = 0; } if (this.thrHdlIB != null) { this.thrHdlIB.Abort(); } if (this.evHandel_TO > 0) { PhoenixContact.DDI.DDI.SetNamedEvent(this.evHandel_TO); PhoenixContact.DDI.DDI.CloseNamedEvent(this.evHandel_TO); this.evHandel_TO = 0; } if (this.thrHdlTO != null) { this.thrHdlTO.Abort(); } if (this.ticker != null) { this.ticker.Dispose(); this.ticker = (PhoenixContact.Common.Ticker.Ticker)null; } if (this._mxiHandle > 0) { PhoenixContact.DDI.DDI.CloseNode(this._mxiHandle); this._mxiHandle = 0; } if (this._dtiHandle > 0) { PhoenixContact.DDI.DDI.CloseNode(this._dtiHandle); this._dtiHandle = 0; } this.diagnostic.Dispose(); }