A wrapper for COM-DA group.
Inheritance: ComObject
Exemple #1
0
        /// <summary>
        /// Called when an asynchronous read operation completes.
        /// </summary>
        public void OnReadComplete(
            int dwTransid,
            int hGroup,
            int hrMasterquality,
            int hrMastererror,
            int dwCount,
            int[]                phClientItems,
            object[]             pvValues,
            short[]              pwQualities,
            System.Runtime.InteropServices.ComTypes.FILETIME[] pftTimeStamps,
            int[]                pErrors)
        {
            try
            {
                // unmarshal item values.
                DaValue[] values = ComDaGroup.GetItemValues(
                    dwCount,
                    pvValues,
                    pwQualities,
                    pftTimeStamps,
                    pErrors);

                // invoke the callback.
                m_group.OnReadComplete(dwTransid, phClientItems, values);
            }
            catch (Exception e)
            {
                Utils.Trace(e, "Unexpected error processing OnReadComplete callback.");
            }
        }
Exemple #2
0
        /// <summary>
        /// Initializes the object with the containing subscription object.
        /// </summary>
        public ComDaDataCallback(ComDaGroup group)
        {
            // save group.
            m_group = group;

            // create connection point.
            m_connectionPoint = new ConnectionPoint(group.Unknown, typeof(OpcRcw.Da.IOPCDataCallback).GUID);

            // advise.
            m_connectionPoint.Advise(this);
        }