wangxinhui
2024-11-06 8f392cc88b0768b74efca3b68785cf5aa1c38e70
wcs-server-hbf/WIDESEA_WCS/WCSClient/Modbus/ModbusPLCClient.cs
@@ -125,7 +125,8 @@
            this.ModbusTcpNetClient.Port = Port;
            this.ModbusTcpNetClient.DataFormat = HslCommunication.Core.DataFormat.CDAB; ;
            this.ModbusTcpNetClient.AddressStartWithZero = true;
            this.ModbusTcpNetClient.ConnectTimeOut = 100;
            this.ModbusTcpNetClient.ConnectTimeOut = 2000;
            this.ModbusTcpNetClient.ReceiveTimeOut = 2000;
            this.ModbusTcpNetClient.IsCheckMessageId = true;
            this.ModbusTcpNetClient.IsStringReverse = false;
            this.ModbusTcpNetClient.Station = 2;
@@ -136,7 +137,7 @@
            if (!result.IsSuccess)
            {
                WIDESEA_Common.Tools.WriteLog.GetLog().Write($"Error:{PLCName}连接失败, {DateTime.Now}{Environment.NewLine}错误信息:{result.Message}", PLCName);
                WIDESEA_Common.Tools.WriteLog.GetLog().Write($"Error:{PLCName}连接失败---{DateTime.Now}{Environment.NewLine}错误信息:{result.Message}", PLCName);
                IsConnected = false;
                return $"连接失败,错误信息:{result.Message}";
            }
@@ -144,7 +145,7 @@
            {
                IsConnected = true;
                WIDESEA_Common.Tools.WriteLog.GetLog().Write($"Info:{PLCName}连接成功!, {DateTime.Now}", PLCName);
                WIDESEA_Common.Tools.WriteLog.GetLog().Write($"Info:{PLCName}连接成功!---{DateTime.Now}", PLCName);
                return $"连接成功";
            }