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); } }
public FormTest(Class_Siemens opcua, int plcIndex) { InitializeComponent(); OpcUa = opcua; this.Text = "PLC " + (plcIndex + 1) + "读写测试"; }