27 lines
762 B
C#
27 lines
762 B
C#
|
|
namespace MembranePoreTester.Communication
|
|||
|
|
{
|
|||
|
|
public class PlcConfiguration
|
|||
|
|
{
|
|||
|
|
public string IpAddress { get; set; }
|
|||
|
|
public int Port { get; set; }
|
|||
|
|
public byte SlaveId { get; set; } = 1; // 从站地址,默认1
|
|||
|
|
public ushort PressureRegister { get; set; }
|
|||
|
|
public ushort WetFlowRegister { get; set; }
|
|||
|
|
public ushort DryFlowRegister { get; set; }
|
|||
|
|
public double PressureFactor { get; set; } = 1.0;
|
|||
|
|
public double WetFlowFactor { get; set; } = 1.0;
|
|||
|
|
public double DryFlowFactor { get; set; } = 1.0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
public interface IPlcService
|
|||
|
|
{
|
|||
|
|
Task<float> ReadPressureAsync();
|
|||
|
|
Task<float> ReadWetFlowAsync();
|
|||
|
|
Task<float> ReadDryFlowAsync();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|