Esempio n. 1
0
        /// <summary>
        /// Creates the group on the server if not already created.
        /// </summary>
        public void Create()
        {
            if (Unknown != null)
            {
                return;
            }

            int serverHandle           = 0;
            int actualSamplingInterval = 0;

            object unknown = m_server.CreateGroup(
                m_clientHandle,
                m_samplingInterval,
                m_deadband,
                out serverHandle,
                out actualSamplingInterval);

            Unknown                  = unknown;
            m_serverHandle           = serverHandle;
            m_actualSamplingInterval = actualSamplingInterval;

            Utils.Trace(
                "Group {0} Created({4}) {1}/{2}ms {3}%",
                m_clientHandle,
                m_samplingInterval,
                m_actualSamplingInterval,
                m_deadband,
                m_items.Count);

            // set up data change callback.
            if (m_monitoredItems != null)
            {
                try
                {
                    m_callback = new ComDaDataCallback(this);
                }
                catch (Exception e)
                {
                    Utils.Trace("Could not establish IOPCDataCallback.", e);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Creates the group on the server if not already created.
        /// </summary>
        public void Create()
        {
            if (Unknown != null)
            {
                return;
            }

            int serverHandle = 0;
            int actualSamplingInterval = 0;

            object unknown = m_server.CreateGroup(
                m_clientHandle,
                m_samplingInterval,
                m_deadband,
                out serverHandle,
                out actualSamplingInterval);

            Unknown = unknown;
            m_serverHandle = serverHandle;
            m_actualSamplingInterval  = actualSamplingInterval;

            Utils.Trace(
                "Group {0} Created({4}) {1}/{2}ms {3}%",
                m_clientHandle,
                m_samplingInterval,
                m_actualSamplingInterval,
                m_deadband,
                m_items.Count);
            
            // set up data change callback.
            if (m_monitoredItems != null)
            {              
                try
                {
                    m_callback = new ComDaDataCallback(this);
                }
                catch (Exception e)
                {       
                    Utils.Trace("Could not establish IOPCDataCallback.", e);
                }
            }
        }