终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

453 lines
14 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace FryPot_DosingSystem.Control
  7. {
  8. /// <summary>
  9. /// plc变量
  10. /// </summary>
  11. internal class GlobalVariable
  12. {
  13. /// <summary>
  14. /// 滚筒线1
  15. /// </summary>
  16. public RollerLineOne rollerLineOne = new RollerLineOne();
  17. /// <summary>
  18. /// 滚筒线2
  19. /// </summary>
  20. public RollerLineTwo rollerLineTwo = new RollerLineTwo();
  21. /// <summary>
  22. /// 滚筒线3
  23. /// </summary>
  24. public RollerLineThree rollerLineThree = new RollerLineThree();
  25. /// <summary>
  26. /// 炒锅1
  27. /// </summary>
  28. public FryPotOne fryPotOne= new FryPotOne();
  29. /// <summary>
  30. /// 炒锅2
  31. /// </summary>
  32. public FryPotTwo fryPotTwo= new FryPotTwo();
  33. /// <summary>
  34. /// 炒锅3
  35. /// </summary>
  36. public FryPotThree fryPotThree= new FryPotThree();
  37. /// <summary>
  38. /// 炒锅4
  39. /// </summary>
  40. public FryPotFour fryPotFour= new FryPotFour();
  41. /// <summary>
  42. /// 炒锅5
  43. /// </summary>
  44. public FryPotFive fryPotFive= new FryPotFive();
  45. /// <summary>
  46. /// 洗桶进桶滚筒运行信号
  47. /// </summary>
  48. public ushort CleadBarrelEnterSingle { get; set; }
  49. /// <summary>
  50. /// 洗桶出桶滚筒运行信号
  51. /// </summary>
  52. public ushort CleadBarrelExitSingle { get; set; }
  53. /// <summary>
  54. /// PLC初始化状态
  55. /// </summary>
  56. public ushort PlcInite { get; set; }
  57. #region 上位机内部逻辑条件
  58. /// <summary>
  59. /// 退出主任务循环
  60. /// </summary>
  61. public bool ExitMainTask { get; set; }
  62. /// <summary>
  63. /// 允许AGV去线体1装桶条件
  64. /// </summary>
  65. public bool AllowAgvToLineLoadRoller { get; set; } = true;
  66. /// <summary>
  67. /// 允许AGV去线体2装桶条件
  68. /// </summary>
  69. public bool AllowAgvToLineTwoLoadRoller { get; set; } = true;
  70. /// <summary>
  71. /// 允许AGV去线体3装桶条件
  72. /// </summary>
  73. public bool AllowAgvToLineThreeLoadRoller { get; set; } = true;
  74. /// <summary>
  75. /// 配方唯一ID
  76. /// </summary>
  77. public string RecipeId { get; set; }
  78. /// <summary>
  79. /// 线体1对应的进桶出桶互锁
  80. /// </summary>
  81. public bool InOrOutputLock { get; set; }
  82. /// <summary>
  83. /// 线体2对应的进桶出桶互锁
  84. /// </summary>
  85. public bool LTwoInOrOutputLock { get; set; }
  86. /// <summary>
  87. /// 线体3对应的进桶出桶互锁
  88. /// </summary>
  89. public bool LThreeInOrOutputLock { get; set; }
  90. /// <summary>
  91. /// 线体1任务执行锁
  92. /// </summary>
  93. public bool LOneTaskLock { get; set; }
  94. /// <summary>
  95. /// 线体2任务执行锁
  96. /// </summary>
  97. public bool LTwoTaskLock { get; set; }
  98. /// <summary>
  99. /// 线体3任务执行锁
  100. /// </summary>
  101. public bool LThreeTaskLock { get; set; }
  102. /// <summary>
  103. /// 线体1当前正在制作的配方名称
  104. /// </summary>
  105. public string LOneCurrentRecipeName { get; set; } = string.Empty;
  106. /// <summary>
  107. /// 线体2当前正在制作的配方名称
  108. /// </summary>
  109. public string LTwoCurrentRecipeName { get; set; } = string.Empty;
  110. /// <summary>
  111. /// 线体3当前正在制作的配方名称
  112. /// </summary>
  113. public string LThreeCurrentRecipeName { get; set; } = string.Empty;
  114. #endregion
  115. }
  116. /// <summary>
  117. /// 滚筒线1相关变量
  118. /// </summary>
  119. public class RollerLineOne
  120. {
  121. /// <summary>
  122. /// 工位号1
  123. /// </summary>
  124. public ushort StationOne { get; set; }
  125. /// <summary>
  126. /// 工位号2
  127. /// </summary>
  128. public ushort StationTwo { get; set; }
  129. /// <summary>
  130. /// 工位号3
  131. /// </summary>
  132. public ushort StationThree { get; set; }
  133. /// <summary>
  134. /// 工位号4
  135. /// </summary>
  136. public ushort StationFour { get; set; }
  137. /// <summary>
  138. /// 工位号5
  139. /// </summary>
  140. public ushort StationFive { get; set; }
  141. /// <summary>
  142. /// 工位号6
  143. /// </summary>
  144. public ushort StationSix { get; set; }
  145. /// <summary>
  146. /// 工位号7
  147. /// </summary>
  148. public ushort StationSeven { get; set; }
  149. /// <summary>
  150. /// 工位号8
  151. /// </summary>
  152. public ushort StationEight { get; set; }
  153. /// <summary>
  154. /// 输送出料滚筒运行信号
  155. /// </summary>
  156. public ushort OutMaterialingSingle { get; set; }
  157. /// <summary>
  158. /// 输送出料滚筒运行故障信号
  159. /// </summary>
  160. public ushort OutMaterialingTroubleSingle { get; set; }
  161. /// <summary>
  162. /// 当前线体配方完成信号
  163. /// </summary>
  164. public ushort RecipeCompleteSingle { get; set; }
  165. }
  166. /// <summary>
  167. /// 滚筒线2相关变量
  168. /// </summary>
  169. public class RollerLineTwo
  170. {
  171. /// <summary>
  172. /// 工位号1
  173. /// </summary>
  174. public ushort StationOne { get; set; }
  175. /// <summary>
  176. /// 工位号2
  177. /// </summary>
  178. public ushort StationTwo { get; set; }
  179. /// <summary>
  180. /// 工位号3
  181. /// </summary>
  182. public ushort StationThree { get; set; }
  183. /// <summary>
  184. /// 工位号4
  185. /// </summary>
  186. public ushort StationFour { get; set; }
  187. /// <summary>
  188. /// 工位号5
  189. /// </summary>
  190. public ushort StationFive { get; set; }
  191. /// <summary>
  192. /// 工位号6
  193. /// </summary>
  194. public ushort StationSix { get; set; }
  195. /// <summary>
  196. /// 工位号7
  197. /// </summary>
  198. public ushort StationSeven { get; set; }
  199. /// <summary>
  200. /// 工位号8
  201. /// </summary>
  202. public ushort StationEight { get; set; }
  203. /// <summary>
  204. /// 输送出料滚筒运行信号
  205. /// </summary>
  206. public ushort OutMaterialingSingle { get; set; }
  207. /// <summary>
  208. /// 输送出料滚筒运行故障信号
  209. /// </summary>
  210. public ushort OutMaterialingTroubleSingle { get; set; }
  211. /// <summary>
  212. /// 当前线体配方完成信号
  213. /// </summary>
  214. public ushort RecipeCompleteSingle { get; set; }
  215. }
  216. /// <summary>
  217. /// 滚筒线3相关变量
  218. /// </summary>
  219. public class RollerLineThree
  220. {
  221. /// <summary>
  222. /// 工位号1
  223. /// </summary>
  224. public ushort StationOne { get; set; }
  225. /// <summary>
  226. /// 工位号2
  227. /// </summary>
  228. public ushort StationTwo { get; set; }
  229. /// <summary>
  230. /// 工位号3
  231. /// </summary>
  232. public ushort StationThree { get; set; }
  233. /// <summary>
  234. /// 工位号4
  235. /// </summary>
  236. public ushort StationFour { get; set; }
  237. /// <summary>
  238. /// 工位号5
  239. /// </summary>
  240. public ushort StationFive { get; set; }
  241. /// <summary>
  242. /// 工位号6
  243. /// </summary>
  244. public ushort StationSix { get; set; }
  245. /// <summary>
  246. /// 工位号7
  247. /// </summary>
  248. public ushort StationSeven { get; set; }
  249. /// <summary>
  250. /// 工位号8
  251. /// </summary>
  252. public ushort StationEight { get; set; }
  253. /// <summary>
  254. /// 输送出料滚筒运行信号
  255. /// </summary>
  256. public ushort OutMaterialingSingle { get; set; }
  257. /// <summary>
  258. /// 输送出料滚筒运行故障信号
  259. /// </summary>
  260. public ushort OutMaterialingTroubleSingle { get; set; }
  261. /// <summary>
  262. /// 当前线体配方完成信号
  263. /// </summary>
  264. public ushort RecipeCompleteSingle { get; set; }
  265. }
  266. /// <summary>
  267. /// 滚筒线4相关变量
  268. /// </summary>
  269. public class RollerLineFour
  270. {
  271. /// <summary>
  272. /// 工位号1
  273. /// </summary>
  274. public ushort StationOne { get; set; }
  275. /// <summary>
  276. /// 工位号2
  277. /// </summary>
  278. public ushort StationTwo { get; set; }
  279. /// <summary>
  280. /// 工位号3
  281. /// </summary>
  282. public ushort StationThree { get; set; }
  283. /// <summary>
  284. /// 工位号4
  285. /// </summary>
  286. public ushort StationFour { get; set; }
  287. /// <summary>
  288. /// 工位号5
  289. /// </summary>
  290. public ushort StationFive { get; set; }
  291. /// <summary>
  292. /// 工位号6
  293. /// </summary>
  294. public ushort StationSix { get; set; }
  295. /// <summary>
  296. /// 工位号7
  297. /// </summary>
  298. public ushort StationSeven { get; set; }
  299. /// <summary>
  300. /// 工位号8
  301. /// </summary>
  302. public ushort StationEight { get; set; }
  303. /// <summary>
  304. /// 输送出料滚筒运行信号
  305. /// </summary>
  306. public ushort OutMaterialingSingle { get; set; }
  307. /// <summary>
  308. /// 输送出料滚筒运行故障信号
  309. /// </summary>
  310. public ushort OutMaterialingTroubleSingle { get; set; }
  311. /// <summary>
  312. /// 当前线体配方完成信号
  313. /// </summary>
  314. public ushort RecipeCompleteSingle { get; set; }
  315. }
  316. /// <summary>
  317. /// 炒锅1相关变量
  318. /// </summary>
  319. public class FryPotOne
  320. {
  321. /// <summary>
  322. /// 进料滚筒运行信号
  323. /// </summary>
  324. public ushort InputMaterialRollerRunningSingle { get; set; }
  325. /// <summary>
  326. /// 进料到位信号
  327. /// </summary>
  328. public ushort InputMaterialArrivedSingle { get; set; }
  329. /// <summary>
  330. /// 空桶到位信号
  331. /// </summary>
  332. public ushort EmptyBarrelArrivedSingle { get; set; }
  333. /// <summary>
  334. /// 空桶滚筒运行信号
  335. /// </summary>
  336. public ushort EmptyBarrelRollerRunningSingle { get; set; }
  337. /// <summary>
  338. /// 滚筒故障信号
  339. /// </summary>
  340. public ushort RollerTroubleSingle { get; set; }
  341. }
  342. /// <summary>
  343. /// 炒锅2相关变量
  344. /// </summary>
  345. public class FryPotTwo
  346. {
  347. /// <summary>
  348. /// 进料滚筒运行信号
  349. /// </summary>
  350. public ushort InputMaterialRollerRunningSingle { get; set; }
  351. /// <summary>
  352. /// 进料到位信号
  353. /// </summary>
  354. public ushort InputMaterialArrivedSingle { get; set; }
  355. /// <summary>
  356. /// 空桶到位信号
  357. /// </summary>
  358. public ushort EmptyBarrelArrivedSingle { get; set; }
  359. /// <summary>
  360. /// 空桶滚筒运行信号
  361. /// </summary>
  362. public ushort EmptyBarrelRollerRunningSingle { get; set; }
  363. /// <summary>
  364. /// 滚筒故障信号
  365. /// </summary>
  366. public ushort RollerTroubleSingle { get; set; }
  367. }
  368. /// <summary>
  369. /// 炒锅3相关变量
  370. /// </summary>
  371. public class FryPotThree
  372. {
  373. /// <summary>
  374. /// 进料滚筒运行信号
  375. /// </summary>
  376. public ushort InputMaterialRollerRunningSingle { get; set; }
  377. /// <summary>
  378. /// 进料到位信号
  379. /// </summary>
  380. public ushort InputMaterialArrivedSingle { get; set; }
  381. /// <summary>
  382. /// 空桶到位信号
  383. /// </summary>
  384. public ushort EmptyBarrelArrivedSingle { get; set; }
  385. /// <summary>
  386. /// 空桶滚筒运行信号
  387. /// </summary>
  388. public ushort EmptyBarrelRollerRunningSingle { get; set; }
  389. /// <summary>
  390. /// 滚筒故障信号
  391. /// </summary>
  392. public ushort RollerTroubleSingle { get; set; }
  393. }
  394. /// <summary>
  395. /// 炒锅4相关变量
  396. /// </summary>
  397. public class FryPotFour
  398. {
  399. /// <summary>
  400. /// 进料滚筒运行信号
  401. /// </summary>
  402. public ushort InputMaterialRollerRunningSingle { get; set; }
  403. /// <summary>
  404. /// 进料到位信号
  405. /// </summary>
  406. public ushort InputMaterialArrivedSingle { get; set; }
  407. /// <summary>
  408. /// 空桶到位信号
  409. /// </summary>
  410. public ushort EmptyBarrelArrivedSingle { get; set; }
  411. /// <summary>
  412. /// 空桶滚筒运行信号
  413. /// </summary>
  414. public ushort EmptyBarrelRollerRunningSingle { get; set; }
  415. /// <summary>
  416. /// 滚筒故障信号
  417. /// </summary>
  418. public ushort RollerTroubleSingle { get; set; }
  419. }
  420. /// <summary>
  421. /// 炒锅5相关变量
  422. /// </summary>
  423. public class FryPotFive
  424. {
  425. /// <summary>
  426. /// 进料滚筒运行信号
  427. /// </summary>
  428. public ushort InputMaterialRollerRunningSingle { get; set; }
  429. /// <summary>
  430. /// 进料到位信号
  431. /// </summary>
  432. public ushort InputMaterialArrivedSingle { get; set; }
  433. /// <summary>
  434. /// 空桶到位信号
  435. /// </summary>
  436. public ushort EmptyBarrelArrivedSingle { get; set; }
  437. /// <summary>
  438. /// 空桶滚筒运行信号
  439. /// </summary>
  440. public ushort EmptyBarrelRollerRunningSingle { get; set; }
  441. /// <summary>
  442. /// 滚筒故障信号
  443. /// </summary>
  444. public ushort RollerTroubleSingle { get; set; }
  445. }
  446. }