| | |
| | | { |
| | | MelsecMcNetClient.IpAddress = PLCIPAddress; |
| | | MelsecMcNetClient.Port = Port; |
| | | this.MelsecMcNetClient.ReceiveTimeout = 2000; |
| | | |
| | | //MelsecMcNetClient.ConnectTimeOut = 2000; |
| | | //MelsecMcNetClient?.ConnectClose(); |
| | |
| | | result.IsSuccess = true; |
| | | if (!result.IsSuccess) |
| | | { |
| | | WIDESEA_Common.Tools.WriteLog.GetLog().Write($"Error:{PLCName}连接失败{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}"; |
| | | } |
| | |
| | | { |
| | | IsConnected = true; |
| | | readWriteNet = MelsecMcNetClient; |
| | | WIDESEA_Common.Tools.WriteLog.GetLog().Write($"Info:{PLCName}连接成功!", PLCName); |
| | | WIDESEA_Common.Tools.WriteLog.GetLog().Write($"Info:{PLCName}连接成功!---{DateTime.Now}", PLCName); |
| | | return $"连接成功"; |
| | | } |
| | | } |