IODefine.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Xml.Serialization;
  6. namespace Aitex.Core.RT.IOCore
  7. {
  8. [Serializable]
  9. public class DI_ITEM
  10. {
  11. [XmlAttribute]
  12. public int Index;
  13. [XmlAttribute]
  14. public string Name = " ";
  15. [XmlAttribute]
  16. public string Addr; //物理地址
  17. [XmlAttribute]
  18. public string Description = "";
  19. }
  20. /// <summary>
  21. /// 数字量输出节点定义
  22. /// </summary>
  23. [Serializable]
  24. public class DO_ITEM
  25. {
  26. [XmlAttribute]
  27. public int Index;
  28. [XmlAttribute]
  29. public string Addr; //物理地址
  30. [XmlAttribute]
  31. public string Name = " ";
  32. [XmlAttribute]
  33. public string Description = "";
  34. }
  35. /// <summary>
  36. /// 模拟量输出节点定义
  37. /// </summary>
  38. [Serializable]
  39. public class AO_ITEM
  40. {
  41. [XmlAttribute]
  42. public int Index;
  43. [XmlAttribute]
  44. public string Name = " ";
  45. [XmlAttribute]
  46. public string Addr; //物理地址
  47. [XmlAttribute]
  48. public string Description = "";
  49. }
  50. /// <summary>
  51. /// 数字量输入节点定义
  52. /// </summary>
  53. [Serializable]
  54. public class AI_ITEM
  55. {
  56. [XmlAttribute]
  57. public int Index;
  58. [XmlAttribute]
  59. public string Name = " ";
  60. [XmlAttribute]
  61. public string Addr; //物理地址
  62. [XmlAttribute]
  63. public string Description = "";
  64. }
  65. /// <summary>
  66. /// IO数据表
  67. /// </summary>
  68. [Serializable]
  69. public class IO_DEFINE
  70. {
  71. public IO_DEFINE()
  72. {
  73. Dig_In = new DI_ITEM[64];
  74. Dig_Out = new DO_ITEM[64];
  75. Ana_In = new AI_ITEM[64];
  76. Ana_Out = new AO_ITEM[64];
  77. for (int i = 0; i < 64; i++)
  78. {
  79. Dig_In[i] = new DI_ITEM() { Index = i };
  80. Dig_Out[i] = new DO_ITEM() { Index = i };
  81. }
  82. for (int i = 0; i < 64; i++)
  83. {
  84. Ana_In[i] = new AI_ITEM() { Index = i };
  85. Ana_Out[i] = new AO_ITEM() { Index = i };
  86. }
  87. }
  88. public DI_ITEM[] Dig_In;
  89. public DO_ITEM[] Dig_Out;
  90. public AI_ITEM[] Ana_In;
  91. public AO_ITEM[] Ana_Out;
  92. }
  93. }