modbusslave 异常捕获

This commit is contained in:
Diego
2025-07-01 10:51:10 +08:00
parent feb1d0a3c5
commit a48a42abe4

View File

@@ -484,6 +484,10 @@ public class ModbusSlave : DeviceBase, IModbusAddress
await ReturnData(client, valueByteBlock.Memory, e).ConfigureAwait(false);
}
}
catch
{
await WriteError(modbusRtu, client, Bytes, e).ConfigureAwait(false);
}
finally
{
valueByteBlock.SafeDispose();