LoaderLoadRoutine.cs 25 KB

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