예제 #1
0
        /// <summary>
        /// Creates the group on the server if not already created.
        /// </summary>
        public void Create()
        {
            // Utils.Trace("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}/{1} Created({5}) {2}/{3}ms {4}%",
            //    m_clientHandle,
            //    m_serverHandle,
            //    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);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Creates the group on the server if not already created.
        /// </summary>
        public void Create()
        {
            // Utils.Trace("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}/{1} Created({5}) {2}/{3}ms {4}%",
            //    m_clientHandle,
            //    m_serverHandle,
            //    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);
                }
            }
        }