diff --git a/Modbus.Net/Modbus.Net.Core/Modbus.Net.Core.csproj b/Modbus.Net/Modbus.Net.Core/Modbus.Net.Core.csproj index 8194029..0bf4df1 100644 --- a/Modbus.Net/Modbus.Net.Core/Modbus.Net.Core.csproj +++ b/Modbus.Net/Modbus.Net.Core/Modbus.Net.Core.csproj @@ -1,7 +1,7 @@  - netstandard1.3 + netstandard2.0 Modbus.Net.Core Modbus.Net Modbus.Net.Core @@ -23,7 +23,7 @@ - bin\Debug\netstandard1.3\Modbus.Net.xml + bin\Debug\netstandard2.0\Modbus.Net.xml @@ -50,19 +50,19 @@ - + + - - - + + - + \ No newline at end of file diff --git a/Modbus.Net/Modbus.Net.Modbus.Core/Modbus.Net.Modbus.Core.csproj b/Modbus.Net/Modbus.Net.Modbus.Core/Modbus.Net.Modbus.Core.csproj index 30ded4c..aac1f49 100644 --- a/Modbus.Net/Modbus.Net.Modbus.Core/Modbus.Net.Modbus.Core.csproj +++ b/Modbus.Net/Modbus.Net.Modbus.Core/Modbus.Net.Modbus.Core.csproj @@ -4,7 +4,7 @@ Modbus.Net.Modbus.Core Modbus.Net.Modbus Modbus.Net.Modbus.Core - 1.3.10 + 1.4.0 Chris L.(Luo Sheng) Hangzhou Delian IoT Science Technology Co.,Ltd. Modbus.Net.Modbus diff --git a/Modbus.Net/Modbus.Net.Modbus/Modbus.Net.Modbus.csproj b/Modbus.Net/Modbus.Net.Modbus/Modbus.Net.Modbus.csproj index 215e34f..cf070d7 100644 --- a/Modbus.Net/Modbus.Net.Modbus/Modbus.Net.Modbus.csproj +++ b/Modbus.Net/Modbus.Net.Modbus/Modbus.Net.Modbus.csproj @@ -30,11 +30,30 @@ + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/Modbus.Net/Modbus.Net.OPC/Modbus.Net.OPC.csproj b/Modbus.Net/Modbus.Net.OPC/Modbus.Net.OPC.csproj index 8fa1f47..3e1a9cd 100644 --- a/Modbus.Net/Modbus.Net.OPC/Modbus.Net.OPC.csproj +++ b/Modbus.Net/Modbus.Net.OPC/Modbus.Net.OPC.csproj @@ -27,7 +27,7 @@ - + diff --git a/Modbus.Net/Modbus.Net.OPC/OpcConnector.cs b/Modbus.Net/Modbus.Net.OPC/OpcConnector.cs index bcfaeb3..f8f81e3 100644 --- a/Modbus.Net/Modbus.Net.OPC/OpcConnector.cs +++ b/Modbus.Net/Modbus.Net.OPC/OpcConnector.cs @@ -72,26 +72,6 @@ namespace Modbus.Net.OPC } } - /// - /// 无返回发送数据 - /// - /// 需要发送的数据 - /// 是否发送成功 - public override bool SendMsgWithoutReturn(OpcParamIn message) - { - throw new NotImplementedException(); - } - - /// - /// 无返回发送数据 - /// - /// 需要发送的数据 - /// 是否发送成功 - public override Task SendMsgWithoutReturnAsync(OpcParamIn message) - { - throw new NotImplementedException(); - } - /// /// 带返回发送数据 /// diff --git a/Modbus.Net/Modbus.Net.Siemens.Core/Modbus.Net.Siemens.Core.csproj b/Modbus.Net/Modbus.Net.Siemens.Core/Modbus.Net.Siemens.Core.csproj index 0cca534..eabe269 100644 --- a/Modbus.Net/Modbus.Net.Siemens.Core/Modbus.Net.Siemens.Core.csproj +++ b/Modbus.Net/Modbus.Net.Siemens.Core/Modbus.Net.Siemens.Core.csproj @@ -5,7 +5,7 @@ Modbus.Net.Siemens.Core Modbus.Net.Siemens Modbus.Net.Siemens.Core - 1.3.10 + 1.4.0 Chris L.(Luo Sheng) Hangzhou Delian IoT Science Technology Co.,Ltd. Modbus.Net Siemens Profinet Implementation @@ -37,7 +37,7 @@ - + diff --git a/Modbus.Net/Modbus.Net.Siemens/Modbus.Net.Siemens.csproj b/Modbus.Net/Modbus.Net.Siemens/Modbus.Net.Siemens.csproj index 7abcf74..3b7b102 100644 --- a/Modbus.Net/Modbus.Net.Siemens/Modbus.Net.Siemens.csproj +++ b/Modbus.Net/Modbus.Net.Siemens/Modbus.Net.Siemens.csproj @@ -25,6 +25,19 @@ bin\Debug\net45\Modbus.Net.Siemens.xml + + + + + + + + + + + + + @@ -32,5 +45,5 @@ - + \ No newline at end of file diff --git a/Modbus.Net/Modbus.Net/Modbus.Net.csproj b/Modbus.Net/Modbus.Net/Modbus.Net.csproj index ecc2153..525d7f5 100644 --- a/Modbus.Net/Modbus.Net/Modbus.Net.csproj +++ b/Modbus.Net/Modbus.Net/Modbus.Net.csproj @@ -50,24 +50,19 @@ - + + - + - - - Component - - - \ No newline at end of file diff --git a/Modbus.Net/src/Base.Common/BaseConnector.cs b/Modbus.Net/src/Base.Common/BaseConnector.cs index 1b2df7b..50c7303 100644 --- a/Modbus.Net/src/Base.Common/BaseConnector.cs +++ b/Modbus.Net/src/Base.Common/BaseConnector.cs @@ -42,20 +42,6 @@ namespace Modbus.Net /// 是否断开成功 public abstract bool Disconnect(); - /// - /// 无返回发送数据 - /// - /// 需要发送的数据 - /// 是否发送成功 - public abstract bool SendMsgWithoutReturn(TParamIn message); - - /// - /// 无返回发送数据 - /// - /// 需要发送的数据 - /// 是否发送成功 - public abstract Task SendMsgWithoutReturnAsync(TParamIn message); - /// /// 带返回发送数据 /// diff --git a/Modbus.Net/src/Base.Common/ComConnector.cs b/Modbus.Net/src/Base.Common/ComConnector.cs index 5005498..32dc968 100644 --- a/Modbus.Net/src/Base.Common/ComConnector.cs +++ b/Modbus.Net/src/Base.Common/ComConnector.cs @@ -419,16 +419,6 @@ namespace Modbus.Net return ByteToString(returnBytes); } - /// - /// 无返回发送数据 - /// - /// 需要发送的数据 - /// 是否发送成功 - public override Task SendMsgWithoutReturnAsync(byte[] message) - { - return Task.FromResult(SendMsgWithoutReturn(message)); - } - /// /// 带返回发送数据 /// @@ -504,53 +494,6 @@ namespace Modbus.Net return Task.FromResult(SendMsg(message)); } - /// - /// 无返回发送数据 - /// - /// 需要发送的数据 - /// 是否发送成功 - public override bool SendMsgWithoutReturn(byte[] sendbytes) - { - try - { - if (!SerialPort.IsOpen) - try - { - SerialPort.Open(); - } - catch (Exception err) - { - Log.Error(err, "Com client {ConnectionToken} open error", ConnectionToken); - Dispose(); - SerialPort.Open(); - } - lock (SerialPort.Lock) - { - try - { - Log.Verbose("Com client {ConnectionToken} send msg length: {Length}", ConnectionToken, - sendbytes.Length); - Log.Verbose( - $"Com client {ConnectionToken} send msg: {string.Concat(sendbytes.Select(p => " " + p.ToString("X2")))}"); - SerialPort.Write(sendbytes, 0, sendbytes.Length); - } - catch (Exception err) - { - Log.Error(err, "Com client {ConnectionToken} send msg error", ConnectionToken); - Dispose(); - return false; - } - RefreshSendCount(); - } - return true; - } - catch (Exception err) - { - Log.Error(err, "Com client {ConnectionToken} reopen error", ConnectionToken); - return false; - } - } - private byte[] ReadMsg() { try diff --git a/Modbus.Net/src/Base.Common/IConnector.cs b/Modbus.Net/src/Base.Common/IConnector.cs index 0a73e86..74693d5 100644 --- a/Modbus.Net/src/Base.Common/IConnector.cs +++ b/Modbus.Net/src/Base.Common/IConnector.cs @@ -35,20 +35,6 @@ namespace Modbus.Net /// ǷϿɹ bool Disconnect(); - /// - /// ޷ط - /// - /// Ҫ͵ - /// Ƿͳɹ - bool SendMsgWithoutReturn(TParamIn message); - - /// - /// ޷ط - /// - /// Ҫ͵ - /// Ƿͳɹ - Task SendMsgWithoutReturnAsync(TParamIn message); - /// /// ط /// diff --git a/Modbus.Net/src/Base.Common/TcpConnector.cs b/Modbus.Net/src/Base.Common/TcpConnector.cs index 28da173..ec321b6 100644 --- a/Modbus.Net/src/Base.Common/TcpConnector.cs +++ b/Modbus.Net/src/Base.Common/TcpConnector.cs @@ -214,48 +214,6 @@ namespace Modbus.Net } } - /// - /// 发送数据,不需要返回任何值 - /// - /// 发送的信息 - /// 是否发送成功 - public override bool SendMsgWithoutReturn(byte[] message) - { - return AsyncHelper.RunSync(() => SendMsgWithoutReturnAsync(message)); - } - - /// - /// 发送数据,不需要返回任何值 - /// - /// 发送的信息 - /// 是否发送成功 - public override async Task SendMsgWithoutReturnAsync(byte[] message) - { - var datagram = message; - - try - { - if (!IsConnected) - await ConnectAsync(); - - var stream = _socketClient.GetStream(); - - Log.Verbose("Tcp client {ConnectionToken} send text len = {Length}", ConnectionToken, datagram.Length); - Log.Verbose($"Tcp client {ConnectionToken} send text = {String.Concat(datagram.Select(p => " " + p.ToString("X2")))}"); - await stream.WriteAsync(datagram, 0, datagram.Length); - - RefreshSendCount(); - - return true; - } - catch (Exception err) - { - Log.Error(err, "Tcp client {ConnectionToken} send exception", ConnectionToken); - CloseClientSocket(); - return false; - } - } - /// /// 发送数据,需要返回 ///