Пример #1
0
        private void InitOmronPLC()
        {
            try
            {
                IsConnectPLC = false;
                if (null != PLCOmron)
                {
                    PLCOmron.Dispose();
                    PLCOmron = null;
                }
                //注意:连接多个PLC时,要根据连接不同的端口
                PLCOmron = new PLC64Omron(Global.ListPLCInfo[Index].IP, Global.ListPLCInfo[Index].Port, this.Container);

                //PLC_Connect_Omron();
            }
            catch (Exception ex)
            {
                LogHelper.Fatal("欧姆龙PLC初始化失败!", ex);
            }
        }
Пример #2
0
 public FormTest(PLC64Omron omron, int plcIndex)
 {
     InitializeComponent();
     Omron     = omron;
     this.Text = "PLC " + (plcIndex + 1) + "读写测试";
 }