using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; namespace PLC { /// /// PLC数据 /// /// 读取的值类型 public struct PLCData { /// /// 字地址 /// public int WordAddr { get; set; } /// /// 位地址 /// public int BitAddr { get; set; } /// /// 功能 /// public string Function { get; set; } /// /// 描述 /// public string Info { get; set; } /// /// 数据类型 /// public DataType DataType { get; set; } /// /// 高低位类型 /// public HightLowType HightLowType { get; set; } /// /// 读取的值 /// public T Data { get; set; } } /// /// 读取数据类型 /// //public enum DataType //{ // /// // /// 位 // /// // Bit = 0, // /// // /// 短整型 16位 // /// // Short, // /// // /// 整型 32位 // /// // Int, // /// // /// 浮点 32位 // /// // Float //} public enum DataType { [Description("Bool")] Bool, [Description("Short")] Short, [Description("Int")] Int, [Description("Float")] Float, [Description("Double")] Double, [Description("String")] String, [Description("ArrByte")] ArrByte, [Description("ArrFloat")] ArrFloat, [Description("ArrShort")] ArrShort, [Description("ArrUshort")] ArrUshort, [Description("ArrInt")] ArrInt, [Description("ArrUint")] ArrUint, } public enum HightLowType { _12, _21, _4321 } }