添加项目文件。

This commit is contained in:
xyy
2026-06-17 15:04:35 +08:00
parent ba1c916dd7
commit 09072ccda5
32 changed files with 2710 additions and 0 deletions

23
Services/IPlcService.cs Normal file
View File

@@ -0,0 +1,23 @@
using System.Threading.Tasks;
namespace HME_MoistureLossMeter.Services
{
public interface IPlcService
{
Task EnsureConnectedAsync(int retryCount = 3);
Task<float> ReadFloatAsync(ushort startAddress);
Task<float> ReadPressureAsync();
Task<float> ReadWetFlowAsync(int stationId);
Task<float> ReadPressureAsync(int stationId);
Task<bool> ReadCoilAsync(ushort coilAddress);
Task<ushort[]> ReadHoldingRegistersAsync(ushort startAddress, ushort count);
Task WriteCoilAsync(ushort coilAddress, bool value);
Task WriteRegisterAsync(ushort registerAddress, ushort value);
Task WriteSingleRegisterAsync(ushort registerAddress, ushort value);
Task WriteMultipleRegistersAsync(ushort registerAddress, float value);
Task<int> ReadInt32Async(ushort startAddress);
Task WriteInt32Async(ushort startAddress, int value);
bool IsConnected { get; }
void Dispose();
}
}