LB_VisionProcesses/Communicators/SiemensS7/SiemensLBS7.cs
@@ -32,6 +32,7 @@ short slot; short.TryParse(CommunicatorConnections["端口"].ToString(), out slot); S7.Net.CpuType cpuType = (CpuType)CommunicatorConnections["型号"]; variable = CommunicatorConnections["变量地址"].ToString(); plc = new Plc(cpuType, IP, 0, slot); plc.Open(); return true; @@ -60,9 +61,20 @@ { try { if (plc!=null) { if (string.IsNullOrEmpty(variable)) { variable = CommunicatorConnections["变量地址"].ToString(); } plc.Write(variable, message); return true; } else { return false; } } catch { return false;