using HybirdFrameworkCore.Autofac.Attribute; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HybirdFrameworkServices.Plc { /// /// 可读可写区 /// public class PlcReadAndWritten { /// /// 写编程使能 写 0x5AA5,打开写使能 /// [Property(0, 2, PropertyReadConstant.Byte)] public ushort ProgrammingEnable { get; set; } /// /// 本机modbus地址 /// [Property(2, 2, PropertyReadConstant.Byte)] public ushort Modbus1Addres { get; set; } /// /// 波特率 /// 0:1200 /// 1:2400 /// 2:4800 /// 3:9600 /// 4:19200 /// [Property(2, 2, PropertyReadConstant.Byte)] public ushort BaudRate { get; set; } /// /// 校验位 /// 0:无 /// 1:奇 /// 2:偶 /// [Property(2, 2, PropertyReadConstant.Byte)] public ushort CheckBit { get; set; } /// /// 秒 /// [Property(2, 2, PropertyReadConstant.Byte)] public byte Seconds { get; set; } /// /// 分 /// [Property(2, 2, PropertyReadConstant.Byte)] public byte Points { get; set; } /// /// 时 /// [Property(2, 2, PropertyReadConstant.Byte)] public byte When { get; set; } /// /// 周 /// [Property(2, 2, PropertyReadConstant.Byte)] public byte Weeks { get; set; } /// /// 日 /// [Property(2, 2, PropertyReadConstant.Byte)] public byte Day { get; set; } /// /// 月 /// [Property(2, 2, PropertyReadConstant.Byte)] public byte Month { get; set; } /// /// 年 /// [Property(2, 2, PropertyReadConstant.Byte)] public byte Years { get; set; } public string time { get { return Years + "-" + Month.ToString().PadLeft(2, '0') + "-" + Day.ToString().PadLeft(2, '0') + " " + When.ToString().PadLeft(2, '0') + ":" + Points.ToString().PadLeft(2, '0') + ":" + Seconds.ToString().PadLeft(2, '0'); } set { } } /// /// 本机modbus地址 /// [Property(2, 2, PropertyReadConstant.Byte)] public ushort Modbus1Addres2 { get; set; } /// /// 保留 /// [Property(2, 2, PropertyReadConstant.Byte)] public ushort Reserve { get; set; } /// /// 电压变比 /// [Property(2, 2, PropertyReadConstant.Byte)] public ushort VoltageRatio { get; set; } /// /// 电流变比 /// [Property(2, 2, PropertyReadConstant.Byte)] public ushort CurrentRatio { get; set; } /// /// 秒脉冲/无功电能选择 /// 0x5A02:秒脉冲输出 /// 其他:无功电能输出) /// [Property(2, 2, PropertyReadConstant.Byte)] public ushort PulsePerSecond { get; set; } /// /// 电流接线反向 /// 0x00:不反接(默认值) /// 0x01:反接 /// [Property(2, 2, PropertyReadConstant.Byte)] public ushort CurrentReversal { get; set; } /// /// 电表清零 /// 写 0x0000 清零,其他不清 /// [Property(2, 2, PropertyReadConstant.Byte)] public ushort MeterReset { get; set; } } }