Ejemplo n.º 1
0
 private void InitSiemensPLC()
 {
     try
     {
         IsConnectPLC = false;
         if (null != PLCSiemens)
         {
             PLCSiemens.Disconnect();
             PLCSiemens = null;
         }
         PLCSiemens = new Class_Siemens(Global.ListPLCInfo[Index].IP, Global.ListPLCInfo[Index].Port, Global.ListPLCInfo[Index].NS);
     }
     catch (Exception ex)
     {
         LogHelper.Fatal("西门子PLC初始化失败!", ex);
     }
 }
Ejemplo n.º 2
0
 public FormTest(Class_Siemens opcua, int plcIndex)
 {
     InitializeComponent();
     OpcUa     = opcua;
     this.Text = "PLC " + (plcIndex + 1) + "读写测试";
 }