using System;
using System.Collections.Generic;
using System.Text;
using TwinCAT.Ads;

namespace SIASUN.Autopilot.Device.BeckHoff
{
    public abstract class AbsTwinCatOpc
    {
        private int ADSConnectCur = 0;
        private int ADSClientNum = 0;

        public static TcAdsClient[] adsClients = new TcAdsClient[10];

        public virtual TcAdsClient GetAds()
        {
            ADSConnectCur = ADSClientNum % 10;
            ADSClientNum++;
            if (adsClients[ADSConnectCur] == null)
                adsClients[ADSConnectCur] = new TcAdsClient();
            return adsClients[ADSConnectCur];
        }
        public abstract bool IsConnectOpc();
        public abstract bool DisConnectOpc();

        public abstract bool CreateNotification();
        public abstract bool DeleteNotification();

        public abstract void Set(object nodevalue, string _type);

        public abstract object Get(out Type _type);
    }

}
