public NjOmroPLC(string name) :
     base(name)
 {
     try
     {
         PlcCompolet = new NJCompolet();
         Setting     = (OmroPLCSetting)FastData.SaveStatic.ReadBinF(Name);
         PlcCompolet.ConnectionType   = Setting.ConnectionType;
         PlcCompolet.ReceiveTimeLimit = Setting.ReceiveTimeLimit;
         PlcCompolet.UseRoutePath     = Setting.UseRoutePath;
         PlcCompolet.PeerAddress      = Setting.PeerAddress;
         PlcCompolet.LocalPort        = Setting.LocalPort;
         listvarname = Setting.listvar;
         circletime  = Setting.circletime;
     }
     catch (Exception exp)
     {
         Setting.ConnectionType   = ConnectionType.UCMM;
         Setting.ReceiveTimeLimit = 200;
         Setting.UseRoutePath     = false;
         Setting.PeerAddress      = "0.0.0.0";
         Setting.LocalPort        = 0;
         Setting.listvar          = new List <string>();
         circletime = 100;
         MessageBox.Show(Name + ": PLC配置参数初始化失败!\r\n" + exp);
     }
 }
Exemple #2
0
        public OmronGatewayWrapper(string ip)
        {
            _compolet = new NJCompolet(null);

            _compolet.ConnectionType = ConnectionType.UCMM;
            _compolet.UseRoutePath   = false;
            _compolet.LocalPort      = 2;
            _compolet.PeerAddress    = ip;
            _compolet.RoutePath      = @"2%192.168.250.1\1%0";
            _compolet.UseRoutePath   = false;
        }
Exemple #3
0
        public void NLPLC_ClosePort()
        {
            lock (this)
            {
                if (this._CIPcompolet == null)
                {
                    this._CIPcompolet = new NJCompolet();
                }

                _CIPcompolet.Active = false;
            }
        }
Exemple #4
0
        public void NLPLC_Initial(string ip, int portId)
        {
            lock (this)
            {
                if (this._CIPcompolet == null)
                {
                    this._CIPcompolet = new NJCompolet();
                }

                _CIPcompolet.Active           = false;
                _CIPcompolet.ConnectionType   = ConnectionType.UCMM;
                _CIPcompolet.ReceiveTimeLimit = 750;
                _CIPcompolet.PeerAddress      = ip;
                _CIPcompolet.LocalPort        = portId;
                _CIPcompolet.Active           = true;
            }
        }
Exemple #5
0
 public PLC64Omron(string PLCAddress, int PortNo, IContainer Container)
 {
     try
     {
         NJPLC = new NJCompolet(Container);
         NJPLC.ConnectionType   = OMRON.Compolet.CIPCompolet64.ConnectionType.UCMM;
         NJPLC.LocalPort        = PortNo;
         NJPLC.PeerAddress      = PLCAddress;
         NJPLC.UseRoutePath     = false;
         NJPLC.DontFragment     = false;
         NJPLC.ReceiveTimeLimit = ((long)(750));
     }
     catch (Exception)
     {
         // throw(ex);
     }
 }
Exemple #6
0
 public OmroPlcMultiVar(NJCompolet _njCompolet)
 {
     InitializeComponent();
     njCompolet = _njCompolet;
 }