namespace HybirdFrameworkDriver.ModbusTcpMaster; public class ModbusProperty : IModbusProperty { /// /// 寄存器编号 /// public int RegisterNo { get; set; } /// /// 数据起始地址 /// public int Start { get; set; } /// /// 数据域长度 /// public int Length { get; set; } /// /// 数据类型 /// public ModbusDataType Type { get; set; } public double Scale { get; set; } public int Round { get; set; } public double Offset { get; set; } public T Value { get; set; } /// /// /// /// 寄存器编号 /// 根据类型:Register为第几个寄存器 /// 根据类型:Register 为 几个寄存器 /// Register/Bit /// 精度 /// 保留几位小数 /// 偏移量 public ModbusProperty(int registerNo, int start = 0, int length = 1, ModbusDataType type = ModbusDataType.Register, double scale = 1,int round = 0, double offset = 0) { this.RegisterNo = registerNo; this.Start = start; this.Length = length; this.Type = type; this.Scale = scale; this.Round = round; this.Offset = offset; } public int GetRegisterNo() { return RegisterNo; } } public enum ModbusDataType { Bit, Register }