FutureEfemLoadPort.cs 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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 FutureEfemLoadPort : FutureEfemLoadPortBase
  20. {
  21. public FutureEfemLoadPort(string module, string name, string efem):base(module, name, efem)
  22. {
  23. }
  24. public override bool Initialize()
  25. {
  26. if (_efem == null && !string.IsNullOrEmpty(_efemName))
  27. {
  28. _efem = DEVICE.GetDevice<FutureEfem>(_efemName);
  29. _efem.SetLoadPortCallback(ModuleHelper.Converter(Module), this);
  30. }
  31. return base.Initialize();
  32. }
  33. public override void NoteStatus(string data1, string data2)
  34. {
  35. uint result1 = Convert.ToUInt32(data1, 16);
  36. uint result2 = Convert.ToUInt32(data2, 16);
  37. BitArray bitData1 = new BitArray(new int[] { Convert.ToInt32(data1, 16) });
  38. BitArray bitData2 = new BitArray(new int[] { Convert.ToInt32(data2, 16) });
  39. //placement bit 0
  40. //present bit 1
  41. //access sw bit 2
  42. //clampState bit 3
  43. //doorState bit 4
  44. //dockState bit 5
  45. //wafer size 8 bit 6
  46. //wafer size 12 bit 7
  47. bool placement = (result1 & 0x00000001u) == 0x00000001u;
  48. bool present = !((result1 & 0x00000002u) == 0x00000002u);
  49. SetPresent(present);
  50. SetPlaced(placement);
  51. _isAccessSwPressed = (result1 & 0x00000004u) == 0x00000004u;
  52. //_clampState = (result1 & 0x00000008u) == 0x00000008u ? FoupClampState.Close : FoupClampState.Open;
  53. _doorState = (result1 & 0x00000020u) == 0x00000020u ? FoupDoorState.Close : FoupDoorState.Open;
  54. _dockState = FoupDockState.Docked;
  55. bool sizecheck1 = (result1 & 0x00000040u) == 0x00000040u;
  56. bool sizecheck2 = (result1 & 0x00000080u) == 0x00000080u;
  57. bool sizecheck3 = (result1 & 0x00000100u) == 0x00000100u;
  58. if (IsPlacement)
  59. {
  60. if (_doorState == FoupDoorState.Close)
  61. {
  62. IsWaferProtrude = !((result1 & 0x00000200u) == 0x00000200u);
  63. if (IsWaferProtrude)
  64. {
  65. EV.PostAlarmLog(Module, "Detect Wafer Protrude !");
  66. }
  67. }
  68. //if (isWS8 == isWS12)
  69. //{
  70. // EV.PostAlarmLog(LPModuleName.ToString(), "Get WaferSize Data Abnormal , pls check config");
  71. //}
  72. if (sizecheck1 && sizecheck2 && sizecheck3)
  73. {
  74. WaferSize = (WaferSize)SC.GetValue<int>("System.BigWafer");
  75. CarrierManager.Instance.UpdateWaferSize(LPModuleName, 0, WaferSize);
  76. }
  77. else if (!sizecheck1 && sizecheck2 && sizecheck3)
  78. {
  79. WaferSize = (WaferSize)SC.GetValue<int>("System.SmallWafer");
  80. CarrierManager.Instance.UpdateWaferSize(LPModuleName, 0, WaferSize);
  81. }
  82. else if (sizecheck1 && !sizecheck2 && sizecheck3)
  83. {
  84. WaferSize = (WaferSize)SC.GetValue<int>("System.MidWafer");
  85. CarrierManager.Instance.UpdateWaferSize(LPModuleName, 0, WaferSize);
  86. }
  87. else if (sizecheck1 && sizecheck2 && !sizecheck3)
  88. {
  89. WaferSize = (WaferSize)SC.GetValue<int>("System.BigWafer");
  90. CarrierManager.Instance.UpdateWaferSize(LPModuleName, 0, WaferSize);
  91. }
  92. }
  93. IndicatorVALID = GetIndicatorState((result1 & 0x01000000u) == 0x01000000u); //bit24
  94. IndicatorCS0 = GetIndicatorState((result1 & 0x02000000u) == 0x02000000u); //bit25
  95. IndicatorCS1 = GetIndicatorState((result1 & 0x04000000u) == 0x04000000u); //bit26
  96. IndicatorTR_REQ = GetIndicatorState((result1 & 0x10000000u) == 0x10000000u); //bit28
  97. IndicatorBUSY = GetIndicatorState((result1 & 0x20000000u) == 0x20000000u); //bit29
  98. IndicatorCOMPT = GetIndicatorState((result1 & 0x40000000u) == 0x40000000u); //bit30
  99. IndicatorCONT = GetIndicatorState((result1 & 0x80000000u) == 0x80000000u); //bit31
  100. //E84Signal.VALID = (result1 & 0x01000000u) == 0x01000000u //bit 24
  101. //E84Signal.CS_0 = (result1 & 0x02000000u) == 0x02000000u //bit 25
  102. //E84Signal.CS_1 = (result1 & 0x04000000u) == 0x04000000u //bit 26
  103. //E84Signal.TR_REQ = (result1 & 0x10000000u) == 0x10000000u //bit 28
  104. //E84Signal.BUSY = (result1 & 0x20000000u) == 0x20000000u //bit 29
  105. //E84Signal.COMPT = (result1 & 0x40000000u) == 0x40000000u //bit 30
  106. //E84Signal.CONT = (result1 & 0x80000000u) == 0x80000000u //bit 31
  107. //check presence light bit 0
  108. //check placement light bit 1
  109. //check load light bit 2
  110. //check unload light bit 3
  111. //check manual mode light bit 4
  112. //check error light bit 5
  113. //check clamp/unclamp light bit 6
  114. //check dock/undock light bit 7
  115. //check access switch light bit 8
  116. IndicatiorPresence = GetIndicatorState(bitData2[0]);
  117. IndicatiorPlacement = GetIndicatorState(bitData2[1]);
  118. IndicatiorLoad = GetIndicatorState(bitData2[2]);
  119. IndicatiorUnload = GetIndicatorState(bitData2[3]);
  120. IndicatiorManualMode = GetIndicatorState(bitData2[4]);
  121. IndicatorAlarm = GetIndicatorState(bitData2[5]);
  122. IndicatiorClampUnclamp = GetIndicatorState(bitData2[6]);
  123. IndicatiorDockUndock = GetIndicatorState(bitData2[7]);
  124. IndicatiorOpAccess = GetIndicatorState(bitData2[8]);
  125. IndicatorL_REQ = GetIndicatorState(bitData2[24]); //bit24
  126. IndicatorU_REQ = GetIndicatorState(bitData2[25]); //bit25
  127. IndicatorREADY = GetIndicatorState(bitData2[27]); //bit27
  128. IndicatorHO_AVBL = GetIndicatorState(bitData2[30]); //bit30
  129. IndicatorES = GetIndicatorState(bitData2[31]); //bit31
  130. //E84Signal.L_REQ = bitData2[24] //bit 24
  131. //E84Signal.U_REQ = bitData2[25] //bit 25
  132. //E84Signal.READY = bitData2[27] //bit 27
  133. //E84Signal.HO_AVBL = bitData2[30] //bit 30
  134. //E84Signal.ES = bitData2[31] //bit 31
  135. CassetteState = IsPlacement ? LoadportCassetteState.Normal : LoadportCassetteState.None;
  136. if (bitData2[5])
  137. {
  138. Error = true;
  139. }
  140. else
  141. {
  142. if (_loadPortState == LoadPortStates.Faulted)
  143. Error = true;
  144. else
  145. Error = false;
  146. }
  147. }
  148. }
  149. }