示例#1
0
        //======================================================================
        // ISubscription

        /// <summary>
        /// Tells the server to send an data change update for all subscription items containing the cached values.
        /// </summary>
        public override void Refresh()
        {
            lock (this)
            {
                if (subscription_ == null)
                {
                    throw new NotConnectedException();
                }

                string methodName = "IOPCAsyncIO2.Refresh2";
                try
                {
                    int          cancelID     = 0;
                    IOPCAsyncIO2 subscription = BeginComCall <IOPCAsyncIO2>(methodName, true);
                    subscription.Refresh2(OPCDATASOURCE.OPC_DS_CACHE, ++_counter, out cancelID);
                }
                catch (Exception e)
                {
                    ComCallError(methodName, e);
                    throw Utilities.Interop.CreateException(methodName, e);
                }
                finally
                {
                    EndComCall(methodName);
                }
            }
        }
示例#2
0
        /// <summary>
        /// Tells the server to send an data change update for all subscription items containing the cached values.
        /// </summary>
        public override void Refresh()
        {
            if (subscription_ == null)
            {
                throw new NotConnectedException();
            }
            lock (lock_)
            {
                string methodName = "IOPCAsyncIO2.Refresh2";
                try
                {
                    int          cancelID     = 0;
                    IOPCAsyncIO2 subscription = BeginComCall <IOPCAsyncIO2>(methodName, true);
                    subscription.Refresh2(OPCDATASOURCE.OPC_DS_CACHE, ++_counter, out cancelID);

                    if (DCOMCallWatchdog.IsCancelled)
                    {
                        throw new Exception($"{methodName} call was cancelled due to response timeout");
                    }
                }
                catch (Exception e)
                {
                    ComCallError(methodName, e);
                    throw Utilities.Interop.CreateException(methodName, e);
                }
                finally
                {
                    EndComCall(methodName);
                }
            }
        }
示例#3
0
 public void Refresh2(OPCDataSource p_SourceMode, int p_TransactionID, out int p_CancelID)
 {
     m_IfAsync.Refresh2(p_SourceMode, p_TransactionID, out p_CancelID);
 }