Exemple #1
0
 public OpcReadAndWrite(ParamClass PC)
     : base(PC)
 {
     CreateGroup();
     opcItem  = new OPCAutomation.OPCItem[PC.ParamList.Count];
     objItems = objGroup.OPCItems;
     myDc.Clear();
     for (int i = 0; i < PC.ParamList.Count; i++)
     {
         opcItem[i] = objItems.AddItem(PC.ParamList[i].KepAddress, i);
         myDc.Add(PC.ParamList[i].LabelName, opcItem[i]);
     }
 }
Exemple #2
0
        public ItemReadSync(ParamClass PC)
        {
            CreateGroup();
            opcItem  = new OPCAutomation.OPCItem[PC.ParamList.Count];
            objItems = objGroup.OPCItems;
            for (int i = 0; i < PC.ParamList.Count; i++)
            {
                opcItem[i] = objItems.AddItem(PC.ParamList[i].KepAddress, i);
            }

            paramClass = PC;

            tTimer          = new System.Timers.Timer(100);
            tTimer.Elapsed += SyncRead;
            tTimer.Start();
        }