LoaderLoadRoutine.cs 25 KB

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