diff --git a/framework/Foundation/ThingsGateway.Foundation.Adapter.Siemens/Siemens/SiemensS7PLC.cs b/framework/Foundation/ThingsGateway.Foundation.Adapter.Siemens/Siemens/SiemensS7PLC.cs index 43e1baa7d..5444694af 100644 --- a/framework/Foundation/ThingsGateway.Foundation.Adapter.Siemens/Siemens/SiemensS7PLC.cs +++ b/framework/Foundation/ThingsGateway.Foundation.Adapter.Siemens/Siemens/SiemensS7PLC.cs @@ -459,6 +459,7 @@ namespace ThingsGateway.Foundation.Adapter.Siemens if (!result1.IsSuccess) { Logger?.Warning($"{client.IP} : {client.Port}:ISO_TP握手失败-{result1.Message}"); + TcpClient.Close(); return; } var result2 = await SendThenResponseAsync(S7_PN); diff --git a/framework/Plugin/ThingsGateway.Plugin.OPCUA/OPCUAServer/OPCUALogger.cs b/framework/Plugin/ThingsGateway.Plugin.OPCUA/OPCUAServer/OPCUALogger.cs index dde8a2f2f..0300a67d7 100644 --- a/framework/Plugin/ThingsGateway.Plugin.OPCUA/OPCUAServer/OPCUALogger.cs +++ b/framework/Plugin/ThingsGateway.Plugin.OPCUA/OPCUAServer/OPCUALogger.cs @@ -48,10 +48,9 @@ public partial class OPCUAServer else { var message = formatter(state, exception); - _log.Log((Foundation.Core.LogLevel)(byte)logLevel, state, message, exception); - if (logLevel > Microsoft.Extensions.Logging.LogLevel.Information) + if (logLevel > Microsoft.Extensions.Logging.LogLevel.Warning) { - + _log.Log((Foundation.Core.LogLevel)(byte)logLevel, state, message, exception); } } } diff --git a/framework/Plugin/ThingsGateway.Plugin.Siemens/Siemens.cs b/framework/Plugin/ThingsGateway.Plugin.Siemens/Siemens.cs index 5bb85fc9f..c1c32400a 100644 --- a/framework/Plugin/ThingsGateway.Plugin.Siemens/Siemens.cs +++ b/framework/Plugin/ThingsGateway.Plugin.Siemens/Siemens.cs @@ -113,18 +113,13 @@ public abstract class Siemens : CollectBase return new(await _plc?.WriteAsync(address, value, cancellationToken)); } - - - - - - /// protected override void Dispose(bool disposing) { _plc?.Disconnect(); base.Dispose(disposing); } + /// protected override async Task> ReadAsync(string address, int length, CancellationToken cancellationToken) {