Files

23 lines
985 B
C#
Raw Permalink Normal View History

2026-06-17 15:04:35 +08:00
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();
}
}