Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

257 lignes
7.6 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using HBLConsole.Interface;
  7. using System.Collections.Concurrent;
  8. using HBLConsole.Attributes;
  9. using HBLConsole.Model;
  10. namespace HBLConsole.MORKS
  11. {
  12. /// <summary>
  13. /// MORKS 设备数据
  14. /// </summary>
  15. public class GVL_MORKS : IGvl
  16. {
  17. /// <summary>
  18. /// 机器人取面
  19. /// PLC -> M0.3
  20. /// ModbusTcp -> 323
  21. /// </summary>
  22. public bool RobotTakeNoodle { get; set; }
  23. /// <summary>
  24. /// 机器人出餐
  25. /// PLC -> M0.4
  26. /// ModbusTcp -> 324
  27. /// </summary>
  28. public bool RobotOutMeal { get; set; }
  29. /// <summary>
  30. /// 移动转台
  31. /// PLC -> M0.5
  32. /// ModbusTcp -> 325
  33. /// </summary>
  34. public bool MoveTurntable { get; set; }
  35. #region 临时变量
  36. /// <summary>
  37. /// 允许运行
  38. /// </summary>
  39. [Circuit(new string[] { "机器人取面", "取碗控制" }, "允许运行")]
  40. public bool AllowRun { get; set; }
  41. /// <summary>
  42. /// //机器人任务互锁信号
  43. /// </summary>
  44. [Circuit(new string[] { "机器人取面", "出面控制" }, "机器人互锁", new bool[] { true, false })]
  45. public bool RobotTaskInterlock { get; set; }
  46. /// <summary>
  47. /// 取碗互锁信号
  48. /// </summary>
  49. [Circuit("取碗控制", "取碗互锁", true)]
  50. public bool TakeBowlInterlock { get; set; }
  51. /// <summary>
  52. /// 取面互锁信号
  53. /// </summary>
  54. [Circuit(new string[] { "机器人取面", "出面控制" }, "取面互锁信号", new bool[] { true, true })]
  55. public bool TakeNoodleInterlock { get; set; }
  56. /// <summary>
  57. /// 出面中
  58. /// </summary>
  59. [Circuit("机器人取面", "出面中", true)]
  60. public bool OutNoodleing { get; set; }
  61. /// <summary>
  62. /// 允许取面
  63. /// </summary>
  64. [Circuit(new string[] { "转台控制", "机器人取面" }, "允许取面", new bool[] { true, false })]
  65. public bool AllowTakeNoodle { get; set; }
  66. /// <summary>
  67. /// 转台互锁信号
  68. /// </summary>
  69. public bool TurntableInterlock { get; set; }
  70. #endregion
  71. /// <summary>
  72. /// 初始化完成
  73. /// PLC -> M100.0
  74. /// ModbusTcp -> 1120
  75. /// </summary>
  76. [Circuit(new string[] { "允许运行", "转台控制", "转台控制" }, "初始化完成")]
  77. public bool InitComplete { get; set; }
  78. /// <summary>
  79. /// 取碗机构空闲,True:忙碌,false:空闲
  80. /// PLC -> M100.1
  81. /// ModbusTcp -> 1121
  82. /// </summary>
  83. [Circuit("取碗控制", "取碗机构空闲", true)]
  84. public bool TakeBowlIdle { get; set; }
  85. /// <summary>
  86. /// 温度到达,True:表示到达,false:未到达
  87. /// PLC -> M100.2
  88. /// ModbusTcp -> 1122
  89. /// </summary>
  90. [Circuit("允许运行", "温度到达")]
  91. public bool TemperatureReached { get; set; }
  92. /// <summary>
  93. /// 允许到面,配料完成
  94. /// PLC -> M100.3
  95. /// ModbusTcp -> 1123
  96. /// </summary>
  97. [Circuit("出面控制", "允许到面")]
  98. public bool AllowFallNoodle { get; set; }
  99. /// <summary>
  100. /// 机器人取面完成
  101. /// PLC -> M100.4
  102. /// ModbusTcp -> 1124
  103. /// </summary>
  104. public bool RbTakeNoodleComplete { get; set; }
  105. /// <summary>
  106. /// 机器人倒面完成
  107. /// PLC -> M100.5
  108. /// ModbusTcp -> 1125
  109. /// </summary>
  110. public bool RbFallNoodleComplete { get; set; }
  111. /// <summary>
  112. /// 机器人出餐完成,上报取餐完成
  113. /// PLC -> M100.6
  114. /// ModbusTcp -> 1126
  115. /// </summary>
  116. public bool RbOutMealComplete { get; set; }
  117. /// <summary>
  118. /// 机器人空闲
  119. /// PLC -> M100.7
  120. /// ModbusTcp -> 1127
  121. /// </summary>
  122. [Circuit(new string[] { "机器人取面", "出面控制" }, "机器人空闲")]
  123. public bool RobotIdle { get; set; }
  124. /// <summary>
  125. /// 取餐口检测
  126. /// PLC -> M101.0
  127. /// ModbusTcp -> 1128
  128. /// </summary>
  129. [Circuit("出面控制", "取餐口检测", true)]
  130. public bool TakeMealDetect { get; set; }
  131. /// <summary>
  132. /// 缺碗信号,false:缺碗,true:有碗
  133. /// PLC -> M101.1
  134. /// ModbusTcp -> 1129
  135. /// </summary>
  136. public bool MissingBowl { get; set; }
  137. /// <summary>
  138. /// 设备初始化中,执行中等于1,2秒后复位
  139. /// PLC -> M101.2
  140. /// ModbusTcp -> 1130
  141. /// </summary>
  142. public bool DeviceIniting { get; set; }
  143. /// <summary>
  144. /// 转台下限检测
  145. /// PLC -> M101.3
  146. /// ModbusTcp -> 1131
  147. /// </summary>
  148. [Circuit("转台控制", "转台下限检测有物料")]
  149. public bool TurntableLowerLimit { get; set; }
  150. /// <summary>
  151. /// 缺碗信号 2
  152. /// PLC -> M101.4
  153. /// ModbusTcp -> 1132
  154. /// </summary>
  155. public bool MissingBowlSignal2 { get; set; }
  156. /// <summary>
  157. /// 转台上限检测
  158. /// PLC -> M101.5
  159. /// ModbusTcp -> 1133
  160. /// </summary>
  161. public bool TurntableUpLimit { get; set; }
  162. /// <summary>
  163. /// 转台移动到位
  164. /// PLC -> M101.7
  165. /// ModbusTcp -> 1135
  166. /// </summary>
  167. [Circuit(new string[] { "转台控制", "机器人取面" }, "转台移动到位")]
  168. public bool TurntableMoveInPlace { get; set; }
  169. /// <summary>
  170. /// 煮面炉状态,True:忙碌,false:空闲
  171. /// M102.0 - M102.5
  172. /// 1136 - 1141
  173. /// </summary>
  174. public bool[] NoodleCookerStatus { get; set; } = new bool[6] { false, false, false, false, false, false };
  175. /// <summary>
  176. /// 煮面完成,上升后给信号
  177. /// M103.0 - M103.5
  178. /// 1144 - 1149
  179. /// </summary>
  180. public bool[] CookNoodlesComplete { get; set; } = new bool[6] { false, false, false, false, false, false };
  181. /// <summary>
  182. /// 配方编号
  183. /// PLC -> VW0
  184. /// ModbusTcp -> 100
  185. /// </summary>
  186. public ushort RecipeNumber { get; set; }
  187. /// <summary>
  188. /// 转台位置
  189. /// PLC -> VW2
  190. /// ModbusTcp -> 101
  191. /// </summary>
  192. public ushort TurntableLoc { get; set; }
  193. /// <summary>
  194. /// 到面至煮面炉位置
  195. /// PLC -> VW4
  196. /// ModbusTcp -> 102
  197. /// </summary>
  198. public ushort FallNoodleLoc { get; set; }
  199. /// <summary>
  200. /// 取面位置
  201. /// PLC -> VW6
  202. /// ModbusTcp -> 103
  203. /// </summary>
  204. public ushort TakeNoodleLoc { get; set; }
  205. /// <summary>
  206. /// 机器人取面位置队列
  207. /// </summary>
  208. [Circuit(new string[] { "转台控制", "机器人取面" }, "有机器人取面队列")]
  209. public ConcurrentQueue<OrderLocInfo> RBTakeNoodleTask { get; set; } = new ConcurrentQueue<OrderLocInfo>();
  210. /// <summary>
  211. /// 出碗队列
  212. /// </summary>
  213. [Circuit("取碗控制", "有取碗队列数量")]
  214. public ConcurrentQueue<OrderLocInfo> TakeBowlTask { get; set; } = new ConcurrentQueue<OrderLocInfo>();
  215. /// <summary>
  216. /// 是否有面条
  217. /// </summary>
  218. public bool IsNoodles { get; set; } = true;
  219. }
  220. }