namespace ASTM_D7896_Tester.Services; public interface IPlcService { Task ConnectAsync(); Task DisconnectAsync(); Task IsConnectedAsync(); /// 读取指定工位的压力(浮点数) /// 工位号 1~3 //Task ReadPressureAsync(int stationId); /// 读取湿膜流量(浮点数) Task ReadWetFlowAsync(int stationId); /// 读取干膜流量(浮点数) Task ReadDryFlowAsync(int stationId); /// 写入线圈(如 M 元件) Task WriteCoilAsync(ushort coilAddress, bool value); /// 写入单个寄存器(16位) Task WriteRegisterAsync(ushort registerAddress, ushort value); /// 读取线圈状态(如 M 元件的 ON/OFF) Task ReadCoilAsync(ushort coilAddress); /// 读取连续多个保持寄存器(16位) Task ReadHoldingRegistersAsync(ushort startAddress, ushort count); /// 写入单个保持寄存器(16位) Task WriteSingleRegisterAsync(ushort registerAddress, ushort value); Task WriteMultipleRegistersAsync(ushort registerAddress, float value); float UshortToFloat(ushort P1, ushort P2); Task ReadFloatAsync(ushort startAddress); }