ExchangeTask.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Sorter.Common;
  3. using athosRT.Devices.EFEM.ABS;
  4. using MECF.Framework.Common.Equipment;
  5. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace athosRT.Devices.EFEM.Task
  12. {
  13. public class ExchangeTask : CheckImp, ITask
  14. {
  15. public bool Execute(out string result, params string[] args)
  16. {
  17. string str = "Robot";
  18. this.GetEntity(str);
  19. ModuleName target = ModuleName.System;
  20. int slot = 1;
  21. if (!this.ParseMoveTarget(args[0], out target, out slot))
  22. {
  23. result = "PARAM_NG";
  24. return false;
  25. }
  26. Hand arm1 = Hand.Blade2;
  27. if (!this.ParseMoveArm(args[1], out arm1))
  28. {
  29. result = "PARAM_NG";
  30. return false;
  31. }
  32. Hand arm2 = Hand.Blade2;
  33. if (!this.ParseMoveArm(args[2], out arm2))
  34. {
  35. result = "PARAM_NG";
  36. return false;
  37. }
  38. if (!this.Check<NoReadyPolicy>(str, out result) || !this.Check<NoInitCompletedPolicy>(str, out result) || !this.Check<NoOriginCompletedPolicy>(str, out result) || !this.Check<VacPolicy>(str, out result) || !this.Check<EMSPolicy>(str, out result) || !this.Check<ErrorPolicy>(str, out result) || !this.Check<BusyPolicy>(str, out result) || !this.Check<HoldPolicy>(str, out result) || !this.Check<RemovePolicy>(str, out result) || !this.Check<MaintenancePolicy>(str, out result) || !this.Check<LinkPolicy>(str, out result) || !this.Check<PowerDownPolicy>(str, out result))
  39. return false;
  40. DEVICE.GetDevice<RobotBaseDevice>(str);
  41. return true;
  42. }
  43. public bool? Monitor(out string result, params string[] args)
  44. {
  45. result = string.Empty;
  46. RobotBaseDevice device = DEVICE.GetDevice<RobotBaseDevice>("Robot");
  47. if (device.IsError)
  48. {
  49. this.flag1 = ErrorCheckList1.VAC | ErrorCheckList1.AIR | ErrorCheckList1.STALL | ErrorCheckList1.LIMIT | ErrorCheckList1.SENSOR | ErrorCheckList1.POSITION | ErrorCheckList1.EMS | ErrorCheckList1.COMM | ErrorCheckList1.COMM2 | ErrorCheckList1.VACON | ErrorCheckList1.VACOFF | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  50. this.flag2 = ErrorCheckList2.RRTWAF | ErrorCheckList2.CRSWAF | ErrorCheckList2.THICKWAF | ErrorCheckList2.THINWAF | ErrorCheckList2.DBLWAF | ErrorCheckList2.BAOWAF | ErrorCheckList2.COMMAND | ErrorCheckList2.PODNG | ErrorCheckList2.PODMISMATCH | ErrorCheckList2.VAC_S | ErrorCheckList2.CLAMP_S | ErrorCheckList2.SAFTY | ErrorCheckList2.LOCKNG | ErrorCheckList2.UNLOCKNG | ErrorCheckList2.L_KEY_LK | ErrorCheckList2.L_KEY_UL;
  51. this.flag3 = ErrorCheckList3.MAP_S | ErrorCheckList3.MAP_S1 | ErrorCheckList3.MAP_S2 | ErrorCheckList3.WAFLOST | ErrorCheckList3.ALIGNNG | ErrorCheckList3.DRIVER | ErrorCheckList3.DRPOWERDOWN | ErrorCheckList3.HARDWARE | ErrorCheckList3.INTERNAL | ErrorCheckList3.E84_TIMEOUTx | ErrorCheckList3.E84_CS_VALID | ErrorCheckList3.READFAIL;
  52. return new bool?(this.CheckError("Robot", out result));
  53. }
  54. return device.IsReady() ? new bool?(true) : new bool?();
  55. }
  56. }
  57. }