Exemplo n.º 1
0
 protected override void Dispose(bool disposing)
 {
     if (!base._disposed)
     {
         Module.Trace.TraceVerbose($"TcAdsSyncPort.Dispose({this._id:d}); disposing={disposing.ToString()}");
         if (disposing)
         {
             if (this._notificationMngt != null)
             {
                 this._notificationMngt.Dispose();
                 this._notificationMngt = null;
             }
             if (this._routerSyncWindow != null)
             {
                 this._routerSyncWindow.Dispose();
                 this._routerSyncWindow = null;
             }
             if (this._symbolTable != null)
             {
                 this._symbolTable.Dispose();
                 this._symbolTable = null;
             }
         }
         AdsErrorCode code = this.OnClosePort();
         base.Dispose(disposing);
     }
 }
Exemplo n.º 2
0
        private AdsErrorCode AddSymbolVersionChangedNotification()
        {
            AdsErrorCode code;

            if (this._notificationMngt == null)
            {
                this._notificationMngt = this.CreateNotificationMngt();
            }
            this._symbolVersionHandle = this._notificationMngt.AddNotification(0xf008, 0, new AdsStream(1), 0, 1, 4, 0, 0, null, out code);
            return(code);
        }
Exemplo n.º 3
0
        private AdsErrorCode AddStateChangedNotification()
        {
            AdsErrorCode code;

            if (this._notificationMngt == null)
            {
                this._notificationMngt = this.CreateNotificationMngt();
            }
            this._adsStateHandle = this._notificationMngt.AddNotification(0xf100, 0, new AdsStream(4), 0, 4, 4, 0, 0, null, out code);
            return(code);
        }
Exemplo n.º 4
0
        public AdsErrorCode TryAddDeviceNotification(string variableName, AdsStream data, int offset, int length, int transMode, int cycleTime, int maxDelay, object userData, out uint handle)
        {
            AdsErrorCode code;

            if (this._notificationMngt == null)
            {
                this._notificationMngt = this.CreateNotificationMngt();
            }
            handle = (uint)this._notificationMngt.AddNotification(variableName, data, offset, length, transMode, cycleTime, maxDelay, userData, out code);
            return(code);
        }
Exemplo n.º 5
0
        public int AddDeviceNotification(uint indexGroup, uint indexOffset, AdsStream data, int offset, int length, int transMode, int cycleTime, int maxDelay, object userData)
        {
            AdsErrorCode code;

            if (this._notificationMngt == null)
            {
                this._notificationMngt = this.CreateNotificationMngt();
            }
            int num = this._notificationMngt.AddNotification(indexGroup, indexOffset, data, offset, length, transMode, cycleTime, maxDelay, userData, out code);

            if (code != AdsErrorCode.NoError)
            {
                ThrowAdsException(code);
            }
            return(num);
        }