LoaderLoadRoutine.cs 24 KB

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