FutureEfemLoadPort3P.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. using System;
  2. using System.Collections;
  3. using Aitex.Core.Common;
  4. using Aitex.Core.RT.DataCenter;
  5. using Aitex.Core.RT.Device;
  6. using Aitex.Core.RT.Event;
  7. using Aitex.Core.RT.Log;
  8. using Aitex.Core.RT.OperationCenter;
  9. using Aitex.Core.RT.SCCore;
  10. using Aitex.Core.Util;
  11. using Aitex.Sorter.Common;
  12. using MECF.Framework.Common.Equipment;
  13. using MECF.Framework.Common.FAServices;
  14. using MECF.Framework.Common.SubstrateTrackings;
  15. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Efems.Rorzes;
  16. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  17. namespace JetEfemLib.LPs
  18. {
  19. public class FutureEfemLoadPort3P : FutureEfemLoadPortBase
  20. {
  21. public FutureEfemLoadPort3P(string module, string name, string efem) : base(module, name, efem)
  22. {
  23. }
  24. public override bool IsBusy => _loadPortState != LoadPortStates.Idle;
  25. public override bool Initialize()
  26. {
  27. if (_efem == null && !string.IsNullOrEmpty(_efemName))
  28. {
  29. _efem = DEVICE.GetDevice<FutureEfem3P>(_efemName);
  30. _efem.SetLoadPortCallback(ModuleHelper.Converter(Module), this);
  31. }
  32. return base.Initialize();
  33. }
  34. public override void NoteStatus(string data1, string data2)
  35. {
  36. uint result1 = Convert.ToUInt32(data1, 16);
  37. uint result2 = Convert.ToUInt32(data2, 16);
  38. BitArray bitData1 = new BitArray(new int[] { Convert.ToInt32(data1, 16) });
  39. BitArray bitData2 = new BitArray(new int[] { Convert.ToInt32(data2, 16) });
  40. //placement bit 0
  41. //present bit 1
  42. //access sw bit 2
  43. //clampState bit 3
  44. //doorState bit 4
  45. //dockState bit 5
  46. //wafer size 8 bit 6
  47. //wafer size 12 bit 7
  48. bool placement = (result1 & 0x00000001u) == 0x00000001u;
  49. bool present = !((result1 & 0x00000002u) == 0x00000002u);
  50. SetPresent(present);
  51. SetPlaced(placement);
  52. _isAccessSwPressed = (result1 & 0x00000004u) == 0x00000004u;
  53. _clampState = (result1 & 0x00000008u) == 0x00000008u ? FoupClampState.Close : FoupClampState.Open;
  54. _doorState = (result1 & 0x00000010u) == 0x00000010u ? FoupDoorState.Open : FoupDoorState.Close;
  55. _dockState = (result1 & 0x00000020u) == 0x00000020u ? FoupDockState.Docked : FoupDockState.Undocked;
  56. bool isWS8 = (result1 & 0x00000040u) == 0x00000040u;
  57. bool isWS12 = (result1 & 0x00000080u) == 0x00000080u;
  58. if (IsPlacement)
  59. {
  60. if (isWS8 == isWS12)
  61. {
  62. EV.PostAlarmLog(LPModuleName.ToString(), "Get WaferSize Data Abnormal , pls check config");
  63. }
  64. else if (isWS8)
  65. {
  66. WaferSize = WaferSize.WS8;
  67. CarrierManager.Instance.UpdateWaferSize(LPModuleName, 0, WaferSize);
  68. }
  69. else if (isWS12)
  70. {
  71. WaferSize = WaferSize.WS12;
  72. CarrierManager.Instance.UpdateWaferSize(LPModuleName, 0, WaferSize);
  73. }
  74. }
  75. IndicatorVALID = GetIndicatorState((result1 & 0x01000000u) == 0x01000000u); //bit24
  76. IndicatorCS0 = GetIndicatorState((result1 & 0x02000000u) == 0x02000000u); //bit25
  77. IndicatorCS1 = GetIndicatorState((result1 & 0x04000000u) == 0x04000000u); //bit26
  78. IndicatorTR_REQ = GetIndicatorState((result1 & 0x10000000u) == 0x10000000u); //bit28
  79. IndicatorBUSY = GetIndicatorState((result1 & 0x20000000u) == 0x20000000u); //bit29
  80. IndicatorCOMPT = GetIndicatorState((result1 & 0x40000000u) == 0x40000000u); //bit30
  81. IndicatorCONT = GetIndicatorState((result1 & 0x80000000u) == 0x80000000u); //bit31
  82. //E84Signal.VALID = (result1 & 0x01000000u) == 0x01000000u //bit 24
  83. //E84Signal.CS_0 = (result1 & 0x02000000u) == 0x02000000u //bit 25
  84. //E84Signal.CS_1 = (result1 & 0x04000000u) == 0x04000000u //bit 26
  85. //E84Signal.TR_REQ = (result1 & 0x10000000u) == 0x10000000u //bit 28
  86. //E84Signal.BUSY = (result1 & 0x20000000u) == 0x20000000u //bit 29
  87. //E84Signal.COMPT = (result1 & 0x40000000u) == 0x40000000u //bit 30
  88. //E84Signal.CONT = (result1 & 0x80000000u) == 0x80000000u //bit 31
  89. //check presence light bit 0
  90. //check placement light bit 1
  91. //check load light bit 2
  92. //check unload light bit 3
  93. //check manual mode light bit 4
  94. //check error light bit 5
  95. //check clamp/unclamp light bit 6
  96. //check dock/undock light bit 7
  97. //check access switch light bit 8
  98. IndicatiorPresence = GetIndicatorState(bitData2[0]);
  99. IndicatiorPlacement = GetIndicatorState(bitData2[1]);
  100. IndicatiorLoad = GetIndicatorState(bitData2[2]);
  101. IndicatiorUnload = GetIndicatorState(bitData2[3]);
  102. IndicatiorManualMode = GetIndicatorState(bitData2[4]);
  103. IndicatorAlarm = GetIndicatorState(bitData2[5]);
  104. IndicatiorClampUnclamp = GetIndicatorState(bitData2[6]);
  105. IndicatiorDockUndock = GetIndicatorState(bitData2[7]);
  106. IndicatiorOpAccess = GetIndicatorState(bitData2[8]);
  107. IndicatorL_REQ = GetIndicatorState(bitData2[24]); //bit24
  108. IndicatorU_REQ = GetIndicatorState(bitData2[25]); //bit25
  109. IndicatorREADY = GetIndicatorState(bitData2[27]); //bit27
  110. IndicatorHO_AVBL = GetIndicatorState(bitData2[30]); //bit30
  111. IndicatorES = GetIndicatorState(bitData2[31]); //bit31
  112. //E84Signal.L_REQ = bitData2[24] //bit 24
  113. //E84Signal.U_REQ = bitData2[25] //bit 25
  114. //E84Signal.READY = bitData2[27] //bit 27
  115. //E84Signal.HO_AVBL = bitData2[30] //bit 30
  116. //E84Signal.ES = bitData2[31] //bit 31
  117. CassetteState = IsPlacement ? LoadportCassetteState.Normal : LoadportCassetteState.None;
  118. if (bitData2[5])
  119. {
  120. Error = true;
  121. }
  122. else
  123. {
  124. if (_loadPortState == LoadPortStates.Faulted)
  125. Error = true;
  126. else
  127. Error = false;
  128. }
  129. }
  130. }
  131. }