终端一体化运控平台
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.

GlobalVariable.cs 16 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  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. #region 线体1流程互锁变量
  116. public bool LoadRoller { get; set; }
  117. public bool AgvToFryPot { get; set; }
  118. public bool PotOneInputMaterialArrive { get; set; }
  119. public bool PotOneOutputRollerArrive { get; set; }
  120. public bool AgvArrivePot { get; set; }
  121. #endregion
  122. #region 线体2流程互锁变量
  123. public bool LTwoLoadRoller { get; set; }
  124. public bool LTwoAgvToFryPot { get; set; }
  125. public bool LTwoPotInputMaterialArrive { get; set; }
  126. public bool LTwoPotOutputRollerArrive { get; set; }
  127. public bool LTwoAgvArrivePot { get; set; }
  128. #endregion
  129. #region 线体3流程互锁变量
  130. public bool LThreeLoadRoller { get; set; }
  131. public bool LThreeAgvToFryPot { get; set; }
  132. public bool LThreePotInputMaterialArrive { get; set; }
  133. public bool LThreePotOutputRollerArrive { get; set; }
  134. public bool LThreeAgvArrivePot { get; set; }
  135. #endregion
  136. #region AGV视图显示变量
  137. public int LOneMaterialNum = 0;
  138. public int LOneFryPotSerial = 1;
  139. public int LOneCurrentCookingStep = 0;
  140. public bool agvArriveUpLoad;
  141. public bool agvArriveUnLoad;
  142. public bool agvFryPotEmptyRollerArrive;
  143. public bool EmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
  144. public int LTwoMaterialNum = 0;
  145. public int LTwoFryPotSerial = 2;
  146. public int LTwoCurrentCookingStep = 0;
  147. public bool agvArriveLTwoUpLoad;
  148. public bool LTwoagvArriveUnLoad;
  149. public bool LTwoagvFryPotEmptyRollerArrive;
  150. public bool LTwoEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
  151. public int LThreeMaterialNum = 0;
  152. public int LThreeFryPotSerial = 3;
  153. public int LThreeCurrentCookingStep = 0;
  154. public bool agvArriveLThreeUpLoad;
  155. public bool LThreeagvArriveUnLoad;
  156. public bool LThreeagvFryPotEmptyRollerArrive;
  157. public bool LThreeEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
  158. public int LFourRollerNum = 0;
  159. #endregion
  160. }
  161. /// <summary>
  162. /// 滚筒线1相关变量
  163. /// </summary>
  164. public class RollerLineOne
  165. {
  166. /// <summary>
  167. /// 工位号1
  168. /// </summary>
  169. public ushort StationOne { get; set; }
  170. /// <summary>
  171. /// 工位号2
  172. /// </summary>
  173. public ushort StationTwo { get; set; }
  174. /// <summary>
  175. /// 工位号3
  176. /// </summary>
  177. public ushort StationThree { get; set; }
  178. /// <summary>
  179. /// 工位号4
  180. /// </summary>
  181. public ushort StationFour { get; set; }
  182. /// <summary>
  183. /// 工位号5
  184. /// </summary>
  185. public ushort StationFive { get; set; }
  186. /// <summary>
  187. /// 工位号6
  188. /// </summary>
  189. public ushort StationSix { get; set; }
  190. /// <summary>
  191. /// 工位号7
  192. /// </summary>
  193. public ushort StationSeven { get; set; }
  194. /// <summary>
  195. /// 工位号8
  196. /// </summary>
  197. public ushort StationEight { get; set; }
  198. /// <summary>
  199. /// 输送出料滚筒运行信号
  200. /// </summary>
  201. public ushort OutMaterialingSingle { get; set; }
  202. /// <summary>
  203. /// 输送出料滚筒运行故障信号
  204. /// </summary>
  205. public ushort OutMaterialingTroubleSingle { get; set; }
  206. /// <summary>
  207. /// 当前线体配方完成信号
  208. /// </summary>
  209. public ushort RecipeCompleteSingle { get; set; }
  210. }
  211. /// <summary>
  212. /// 滚筒线2相关变量
  213. /// </summary>
  214. public class RollerLineTwo
  215. {
  216. /// <summary>
  217. /// 工位号1
  218. /// </summary>
  219. public ushort StationOne { get; set; }
  220. /// <summary>
  221. /// 工位号2
  222. /// </summary>
  223. public ushort StationTwo { get; set; }
  224. /// <summary>
  225. /// 工位号3
  226. /// </summary>
  227. public ushort StationThree { get; set; }
  228. /// <summary>
  229. /// 工位号4
  230. /// </summary>
  231. public ushort StationFour { get; set; }
  232. /// <summary>
  233. /// 工位号5
  234. /// </summary>
  235. public ushort StationFive { get; set; }
  236. /// <summary>
  237. /// 工位号6
  238. /// </summary>
  239. public ushort StationSix { get; set; }
  240. /// <summary>
  241. /// 工位号7
  242. /// </summary>
  243. public ushort StationSeven { get; set; }
  244. /// <summary>
  245. /// 工位号8
  246. /// </summary>
  247. public ushort StationEight { get; set; }
  248. /// <summary>
  249. /// 输送出料滚筒运行信号
  250. /// </summary>
  251. public ushort OutMaterialingSingle { get; set; }
  252. /// <summary>
  253. /// 输送出料滚筒运行故障信号
  254. /// </summary>
  255. public ushort OutMaterialingTroubleSingle { get; set; }
  256. /// <summary>
  257. /// 当前线体配方完成信号
  258. /// </summary>
  259. public ushort RecipeCompleteSingle { get; set; }
  260. }
  261. /// <summary>
  262. /// 滚筒线3相关变量
  263. /// </summary>
  264. public class RollerLineThree
  265. {
  266. /// <summary>
  267. /// 工位号1
  268. /// </summary>
  269. public ushort StationOne { get; set; }
  270. /// <summary>
  271. /// 工位号2
  272. /// </summary>
  273. public ushort StationTwo { get; set; }
  274. /// <summary>
  275. /// 工位号3
  276. /// </summary>
  277. public ushort StationThree { get; set; }
  278. /// <summary>
  279. /// 工位号4
  280. /// </summary>
  281. public ushort StationFour { get; set; }
  282. /// <summary>
  283. /// 工位号5
  284. /// </summary>
  285. public ushort StationFive { get; set; }
  286. /// <summary>
  287. /// 工位号6
  288. /// </summary>
  289. public ushort StationSix { get; set; }
  290. /// <summary>
  291. /// 工位号7
  292. /// </summary>
  293. public ushort StationSeven { get; set; }
  294. /// <summary>
  295. /// 工位号8
  296. /// </summary>
  297. public ushort StationEight { get; set; }
  298. /// <summary>
  299. /// 输送出料滚筒运行信号
  300. /// </summary>
  301. public ushort OutMaterialingSingle { get; set; }
  302. /// <summary>
  303. /// 输送出料滚筒运行故障信号
  304. /// </summary>
  305. public ushort OutMaterialingTroubleSingle { get; set; }
  306. /// <summary>
  307. /// 当前线体配方完成信号
  308. /// </summary>
  309. public ushort RecipeCompleteSingle { get; set; }
  310. }
  311. /// <summary>
  312. /// 滚筒线4相关变量
  313. /// </summary>
  314. public class RollerLineFour
  315. {
  316. /// <summary>
  317. /// 工位号1
  318. /// </summary>
  319. public ushort StationOne { get; set; }
  320. /// <summary>
  321. /// 工位号2
  322. /// </summary>
  323. public ushort StationTwo { get; set; }
  324. /// <summary>
  325. /// 工位号3
  326. /// </summary>
  327. public ushort StationThree { get; set; }
  328. /// <summary>
  329. /// 工位号4
  330. /// </summary>
  331. public ushort StationFour { get; set; }
  332. /// <summary>
  333. /// 工位号5
  334. /// </summary>
  335. public ushort StationFive { get; set; }
  336. /// <summary>
  337. /// 工位号6
  338. /// </summary>
  339. public ushort StationSix { get; set; }
  340. /// <summary>
  341. /// 工位号7
  342. /// </summary>
  343. public ushort StationSeven { get; set; }
  344. /// <summary>
  345. /// 工位号8
  346. /// </summary>
  347. public ushort StationEight { get; set; }
  348. /// <summary>
  349. /// 输送出料滚筒运行信号
  350. /// </summary>
  351. public ushort OutMaterialingSingle { get; set; }
  352. /// <summary>
  353. /// 输送出料滚筒运行故障信号
  354. /// </summary>
  355. public ushort OutMaterialingTroubleSingle { get; set; }
  356. /// <summary>
  357. /// 当前线体配方完成信号
  358. /// </summary>
  359. public ushort RecipeCompleteSingle { get; set; }
  360. }
  361. /// <summary>
  362. /// 炒锅1相关变量
  363. /// </summary>
  364. public class FryPotOne
  365. {
  366. /// <summary>
  367. /// 进料滚筒运行信号
  368. /// </summary>
  369. public ushort InputMaterialRollerRunningSingle { get; set; }
  370. /// <summary>
  371. /// 进料到位信号
  372. /// </summary>
  373. public ushort InputMaterialArrivedSingle { get; set; }
  374. /// <summary>
  375. /// 空桶到位信号
  376. /// </summary>
  377. public ushort EmptyBarrelArrivedSingle { get; set; }
  378. /// <summary>
  379. /// 空桶滚筒运行信号
  380. /// </summary>
  381. public ushort EmptyBarrelRollerRunningSingle { get; set; }
  382. /// <summary>
  383. /// 滚筒故障信号
  384. /// </summary>
  385. public ushort RollerTroubleSingle { get; set; }
  386. }
  387. /// <summary>
  388. /// 炒锅2相关变量
  389. /// </summary>
  390. public class FryPotTwo
  391. {
  392. /// <summary>
  393. /// 进料滚筒运行信号
  394. /// </summary>
  395. public ushort InputMaterialRollerRunningSingle { get; set; }
  396. /// <summary>
  397. /// 进料到位信号
  398. /// </summary>
  399. public ushort InputMaterialArrivedSingle { get; set; }
  400. /// <summary>
  401. /// 空桶到位信号
  402. /// </summary>
  403. public ushort EmptyBarrelArrivedSingle { get; set; }
  404. /// <summary>
  405. /// 空桶滚筒运行信号
  406. /// </summary>
  407. public ushort EmptyBarrelRollerRunningSingle { get; set; }
  408. /// <summary>
  409. /// 滚筒故障信号
  410. /// </summary>
  411. public ushort RollerTroubleSingle { get; set; }
  412. }
  413. /// <summary>
  414. /// 炒锅3相关变量
  415. /// </summary>
  416. public class FryPotThree
  417. {
  418. /// <summary>
  419. /// 进料滚筒运行信号
  420. /// </summary>
  421. public ushort InputMaterialRollerRunningSingle { get; set; }
  422. /// <summary>
  423. /// 进料到位信号
  424. /// </summary>
  425. public ushort InputMaterialArrivedSingle { get; set; }
  426. /// <summary>
  427. /// 空桶到位信号
  428. /// </summary>
  429. public ushort EmptyBarrelArrivedSingle { get; set; }
  430. /// <summary>
  431. /// 空桶滚筒运行信号
  432. /// </summary>
  433. public ushort EmptyBarrelRollerRunningSingle { get; set; }
  434. /// <summary>
  435. /// 滚筒故障信号
  436. /// </summary>
  437. public ushort RollerTroubleSingle { get; set; }
  438. }
  439. /// <summary>
  440. /// 炒锅4相关变量
  441. /// </summary>
  442. public class FryPotFour
  443. {
  444. /// <summary>
  445. /// 进料滚筒运行信号
  446. /// </summary>
  447. public ushort InputMaterialRollerRunningSingle { get; set; }
  448. /// <summary>
  449. /// 进料到位信号
  450. /// </summary>
  451. public ushort InputMaterialArrivedSingle { get; set; }
  452. /// <summary>
  453. /// 空桶到位信号
  454. /// </summary>
  455. public ushort EmptyBarrelArrivedSingle { get; set; }
  456. /// <summary>
  457. /// 空桶滚筒运行信号
  458. /// </summary>
  459. public ushort EmptyBarrelRollerRunningSingle { get; set; }
  460. /// <summary>
  461. /// 滚筒故障信号
  462. /// </summary>
  463. public ushort RollerTroubleSingle { get; set; }
  464. }
  465. /// <summary>
  466. /// 炒锅5相关变量
  467. /// </summary>
  468. public class FryPotFive
  469. {
  470. /// <summary>
  471. /// 进料滚筒运行信号
  472. /// </summary>
  473. public ushort InputMaterialRollerRunningSingle { get; set; }
  474. /// <summary>
  475. /// 进料到位信号
  476. /// </summary>
  477. public ushort InputMaterialArrivedSingle { get; set; }
  478. /// <summary>
  479. /// 空桶到位信号
  480. /// </summary>
  481. public ushort EmptyBarrelArrivedSingle { get; set; }
  482. /// <summary>
  483. /// 空桶滚筒运行信号
  484. /// </summary>
  485. public ushort EmptyBarrelRollerRunningSingle { get; set; }
  486. /// <summary>
  487. /// 滚筒故障信号
  488. /// </summary>
  489. public ushort RollerTroubleSingle { get; set; }
  490. }
  491. }