Compare commits

..

1 Commits

Author SHA1 Message Date
Kimdiego2098
6291ce8617 modbusSlave运行时检查恢复启动 2024-02-28 17:08:31 +08:00
3 changed files with 5 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
<LangVersion>11.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>5.0.1.16</Version>
<Version>5.0.1.17</Version>
<Authors>Diego</Authors>
<Company>Diego</Company>
<Product>Diego</Product>

View File

@@ -84,7 +84,7 @@ public class ManagementWoker : BackgroundService
}
else
{
_ = CollectDeviceWorker.StopAsync(false);
_ = CollectDeviceWorker.StopAsync(!IsStartBusinessDevice);
}
}
}

View File

@@ -19,6 +19,8 @@ using ThingsGateway.Foundation.Extension.String;
using ThingsGateway.Foundation.Modbus;
using ThingsGateway.Gateway.Application;
using TouchSocket.Sockets;
namespace ThingsGateway.Plugin.Modbus;
/// <summary>
@@ -111,6 +113,7 @@ public class ModbusSlave : BusinessBase
CurrentDevice.SetDeviceStatus(DateTimeUtil.Now, 999);
try
{
Protocol.Channel.Close();
await Protocol.Channel.ConnectAsync(3000, cancellationToken);
success = true;
}