Beispiel #1
0
        public int AddNotification(IPLCNotify notify, string varName, string text, AdsTransMode transMode, int cycleTime, int maxDelay)
        {
            if (m_hConnect.ContainsKey(varName) == true)
            {
                return(m_hConnect[varName]);
            }

            object userData = varName;
            int    handle   = m_adsClient.AddDeviceNotification(varName, m_dataStream, transMode, cycleTime, maxDelay, text);

            m_notify.Add(text, notify);
            m_hConnect.Add(varName, handle);
            return(handle);
        }
 // in structurethe loction is the index
 public void AddNotification(IPLCNotify notify, object text, int location = 0, int cycleTimeInMs = 100, int maxDelay = 0)
 {
     m_notify = notify;
     hConnect = m_plc.AdsClient.AddDeviceNotification(m_varName, m_dataStream, location, m_sizeOfType, AdsTransMode.OnChange, cycleTimeInMs, maxDelay, text);
 }