LoaderLoadRoutine.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.Log;
  3. using Aitex.Core.RT.Routine;
  4. using Aitex.Core.RT.SCCore;
  5. using Aitex.Core.Util;
  6. using MECF.Framework.Common.Equipment;
  7. using MECF.Framework.Common.Routine;
  8. using MECF.Framework.Common.Utilities;
  9. using CyberX8_Core;
  10. using CyberX8_RT.Devices.AXIS;
  11. using CyberX8_RT.Devices.AXIS.CANOpen;
  12. using CyberX8_RT.Modules.PUF;
  13. using CyberX8_RT.Modules;
  14. using System;
  15. using System.Collections.Generic;
  16. using System.Linq;
  17. using System.Text;
  18. using System.Threading.Tasks;
  19. using MECF.Framework.Common.CommonData.Loader;
  20. using CyberX8_RT.Modules.Transporter;
  21. using MECF.Framework.Common.WaferHolder;
  22. using CyberX8_RT.Modules.Loader;
  23. using Aitex.Core.Common;
  24. namespace CyberX8_RT.Devices.Loader
  25. {
  26. public class LoaderLoadRoutine : RoutineBase, IRoutine
  27. {
  28. private enum LoadStep
  29. {
  30. CheckPreCondition,
  31. WSClampOn,
  32. BernoulliN2On,
  33. BernoulliN2OnCheck,
  34. BernoulliBladderOff,
  35. BernoulliBladderOffCheck,
  36. TiltGotoFloat,
  37. TiltGotoFloatWait,
  38. Wait1,
  39. BernoulliBladderOn,
  40. BernoulliBladderOnCheck,
  41. CRSVacuumValue,
  42. CRSVacuumValueCheck,
  43. TiltGotoVertical,
  44. TiltGotoVerticalWait,
  45. CRSGotoUnlock,
  46. CRSGotoUnlockWait,
  47. WSBladderOn,
  48. WSBladderOnCheck,
  49. ShuttleGotoCRS,
  50. ShuttleGotoCRSWait,
  51. CRSGotoSetUp,
  52. CRSGotoSetUpWait,
  53. CRSGotoLock,
  54. CRSGotoLockWait,
  55. CRSShortDistance,
  56. CRSShortDistanceWait,
  57. BernoulliN2Off,
  58. BernoulliN2OffCheck,
  59. WSBladderOff,
  60. WSBladderOffCheck,
  61. Wait2,
  62. CRSVacuumOff,
  63. CRSVacuumOffCheck,
  64. Wait3,
  65. ShuttleGotoMID,
  66. ShuttleGotoMIDWait,
  67. HomingCRSAxis,
  68. HomingCRSAxisWait,
  69. CRSHomedGotoSetUp,
  70. CRSHomedGotoSetUpCheck,
  71. End
  72. }
  73. #region 内部变量
  74. private string _side = "";
  75. private int _crsVacuumReleaseDelayInMilliseconds = 250;
  76. private int _translateOutDelayInMilliseconds = 250;
  77. private int _waferSize = 200;
  78. private double _shortDistance = -0.1;
  79. private JetAxisBase _crsAxis;
  80. private JetAxisBase _tiltAxis;
  81. private JetAxisBase _shuttleAxis;
  82. private JetAxisBase _rotationAxis;
  83. private LoaderCommonDevice _loaderCommonDevice;
  84. private LoaderSideDevice _sideDevice;
  85. private LoaderSideBernoulliBladderRoutine _bernoulliBladderRoutine;
  86. private LoaderSideBernoulliN2PressureRoutine _bernoulliN2PressureRoutine;
  87. private LoaderSideVacuumAndLevelCheckRoutineRoutine _vacuumAndLevelCheckRoutineRoutine;
  88. private LoaderSideVacuumLevelCheckRoutine _vacuumLevelCheckRoutine;
  89. private LoaderSideWhBladderRoutine _whBladderRoutine;
  90. #endregion
  91. /// <summary>
  92. /// 构造函数
  93. /// </summary>
  94. /// <param name="module"></param>
  95. public LoaderLoadRoutine(string module,string side) : base(module)
  96. {
  97. _side = side;
  98. }
  99. /// <summary>
  100. /// 中止
  101. /// </summary>
  102. public void Abort()
  103. {
  104. Runner.Stop("Manual Abort");
  105. }
  106. /// <summary>
  107. /// 监控
  108. /// </summary>
  109. /// <returns></returns>
  110. public RState Monitor()
  111. {
  112. Runner.Run(LoadStep.CheckPreCondition, CheckPreCondition, _delay_1ms)
  113. //1 WSClamp On
  114. .Run(LoadStep.WSClampOn, WaferHolderClampOn, _delay_1ms)
  115. //2 BernoulliN2 On
  116. .Run(LoadStep.BernoulliN2On, () => { return _bernoulliN2PressureRoutine.Start(true) == RState.Running; }, _delay_1ms)
  117. .WaitWithStopCondition(LoadStep.BernoulliN2OnCheck, () => { return CommonFunction.CheckRoutineEndState(_bernoulliN2PressureRoutine); },
  118. () => CheckRoutineStopStatus(_bernoulliN2PressureRoutine, "BernoulliN2 On failed"))
  119. //3 Bernoulli Bladder Off
  120. .Run(LoadStep.BernoulliBladderOff, () => { return _bernoulliBladderRoutine.Start(false) == RState.Running; }, _delay_1ms)
  121. .WaitWithStopCondition(LoadStep.BernoulliBladderOffCheck, () => { return CommonFunction.CheckRoutineEndState(_bernoulliBladderRoutine); },
  122. () => CheckRoutineStopStatus(_bernoulliBladderRoutine, "BernoulliBladder Off failed"))
  123. //4 Tilt Goto Float
  124. .Run(LoadStep.TiltGotoFloat, () => { return AxisPosition(_tiltAxis, "FLOAT"); }, NullFun, _delay_1ms)
  125. .WaitWithStopCondition(LoadStep.TiltGotoFloatWait, () => { return _tiltAxis.Status == RState.End; },
  126. () => CheckAxisMotionStopStatus(_tiltAxis))
  127. //5 等待0.5秒
  128. .Delay(LoadStep.Wait1, 500)
  129. //6 BernoulliBladder On
  130. .Run(LoadStep.BernoulliBladderOn, () => { return _bernoulliBladderRoutine.Start(true) == RState.Running; }, _delay_1ms)
  131. .WaitWithStopCondition(LoadStep.BernoulliBladderOnCheck, () => { return CommonFunction.CheckRoutineEndState(_bernoulliBladderRoutine); },
  132. () => CheckRoutineStopStatus(_bernoulliBladderRoutine, "BernoulliBladder On failed"))
  133. //7 CRS Vacuum Check
  134. .Run(LoadStep.CRSVacuumValue, () => { return _vacuumLevelCheckRoutine.Start(true) == RState.Running; }, _delay_1ms)
  135. .WaitWithStopCondition(LoadStep.CRSVacuumValueCheck, () => { return CommonFunction.CheckRoutineEndState(_vacuumLevelCheckRoutine); },
  136. () => CheckRoutineStopStatus(_vacuumLevelCheckRoutine, "CRS Vacuum Check failed"))
  137. //8 Tilt Goto Vertical
  138. .Run(LoadStep.TiltGotoVertical, () => { return AxisPosition(_tiltAxis, "VERT"); }, NullFun, _delay_1ms)
  139. .WaitWithStopCondition(LoadStep.TiltGotoVerticalWait, () => { return _tiltAxis.Status == RState.End; },
  140. () => CheckAxisMotionStopStatus(_tiltAxis))
  141. //9 CRS Goto Unlock
  142. .Run(LoadStep.CRSGotoUnlock, () => { return AxisPosition(_crsAxis, $"Unlock{_waferSize}"); }, NullFun, _delay_1ms)
  143. .WaitWithStopCondition(LoadStep.CRSGotoUnlockWait, () => { return _crsAxis.Status == RState.End; },
  144. () => CheckAxisMotionStopStatus(_crsAxis))
  145. //10 WS Bladder On
  146. .Run(LoadStep.WSBladderOn, () => { return _whBladderRoutine.Start(true) == RState.Running; }, _delay_1ms)
  147. .WaitWithStopCondition(LoadStep.WSBladderOnCheck, () => { return CommonFunction.CheckRoutineEndState(_whBladderRoutine); },
  148. () => CheckRoutineStopStatus(_whBladderRoutine, "WSBladder On failed"))
  149. //11 Shuttle Goto CRS
  150. .Run(LoadStep.ShuttleGotoCRS, () => { return AxisPosition(_shuttleAxis, "LS"); }, NullFun, _delay_1ms)
  151. .WaitWithStopCondition(LoadStep.ShuttleGotoCRSWait, () => { return _shuttleAxis.Status == RState.End; },
  152. () => CheckAxisMotionStopStatus(_shuttleAxis))
  153. //12 CRS Goto SetUp
  154. .Run(LoadStep.CRSGotoSetUp, () => { return AxisPosition(_crsAxis, $"Setup{_waferSize}"); }, NullFun, _delay_1ms)
  155. .WaitWithStopCondition(LoadStep.CRSGotoSetUpWait, () => { return _crsAxis.Status == RState.End; },
  156. () => CheckAxisMotionStopStatus(_crsAxis))
  157. //13 CRS Goto Lock
  158. .Run(LoadStep.CRSGotoLock, () => { return AxisPosition(_crsAxis, $"Lock{_waferSize}"); }, NullFun, _delay_1ms)
  159. .WaitWithStopCondition(LoadStep.CRSGotoLockWait, () => { return _crsAxis.Status == RState.End; },
  160. () => CheckAxisMotionStopStatus(_crsAxis))
  161. .Run(LoadStep.CRSShortDistance, () => { return _crsAxis.ProfilePositionOperation(_crsAxis.MotionData.MotorPosition + _shortDistance); },_delay_1ms)
  162. .WaitWithStopCondition(LoadStep.CRSShortDistanceWait, () => { return _crsAxis.Status == RState.End; },
  163. () => CheckAxisMotionStopStatus(_crsAxis))
  164. //14 Bernoulli N2 Off
  165. .Run(LoadStep.BernoulliN2Off, () => { return _bernoulliN2PressureRoutine.Start(false) == RState.Running; }, _delay_1ms)
  166. .WaitWithStopCondition(LoadStep.BernoulliN2OffCheck, () => { return CommonFunction.CheckRoutineEndState(_bernoulliN2PressureRoutine); },
  167. () => CheckRoutineStopStatus(_bernoulliN2PressureRoutine, "Bernoulli N2 Off failed"))
  168. //15 WS Bladder Off
  169. .Run(LoadStep.WSBladderOff, () => { return _whBladderRoutine.Start(false) == RState.Running; }, _delay_1ms)
  170. .WaitWithStopCondition(LoadStep.WSBladderOffCheck, () => { return CommonFunction.CheckRoutineEndState(_whBladderRoutine); },
  171. () => CheckRoutineStopStatus(_whBladderRoutine, "WS Bladder Off failed"))
  172. //16 等待0.5秒
  173. .Delay(LoadStep.Wait2, 500)
  174. //17 CRS Vacuum Off
  175. .Run(LoadStep.CRSVacuumOff, () => { return _vacuumAndLevelCheckRoutineRoutine.Start(false) == RState.Running; }, _delay_1ms)
  176. .WaitWithStopCondition(LoadStep.CRSVacuumOffCheck, () => { return CommonFunction.CheckRoutineEndState(_vacuumAndLevelCheckRoutineRoutine); },
  177. () => CheckRoutineStopStatus(_vacuumAndLevelCheckRoutineRoutine, "LS Vacuum Off failed"))
  178. //18 等待0.5秒
  179. .Delay(LoadStep.Wait3, 500)
  180. //19 Shuttle Goto Mid
  181. .Run(LoadStep.ShuttleGotoMID, () => { return AxisPosition(_shuttleAxis, "MID"); }, NullFun, _delay_1ms)
  182. .WaitWithStopCondition(LoadStep.ShuttleGotoMIDWait, () => { return _shuttleAxis.Status == RState.End; },
  183. () => CheckAxisMotionStopStatus(_shuttleAxis))
  184. //20 Home CRS Axis
  185. .Run(LoadStep.HomingCRSAxis, CRSHome, _delay_1ms)
  186. .WaitWithStopCondition(LoadStep.HomingCRSAxisWait, () => { return _crsAxis.Status == RState.End; },
  187. () => CheckCRSHomeStopStatus())
  188. .Run(LoadStep.CRSHomedGotoSetUp, () => { return AxisPosition(_crsAxis, $"Setup{_waferSize}"); }, _delay_1ms)
  189. .WaitWithStopCondition(LoadStep.CRSHomedGotoSetUpCheck, () => { return _crsAxis.Status == RState.End; },
  190. () => CheckAxisMotionStopStatus(_crsAxis))
  191. .End(LoadStep.End, UpdateWaferHolderLipCRSUsed);
  192. return Runner.Status;
  193. }
  194. /// <summary>
  195. /// 检验TranslateBladderOff异常状态
  196. /// </summary>
  197. /// <returns></returns>
  198. private bool CheckRoutineStopStatus(IRoutine routine, string error)
  199. {
  200. bool result = CommonFunction.CheckRoutineStopState(routine);
  201. if (result)
  202. {
  203. NotifyError(eEvent.ERR_LOADER, $"{error}", 0);
  204. }
  205. return result;
  206. }
  207. /// <summary>
  208. /// Axis goto position
  209. /// </summary>
  210. /// <param name="axis"></param>
  211. /// <param name="station"></param>
  212. /// <returns></returns>
  213. private bool AxisPosition(JetAxisBase axis, string station)
  214. {
  215. bool result = axis.PositionStation(station);
  216. if (!result)
  217. {
  218. NotifyError(eEvent.ERR_LOADER, $"{axis.Module} goto {station} failed", 0);
  219. }
  220. return result;
  221. }
  222. /// <summary>
  223. /// 检验电机运动异常状态
  224. /// </summary>
  225. /// <param name="axis"></param>
  226. /// <returns></returns>
  227. private bool CheckAxisMotionStopStatus(JetAxisBase axis)
  228. {
  229. bool result = axis.Status == RState.Failed || axis.Status == RState.Timeout;
  230. if (result)
  231. {
  232. NotifyError(eEvent.ERR_LOADER, $"{axis.Module} motion failed", 0);
  233. }
  234. return result;
  235. }
  236. /// <summary>
  237. /// CRS Home
  238. /// </summary>
  239. /// <returns></returns>
  240. private bool CRSHome()
  241. {
  242. bool result = _crsAxis.Home();
  243. if (!result)
  244. {
  245. NotifyError(eEvent.ERR_LOADER, "LS Axis home failed", 0);
  246. }
  247. return result;
  248. }
  249. /// <summary>
  250. /// 检验CRS home异常状态
  251. /// </summary>
  252. /// <returns></returns>
  253. private bool CheckCRSHomeStopStatus()
  254. {
  255. bool result=_crsAxis.Status==RState.Failed||_crsAxis.Status==RState.Timeout;
  256. if (result)
  257. {
  258. NotifyError(eEvent.ERR_LOADER, "LS Axis home failed", 0);
  259. }
  260. return result;
  261. }
  262. /// <summary>
  263. /// 启动
  264. /// </summary>
  265. /// <param name="objs"></param>
  266. /// <returns></returns>
  267. public RState Start(params object[] objs)
  268. {
  269. if (SC.ContainsItem($"Loader1.{_side}WaferSize"))
  270. {
  271. _waferSize = SC.GetValue<int>($"Loader1.{_side}WaferSize");
  272. }
  273. _crsAxis = GetCrsAxis();
  274. _tiltAxis = GetTiltAxis();
  275. _shuttleAxis= GetShuttleAxis();
  276. _loaderCommonDevice = DEVICE.GetDevice<LoaderCommonDevice>($"Loader1.Common");
  277. _rotationAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.Loader1}.Rotation");
  278. _sideDevice = DEVICE.GetDevice<LoaderSideDevice>($"{Module}.{_side}");
  279. _vacuumLevelCheckRoutine = new LoaderSideVacuumLevelCheckRoutine($"{Module}.{_side}");
  280. _whBladderRoutine = new LoaderSideWhBladderRoutine($"{Module}.{_side}");
  281. _bernoulliBladderRoutine = new LoaderSideBernoulliBladderRoutine($"{Module}.{_side}");
  282. _bernoulliN2PressureRoutine = new LoaderSideBernoulliN2PressureRoutine($"{Module}.{_side}");
  283. _vacuumAndLevelCheckRoutineRoutine = new LoaderSideVacuumAndLevelCheckRoutineRoutine($"{Module}.{_side}");
  284. if (SC.ContainsItem("Loader1.LSVacuumReleaseDelayInMilliseconds"))
  285. {
  286. _crsVacuumReleaseDelayInMilliseconds = SC.GetValue<int>("Loader1.LSVacuumReleaseDelayInMilliseconds");
  287. }
  288. if (SC.ContainsItem("Loader1.TranslateOutDelayInMilliseconds"))
  289. {
  290. _translateOutDelayInMilliseconds = SC.GetValue<int>("Loader1.TranslateOutDelayInMilliseconds");
  291. }
  292. Runner.Start(Module, "Load");
  293. return RState.Running;
  294. }
  295. /// <summary>
  296. /// 获取Shuttle轴对象
  297. /// </summary>
  298. /// <returns></returns>
  299. private JetAxisBase GetShuttleAxis()
  300. {
  301. switch (_side)
  302. {
  303. case "SideA":
  304. return DEVICE.GetDevice<JetAxisBase>($"{Module}.ShuttleA");
  305. default:
  306. return DEVICE.GetDevice<JetAxisBase>($"{Module}.ShuttleB");
  307. }
  308. }
  309. /// <summary>
  310. /// 获取CRS轴对象
  311. /// </summary>
  312. /// <returns></returns>
  313. private JetAxisBase GetCrsAxis()
  314. {
  315. switch(_side)
  316. {
  317. case "SideA":
  318. return DEVICE.GetDevice<JetAxisBase>($"{Module}.LSA");
  319. default:
  320. return DEVICE.GetDevice<JetAxisBase>($"{Module}.LSB");
  321. }
  322. }
  323. /// <summary>
  324. /// 获取Tilt轴对象
  325. /// </summary>
  326. /// <returns></returns>
  327. private JetAxisBase GetTiltAxis()
  328. {
  329. switch (_side)
  330. {
  331. case "SideA":
  332. return DEVICE.GetDevice<JetAxisBase>($"{Module}.TiltA");
  333. default:
  334. return DEVICE.GetDevice<JetAxisBase>($"{Module}.TiltB");
  335. }
  336. }
  337. /// <summary>
  338. /// 检验前置条件
  339. /// </summary>
  340. /// <returns></returns>
  341. private bool CheckPreCondition()
  342. {
  343. if(!CheckHomeCondition())
  344. {
  345. return false;
  346. }
  347. if(!CheckAxisCondition())
  348. {
  349. return false;
  350. }
  351. if(!StatusCheck())
  352. {
  353. return false;
  354. }
  355. if(!CRSVacuumCheck())
  356. {
  357. return false;
  358. }
  359. return true;
  360. }
  361. /// <summary>
  362. /// 检验Home条件
  363. /// </summary>
  364. /// <returns></returns>
  365. private bool CheckHomeCondition()
  366. {
  367. //检验PUF、Loader Transporter,Robot均Homed
  368. if (ModuleHelper.IsInstalled(ModuleName.PUF1))
  369. {
  370. PUFEntity puf1Entity = Singleton<RouteManager>.Instance.GetModule<PUFEntity>(ModuleName.PUF1.ToString());
  371. if (!puf1Entity.IsHomed)
  372. {
  373. NotifyError(eEvent.ERR_LOADER, "PUF1 is not homed",-1);
  374. return false;
  375. }
  376. }
  377. if (ModuleHelper.IsInstalled(ModuleName.Loader1))
  378. {
  379. LoaderEntity loaderEntity = Singleton<RouteManager>.Instance.GetModule<LoaderEntity>(ModuleName.Loader1.ToString());
  380. if (!loaderEntity.IsHomed)
  381. {
  382. NotifyError(eEvent.ERR_LOADER, "Loader is not homed", -1);
  383. return false;
  384. }
  385. }
  386. if (ModuleHelper.IsInstalled(ModuleName.Transporter2))
  387. {
  388. TransporterEntity loaderTransportEntity = Singleton<RouteManager>.Instance.GetModule<TransporterEntity>(ModuleName.Transporter2.ToString());
  389. if (!loaderTransportEntity.IsHomed)
  390. {
  391. NotifyError(eEvent.ERR_LOADER, "Loader Transporter is not homed",-1);
  392. return false;
  393. }
  394. }
  395. return true;
  396. }
  397. /// <summary>
  398. /// 检验Axis位置
  399. /// </summary>
  400. /// <param name="side"></param>
  401. /// <returns></returns>
  402. private bool CheckAxisCondition()
  403. {
  404. if(!_rotationAxis.IsHomed)
  405. {
  406. NotifyError(eEvent.ERR_LOADER, $"rotation is not homed",-1);
  407. return false;
  408. }
  409. if (!_shuttleAxis.IsHomed)
  410. {
  411. NotifyError(eEvent.ERR_LOADER, $"{_shuttleAxis.Name} is not homed",-1);
  412. return false;
  413. }
  414. if (!_tiltAxis.IsHomed)
  415. {
  416. NotifyError(eEvent.ERR_LOADER, $"{_tiltAxis.Name} is not homed", -1);
  417. return false;
  418. }
  419. if (!_crsAxis.IsHomed)
  420. {
  421. NotifyError(eEvent.ERR_LOADER, $"{_crsAxis.Name} is not homed",-1);
  422. return false;
  423. }
  424. double rotationPosition = _rotationAxis.MotionData.MotorPosition; //校验rotation是否再load位置
  425. if (!_rotationAxis.CheckPositionIsInStation(rotationPosition, $"LOAD{_side.Substring(_side.Length- 1)}{_waferSize}"))
  426. {
  427. NotifyError(eEvent.ERR_LOADER, $"rotation {rotationPosition} not in LOAD{_side.Substring(_side.Length - 1)}{_waferSize}", -1);
  428. return false;
  429. }
  430. double shuttlePosition=_shuttleAxis.MotionData.MotorPosition;//校验shuttle位置是否再out位置
  431. if (!_shuttleAxis.CheckPositionIsInStation(shuttlePosition, $"OUT{_waferSize}"))
  432. {
  433. NotifyError(eEvent.ERR_LOADER, $"shuttle {shuttlePosition} not in $OUT{_waferSize}",-1);
  434. return false;
  435. }
  436. double tiltPosition = _tiltAxis.MotionData.MotorPosition;//校验tilt是否在hori位置
  437. if (!_tiltAxis.CheckPositionIsInStation(tiltPosition, "HORI"))
  438. {
  439. NotifyError(eEvent.ERR_LOADER, $"tilt {tiltPosition} not in HORI", -1);
  440. return false;
  441. }
  442. double crsPosition=_crsAxis.MotionData.MotorPosition;//校验crs是否在setup位置
  443. if (_crsAxis.CheckPositionIsInStation(tiltPosition, $"Setup{_waferSize}"))
  444. {
  445. NotifyError(eEvent.ERR_LOADER, $"crs {crsPosition} not at Setup{_waferSize}",-1);
  446. return false;
  447. }
  448. return true;
  449. }
  450. /// <summary>
  451. /// Wafer Holder Clamp On
  452. /// </summary>
  453. /// <returns></returns>
  454. private bool WaferHolderClampOn()
  455. {
  456. bool result = _loaderCommonDevice.WaferHolderClampOnAction();
  457. if (!result)
  458. {
  459. NotifyError(eEvent.ERR_LOADER, "Wafer Shuttle Clamp on faied", 0);
  460. }
  461. return result;
  462. }
  463. /// <summary>
  464. /// Status Check
  465. /// </summary>
  466. /// <param name="side"></param>
  467. /// <returns></returns>
  468. private bool StatusCheck()
  469. {
  470. //判断是否放置wafershuttle
  471. if (!_loaderCommonDevice.CommonData.WaferHolderPresent)
  472. {
  473. NotifyError(eEvent.ERR_LOADER, "There is no wafer shuttle, can not do load", -1);
  474. return false;
  475. }
  476. return true;
  477. }
  478. /// <summary>
  479. /// CRS Vacuum Check
  480. /// </summary>
  481. /// <param name="side"></param>
  482. /// <returns></returns>
  483. private bool CRSVacuumCheck()
  484. {
  485. LoaderSideData sideData = _sideDevice.SideData;
  486. LoaderCommonData commonData = _loaderCommonDevice.CommonData;
  487. //Bernoulli Bladder
  488. if (!sideData.BernoulliBladder)
  489. {
  490. NotifyError(eEvent.ERR_LOADER, "BernoulliBladder is off", -1);
  491. return false;
  492. }
  493. if (sideData.BernoulliExtended)
  494. {
  495. NotifyError(eEvent.ERR_LOADER, "Bernoulli is Extended", -1);
  496. return false;
  497. }
  498. //Bernoulli N2
  499. if (sideData.BernoulliN2)
  500. {
  501. NotifyError(eEvent.ERR_LOADER, "Bernoulli N2 is On", -1);
  502. return false;
  503. }
  504. //CRS Vacuum检验
  505. if (!sideData.CRSVacuum)
  506. {
  507. NotifyError(eEvent.ERR_LOADER, "LS Vacuum is off",-1);
  508. return false;
  509. }
  510. if (SC.ContainsItem($"{Module}.LSVacuumHighLimit")) //真空值要大于最小设定值
  511. {
  512. double crsVacuumHighLimit = SC.GetValue<double>($"{Module}.LSVacuumHighLimit");
  513. if (sideData.CRSVacuumValue >= crsVacuumHighLimit || sideData.CRSVacuumValue >= 0)
  514. {
  515. NotifyError(eEvent.ERR_LOADER, "LS Vacuum value is invalid", -1);
  516. return false;
  517. }
  518. }
  519. //WS Clamp
  520. if (!commonData.WaferHolderClamp)
  521. {
  522. NotifyError(eEvent.ERR_LOADER, "Wafer Shuttle Clamp is off", -1);
  523. return false;
  524. }
  525. //WS Bladder
  526. if (sideData.WHBladder)
  527. {
  528. NotifyError(eEvent.ERR_LOADER, "WS Bladder is on", -1);
  529. return false;
  530. }
  531. //Drip Tray Fluid
  532. if (commonData.DripTrayFluid)
  533. {
  534. NotifyError(eEvent.ERR_LOADER, "Drip Tray Fluid is on", -1);
  535. return false;
  536. }
  537. //Wafer Shuttle Present
  538. if (!commonData.WaferHolderPresent)
  539. {
  540. NotifyError(eEvent.ERR_LOADER, "Wafer Shuttle is absent",-1);
  541. return false;
  542. }
  543. return true;
  544. }
  545. /// <summary>
  546. /// 更新WaferHolder LipCRS用量
  547. /// </summary>
  548. /// <returns></returns>
  549. private bool UpdateWaferHolderLipCRSUsed()
  550. {
  551. WaferHolderInfo waferHolderInfo = WaferHolderManager.Instance.GetWaferHolder("Loader");
  552. if (waferHolderInfo != null)
  553. {
  554. if (!string.IsNullOrEmpty(waferHolderInfo.CrsAId)&&_side=="SideA")
  555. {
  556. waferHolderInfo.CrsATotalUses++;
  557. WaferHolderManager.Instance.UpdateWaferHolderInfo(waferHolderInfo);
  558. }
  559. if (!string.IsNullOrEmpty(waferHolderInfo.CrsBId) && _side == "SideB")
  560. {
  561. waferHolderInfo.CrsBTotalUses++;
  562. WaferHolderManager.Instance.UpdateWaferHolderInfo(waferHolderInfo);
  563. }
  564. }
  565. return true;
  566. }
  567. }
  568. }