コード例 #1
0
 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);
     }
 }
コード例 #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;
        }
コード例 #3
0
        public void NLPLC_ClosePort()
        {
            lock (this)
            {
                if (this._CIPcompolet == null)
                {
                    this._CIPcompolet = new NJCompolet();
                }

                _CIPcompolet.Active = false;
            }
        }
コード例 #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;
            }
        }
コード例 #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);
     }
 }
コード例 #6
0
ファイル: OmroPlcMultiVar.cs プロジェクト: yaoshunTeam/M6R-
 public OmroPlcMultiVar(NJCompolet _njCompolet)
 {
     InitializeComponent();
     njCompolet = _njCompolet;
 }