C3032
2026-01-08 116ed6b584bbdb40c5b65e7cb57e039b6ae57800
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,8 +61,19 @@
        {
            try
            {
                plc.Write(variable, message);
                return true;
                if (plc!=null)
                {
                    if (string.IsNullOrEmpty(variable))
                    {
                        variable = CommunicatorConnections["变量地址"].ToString();
                    }
                    plc.Write(variable, message);
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch
            {