TransporterPickDownToRoutine.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  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.Beckhoff.Station;
  7. using MECF.Framework.Common.Equipment;
  8. using MECF.Framework.Common.Layout;
  9. using MECF.Framework.Common.Routine;
  10. using MECF.Framework.Common.Utilities;
  11. using MECF.Framework.Common.WaferHolder;
  12. using CyberX8_Core;
  13. using CyberX8_RT.Devices.AXIS;
  14. using CyberX8_RT.Devices.AXIS.CANOpen;
  15. using CyberX8_RT.Devices.Facilities;
  16. using CyberX8_RT.Devices.Loader;
  17. using CyberX8_RT.Devices.TransPorter;
  18. using CyberX8_RT.Modules.Loader;
  19. using System;
  20. using System.Collections.Generic;
  21. using System.Linq;
  22. using System.Text;
  23. using System.Threading.Tasks;
  24. using CyberX8_RT.Devices.Metal;
  25. using CyberX8_RT.Devices.Rinse;
  26. using static Mono.Security.X509.X520;
  27. namespace CyberX8_RT.Modules.Transporter
  28. {
  29. public class TransporterPickDownToRoutine : RoutineBase, IRoutine
  30. {
  31. private enum PutDownStep
  32. {
  33. CheckPreStatus,
  34. ElevatorUp,
  35. ElevatorUpWait,
  36. SafeMoveTo,
  37. CheckMoveToStatus,
  38. GantryPosition,
  39. GantryPositiolWait,
  40. ElevatorPositionToCellTop,
  41. ElevatorPositionToCellTopWait,
  42. Delay,
  43. CalculatePlaceSpeed,
  44. PlaceDelay,
  45. ElevatorPositionToCell,
  46. ElevatorPositionToCellWait,
  47. DropBlockLockoff,
  48. ElevatorGotoUp,
  49. ElevatorGotoUpWait,
  50. ConfirmWSPresent,
  51. UpdateWaferHolder,
  52. GantryPositionPark,
  53. GantryPositionParkWait,
  54. End
  55. }
  56. #region 内部变量
  57. private string _cellName;
  58. private string _otherModule;
  59. private JetAxisBase _gantryAxis;
  60. private JetAxisBase _elevatorAxis;
  61. private JetAxisBase _otherElevatorAxis;
  62. private LoaderEntity _loaderEntity;
  63. private JetAxisBase _loaderRotationAxis;
  64. private SystemFacilities _facilities;
  65. private TransporterCommon _transporterCommon;
  66. private TransporterConflictRoutine _conflictRoutine;
  67. private LoaderCommonDevice _loaderCommonDevice;
  68. ProcessLayoutCellItem _cellItem;
  69. private int _placeTime;
  70. private int _placeDelayTime;
  71. private int _velocity;
  72. private int _acceleration;
  73. private bool _bypassWaferHolderPresent;
  74. #endregion
  75. /// <summary>
  76. /// 构造函数
  77. /// </summary>
  78. /// <param name="module"></param>
  79. public TransporterPickDownToRoutine(string module) : base(module)
  80. {
  81. }
  82. /// <summary>
  83. /// 中止
  84. /// </summary>
  85. public void Abort()
  86. {
  87. Runner.Stop("Manual Abort");
  88. }
  89. /// <summary>
  90. /// 监控
  91. /// </summary>
  92. /// <returns></returns>
  93. public RState Monitor()
  94. {
  95. Runner.Run(PutDownStep.CheckPreStatus,CheckStartPreConfition,_delay_1ms)
  96. //1. Elevator 移动至Up
  97. .Run(PutDownStep.ElevatorUp, ElevatorGotoUp, _delay_1ms)
  98. .WaitWithStopCondition(PutDownStep.ElevatorUpWait, CheckElevatorPositionEndStatus, CheckElevatorPositionStopStatus)
  99. //2. other Transporter Safe Move
  100. .Run(PutDownStep.SafeMoveTo, SafeMoveTo, _delay_1ms)
  101. .WaitWithStopCondition(PutDownStep.CheckMoveToStatus, () => CommonFunction.CheckRoutineEndState(_conflictRoutine),
  102. CheckSafeMoveToStopStatus)
  103. //3. Gantry 移动
  104. .Run(PutDownStep.GantryPosition, GantryPositionToCell, _delay_1ms)
  105. .WaitWithStopCondition(PutDownStep.GantryPositiolWait, CheckGantryPositionStatus, CheckGantryPositionRunStop)
  106. //6. Elevator 移动至cellTop
  107. .Run(PutDownStep.ElevatorPositionToCellTop, ElevatorPositionToCellTop, _delay_1ms)
  108. .WaitWithStopCondition(PutDownStep.ElevatorPositionToCellTopWait, CheckElevatorPositionEndStatus, CheckElevatorPositionStopStatus)
  109. .Delay(PutDownStep.Delay, 500)
  110. //4. 确认Place 速度和加速度
  111. .Run(PutDownStep.CalculatePlaceSpeed, CalculatePownDownSpeed, _delay_1ms)
  112. //5. Pickup delay
  113. .Delay(PutDownStep.PlaceDelay, _placeDelayTime * 1000)
  114. //7. Elevator 移动至cell
  115. .Run(PutDownStep.ElevatorPositionToCell, ElevatorPositionToCell, _delay_1ms)
  116. .WaitWithStopCondition(PutDownStep.ElevatorPositionToCellWait, CheckElevatorPositionEndStatus, CheckElevatorPositionStopStatus)
  117. //8. DropBlockLock off
  118. .Run(PutDownStep.DropBlockLockoff, DropBlockLockoff , _delay_1ms)
  119. //9. Elevator移动至Up
  120. .Run(PutDownStep.ElevatorGotoUp, ElevatorGotoUp, _delay_1ms)
  121. .WaitWithStopCondition(PutDownStep.ElevatorGotoUpWait, CheckElevatorPositionEndStatus, CheckElevatorPositionStopStatus)
  122. //10. 确认WSPresent信号
  123. .Wait(PutDownStep.ConfirmWSPresent,ConfirmWSPresentSensorOff,_delay_2s)
  124. //11. Wafer Holder location update
  125. .Run(PutDownStep.UpdateWaferHolder,WaferHolderTransfer,_delay_1ms)
  126. //12. Gantry Position To Park
  127. .Run(PutDownStep.GantryPositionPark, GantryBackToPark, _delay_1ms)
  128. .WaitWithStopCondition(PutDownStep.GantryPositionParkWait, CheckGantryParkPositionStatus, CheckGantryParkPositionRunStop)
  129. .End(PutDownStep.End,NullFun,100);
  130. return Runner.Status;
  131. }
  132. /// <summary>
  133. /// Elevator goto Up
  134. /// </summary>
  135. /// <returns></returns>
  136. private bool ElevatorGotoUp()
  137. {
  138. bool result= _elevatorAxis.PositionStation("UP", false);
  139. if (!result)
  140. {
  141. NotifyError(eEvent.ERR_TRANSPORTER, "elevator goto up failed", 0);
  142. }
  143. return result;
  144. }
  145. /// <summary>
  146. /// 检验前置条件
  147. /// </summary>
  148. /// <returns></returns>
  149. private bool CheckPreCondition()
  150. {
  151. if(!_gantryAxis.IsSwitchOn)
  152. {
  153. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} gantry axis is not switch on ", -1);
  154. return false;
  155. }
  156. if (!_gantryAxis.IsHomed)
  157. {
  158. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} gantry axis is not homed ",-1);
  159. return false;
  160. }
  161. if (!_elevatorAxis.IsSwitchOn)
  162. {
  163. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} elevator axis is not switch on ", -1);
  164. return false;
  165. }
  166. if (!_elevatorAxis.IsHomed)
  167. {
  168. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} elevator axis is not homed ",-1);
  169. return false;
  170. }
  171. return true;
  172. }
  173. /// <summary>
  174. /// 安全避障移动
  175. /// </summary>
  176. /// <returns></returns>
  177. private bool SafeMoveTo()
  178. {
  179. _cellItem = ProcessLayoutManager.Instance.GetProcessLayoutCellItemByModuleName(_cellName);
  180. string stationName = _cellName;
  181. if (_cellItem != null)
  182. {
  183. if (_cellName.ToLower() != "loader" && _cellName.ToLower() != "park")
  184. {
  185. stationName = $"Cell{_cellItem.CellId}";
  186. }
  187. }
  188. else
  189. {
  190. NotifyError(eEvent.ERR_TRANSPORTER, $"{_cellName} not in layout",0);
  191. return false;
  192. }
  193. var result = _gantryAxis.GetPositionByStation(stationName);
  194. if (result.success)
  195. {
  196. bool isPositive = false;
  197. if (_gantryAxis.MotionData.MotorPosition < result.position)
  198. {
  199. isPositive = true;
  200. }
  201. return _conflictRoutine.Start(result.position, isPositive) == RState.Running;
  202. }
  203. else
  204. {
  205. NotifyError(eEvent.ERR_TRANSPORTER, $"{_cellName} not in station list",0);
  206. return false;
  207. }
  208. }
  209. /// <summary>
  210. /// 检验安全避让异常结束状态
  211. /// </summary>
  212. /// <returns></returns>
  213. private bool CheckSafeMoveToStopStatus()
  214. {
  215. bool result = CommonFunction.CheckRoutineStopState(_conflictRoutine);
  216. if (result)
  217. {
  218. NotifyError(eEvent.ERR_TRANSPORTER, "Safe Move failed", 0);
  219. }
  220. return result;
  221. }
  222. /// <summary>
  223. /// Gantry Position To cell
  224. /// </summary>
  225. /// <returns></returns>
  226. private bool GantryPositionToCell()
  227. {
  228. _cellItem= ProcessLayoutManager.Instance.GetProcessLayoutCellItemByModuleName(_cellName);
  229. bool result = false;
  230. if (_cellItem != null)
  231. {
  232. if (_cellName.ToLower() != "loader"&&_cellName.ToLower()!="park")
  233. {
  234. result= _gantryAxis.PositionStation($"Cell{_cellItem.CellId}",false);
  235. }
  236. else
  237. {
  238. result = _gantryAxis.PositionStation(_cellName,false);
  239. }
  240. if (!result)
  241. {
  242. NotifyError(eEvent.ERR_TRANSPORTER, "gantry axis motion failed", 0);
  243. }
  244. return result;
  245. }
  246. else
  247. {
  248. NotifyError(eEvent.ERR_TRANSPORTER, $"{_cellName} not in layout",0);
  249. return false;
  250. }
  251. }
  252. /// <summary>
  253. /// Elevator Position to cellTop
  254. /// </summary>
  255. /// <returns></returns>
  256. private bool ElevatorPositionToCellTop()
  257. {
  258. bool result = _elevatorAxis.PositionStation("CellTop", false, _velocity, _acceleration, _acceleration);
  259. if (!result)
  260. {
  261. NotifyError(eEvent.ERR_TRANSPORTER, "elevator goto CellTop failed", 0);
  262. }
  263. return result;
  264. }
  265. /// <summary>
  266. /// Elevator Position to cell
  267. /// </summary>
  268. /// <returns></returns>
  269. private bool ElevatorPositionToCell()
  270. {
  271. bool result= false;
  272. if( _cellItem != null )
  273. {
  274. if (_cellName.ToLower()!="loader")
  275. {
  276. result= _elevatorAxis.PositionStation($"Cell{_cellItem.CellId}",false,_velocity,_acceleration,_acceleration);
  277. }
  278. else
  279. {
  280. result= _elevatorAxis.PositionStation(_cellName,false,_velocity,_acceleration,_acceleration);
  281. }
  282. if (!result)
  283. {
  284. NotifyError(eEvent.ERR_TRANSPORTER, "elevator axis motion failed", 0);
  285. }
  286. return result;
  287. }
  288. else
  289. {
  290. NotifyError(eEvent.ERR_TRANSPORTER, $"{_cellName} not in layout",0);
  291. return false;
  292. }
  293. }
  294. /// <summary>
  295. /// 检验Elevator移动状态
  296. /// </summary>
  297. /// <returns></returns>
  298. private bool CheckElevatorPositionEndStatus()
  299. {
  300. return _elevatorAxis.Status == RState.End;
  301. }
  302. /// <summary>
  303. /// 检验Vertical是否还在运动
  304. /// </summary>
  305. /// <returns></returns>
  306. private bool CheckElevatorPositionStopStatus()
  307. {
  308. bool result= _elevatorAxis.Status == RState.Failed||_elevatorAxis.Status==RState.Timeout;
  309. if(result)
  310. {
  311. NotifyError(eEvent.ERR_TRANSPORTER, "elevator axis motion failed", 0);
  312. }
  313. return result;
  314. }
  315. /// <summary>
  316. /// 检验Gantry移动状态
  317. /// </summary>
  318. /// <returns></returns>
  319. private bool CheckGantryPositionStatus()
  320. {
  321. return _gantryAxis.Status == RState.End;
  322. }
  323. /// <summary>
  324. /// 检验Gantry是否还在运动
  325. /// </summary>
  326. /// <returns></returns>
  327. private bool CheckGantryPositionRunStop()
  328. {
  329. bool result= _gantryAxis.Status == RState.Failed||_gantryAxis.Status==RState.Timeout;
  330. if(result)
  331. {
  332. NotifyError(eEvent.ERR_TRANSPORTER, "gantry axis motion failed", 0);
  333. }
  334. return result;
  335. }
  336. /// <summary>
  337. /// 计算放下速度
  338. /// </summary>
  339. /// <returns></returns>
  340. private bool CalculatePownDownSpeed()
  341. {
  342. if(_placeTime==0)
  343. {
  344. return true;
  345. }
  346. BeckhoffStationAxis stationAxis = BeckhoffStationLocationManager.Instance.GetStationAxis(Module, "Elevator", 0);
  347. Station upStation = stationAxis.Stations.Find(O => O.Name.EndsWith("CellTop")); Station cellStation = null;
  348. if (_cellName == "Loader")
  349. {
  350. cellStation = stationAxis.Stations.Find(O => O.Name.EndsWith("Loader"));
  351. }
  352. else
  353. {
  354. cellStation = stationAxis.Stations.Find(O => O.Name.EndsWith($"Cell{_cellItem.CellId}"));
  355. }
  356. if (upStation==null)
  357. {
  358. NotifyError(eEvent.ERR_TRANSPORTER, "CellTop is not in Station List", 0);
  359. return false;
  360. }
  361. if(cellStation==null)
  362. {
  363. NotifyError(eEvent.ERR_TRANSPORTER, $"Cell{_cellItem.CellId} is not in Station List",0);
  364. return false;
  365. }
  366. if(!double.TryParse(cellStation.Position,out double cellStationPosition))
  367. {
  368. NotifyError(eEvent.ERR_TRANSPORTER, $"Cell{_cellItem.CellId} Station Position is invalid",0);
  369. return false;
  370. }
  371. if (!double.TryParse(upStation.Position, out double upStationPosition))
  372. {
  373. NotifyError(eEvent.ERR_TRANSPORTER, $"Cell{_cellItem.CellId} Station Position is invalid",0);
  374. return false;
  375. }
  376. int distance =(int)(Math.Round(Math.Abs(cellStationPosition - upStationPosition)));
  377. double tmpVelocity = (double) distance/ _placeTime;
  378. _velocity = _elevatorAxis.CalculateMultiplySpeedRatio(_elevatorAxis.CalculateValueMultiplyScale(tmpVelocity));
  379. double tmpAccelaration = (double)(2 * distance) / Math.Pow(_placeTime, 2);
  380. _acceleration = _elevatorAxis.CalculateMultiplyAccelerationRatio(_elevatorAxis.CalculateValueMultiplyScale(tmpAccelaration));
  381. LOG.WriteBackgroundLog(eEvent.INFO_TRANSPORTER, Module, "adjust profile speed");
  382. return true;
  383. }
  384. /// <summary>
  385. /// 更新WaferHolder移动信息
  386. /// </summary>
  387. /// <returns></returns>
  388. private bool WaferHolderTransfer()
  389. {
  390. bool result= WaferHolderManager.Instance.TransferWaferHolder(Module,Module, _cellName);
  391. if (!result)
  392. {
  393. NotifyError(eEvent.ERR_TRANSPORTER, "tranfer waferHolder message failed", 0);
  394. }
  395. else
  396. {
  397. if (Singleton<RouteManager>.Instance.IsAutoRunning)
  398. {
  399. WaferHolderInfo waferHolderInfo = WaferHolderManager.Instance.GetWaferHolder(_cellName);
  400. if (waferHolderInfo != null)
  401. {
  402. string strTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
  403. waferHolderInfo.SchedulerModules.Add($"{strTime} {Module} => {_cellName}");
  404. }
  405. }
  406. }
  407. return result;
  408. }
  409. /// <summary>
  410. /// 确认WH Present Sensor off
  411. /// </summary>
  412. /// <returns></returns>
  413. private bool ConfirmWSPresentSensorOff()
  414. {
  415. if (_bypassWaferHolderPresent) return true;
  416. bool result= !_transporterCommon.TransporterData.WSHoldPresent;
  417. if(!result)
  418. {
  419. LOG.WriteLog(eEvent.INFO_TRANSPORTER, Module, "confirm WS Present sensor failed");
  420. }
  421. return result;
  422. }
  423. /// <summary>
  424. /// Gabtry是否需要回到
  425. /// </summary>
  426. /// <returns></returns>
  427. private bool NeedGantryBackToPark()
  428. {
  429. switch(_cellName)
  430. {
  431. case "Loader":
  432. case "Prewet":
  433. return true;
  434. default:
  435. return false;
  436. }
  437. }
  438. /// <summary>
  439. /// Gantry 回至Park
  440. /// </summary>
  441. /// <returns></returns>
  442. private bool GantryBackToPark()
  443. {
  444. if (NeedGantryBackToPark())
  445. {
  446. bool result= _gantryAxis.PositionStation("Park", false);
  447. if(!result)
  448. {
  449. NotifyError(eEvent.ERR_TRANSPORTER, "gantry back to park failed",0);
  450. }
  451. return result;
  452. }
  453. else
  454. {
  455. return true;
  456. }
  457. }
  458. /// <summary>
  459. /// 检验Gantry Park移动状态
  460. /// </summary>
  461. /// <returns></returns>
  462. private bool CheckGantryParkPositionStatus()
  463. {
  464. if (NeedGantryBackToPark())
  465. {
  466. return _gantryAxis.Status == RState.End;
  467. }
  468. else
  469. {
  470. return true;
  471. }
  472. }
  473. /// <summary>
  474. /// 检验Gantry Park是否还在运动
  475. /// </summary>
  476. /// <returns></returns>
  477. private bool CheckGantryParkPositionRunStop()
  478. {
  479. if (NeedGantryBackToPark())
  480. {
  481. bool result = _gantryAxis.Status == RState.Failed||_gantryAxis.Status==RState.Timeout;
  482. if(result)
  483. {
  484. NotifyError(eEvent.ERR_TRANSPORTER, "gantry motion failed", 0);
  485. }
  486. return result;
  487. }
  488. else
  489. {
  490. return false;
  491. }
  492. }
  493. /// <summary>
  494. /// 关闭DropBlockLock
  495. /// </summary>
  496. /// <returns></returns>
  497. private bool DropBlockLockoff()
  498. {
  499. if (_transporterCommon.TransporterData.Lock)
  500. {
  501. return _transporterCommon.UnlockOperation("", null);
  502. }
  503. return true;
  504. }
  505. /// <summary>
  506. /// 启动
  507. /// </summary>
  508. /// <param name="objs"></param>
  509. /// <returns></returns>
  510. public RState Start(params object[] objs)
  511. {
  512. _cellName = objs[0].ToString();
  513. _velocity = 0;
  514. _acceleration = 0;
  515. InitializeParameters();
  516. string preConfig = SC.GetConfigPreContent(_cellName);
  517. _bypassWaferHolderPresent = SC.GetValue<bool>("Transporter.BypassWaferHolderPresent");
  518. if (SC.ContainsItem($"{preConfig}.PlaceTimeSeconds"))
  519. {
  520. _placeTime = SC.GetValue<int>($"{preConfig}.PlaceTimeSeconds");
  521. }
  522. if (SC.ContainsItem($"{preConfig}.PlaceDelaySeconds"))
  523. {
  524. _placeDelayTime = SC.GetValue<int>($"{preConfig}.PlaceDelaySeconds");
  525. }
  526. return Runner.Start(Module, $"Pun Down To {_cellName}");
  527. }
  528. /// <summary>
  529. /// 初始化参数
  530. /// </summary>
  531. private void InitializeParameters()
  532. {
  533. _elevatorAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Elevator");
  534. _gantryAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Gantry");
  535. _loaderEntity = Singleton<RouteManager>.Instance.GetModule<LoaderEntity>(ModuleName.Loader1.ToString());
  536. _loaderRotationAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.Loader1}.Rotation");
  537. _facilities = DEVICE.GetDevice<SystemFacilities>("System.Facilities");
  538. _conflictRoutine = new TransporterConflictRoutine(Module);
  539. _transporterCommon = DEVICE.GetDevice<TransporterCommon>($"{Module}.Common");
  540. _otherModule = Module == "Transporter2" ? "Transporter1" : "Transporter2";
  541. _otherElevatorAxis = DEVICE.GetDevice<JetAxisBase>($"{_otherModule}.Elevator");
  542. _loaderCommonDevice = DEVICE.GetDevice<LoaderCommonDevice>($"{ModuleName.Loader1}.Common");
  543. }
  544. /// <summary>
  545. /// 启动校验条件
  546. /// </summary>
  547. /// <returns></returns>
  548. private bool CheckStartPreConfition()
  549. {
  550. //所有轴上电并Homed
  551. bool result = CheckPreCondition();
  552. if(!result)
  553. {
  554. return false;
  555. }
  556. //Loader is Home
  557. if (!_loaderEntity.IsHomed)
  558. {
  559. NotifyError(eEvent.ERR_TRANSPORTER, $"{ModuleName.Loader1} is not homed", -1);
  560. return false;
  561. }
  562. //若目标Cell为Loader, 则Loader需在TRNA或TRANB位置且WaferShuttlePresent信号on
  563. if (_cellName == "Loader")
  564. {
  565. double loaderRotationPosition = _loaderRotationAxis.MotionData.MotorPosition;
  566. if (!_loaderRotationAxis.CheckPositionIsInStation(loaderRotationPosition, "TRNPA") &&
  567. !_loaderRotationAxis.CheckPositionIsInStation(loaderRotationPosition, "TRNPB"))
  568. {
  569. NotifyError(eEvent.ERR_TRANSPORTER, $"{ModuleName.Loader1} rotation axis {loaderRotationPosition} is not int TRNPA or TRNPB station", -1);
  570. return false;
  571. }
  572. if (_loaderCommonDevice.CommonData.WaferHolderPresent)
  573. {
  574. NotifyError(eEvent.ERR_TRANSPORTER, $"{ModuleName.Loader1} WaferShuttlePresent is on", -1);
  575. return false;
  576. }
  577. }
  578. //Transporter应有WS信息
  579. if (!WaferHolderManager.Instance.HasWaferHolder(Module))
  580. {
  581. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} does not has wafer Shuttle",-1);
  582. return false;
  583. }
  584. //目标Cell没有WS信息
  585. if (WaferHolderManager.Instance.HasWaferHolder(_cellName))
  586. {
  587. NotifyError(eEvent.ERR_TRANSPORTER, $"Cell {_cellName} already has wafer Shuttle", -1);
  588. return false;
  589. }
  590. //检验Lock
  591. if (!_transporterCommon.TransporterData.Lock)
  592. {
  593. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} Drop block lock is off ", -1);
  594. return false;
  595. }
  596. //检验Wafer shuttle hold present
  597. if (!_bypassWaferHolderPresent && !_transporterCommon.TransporterData.WSHoldPresent)
  598. {
  599. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} Wafer shuttle hold present sensor is off ",-1);
  600. return false;
  601. }
  602. //检验Facilities
  603. //var faciltiesResult = _facilities.CheckCDA();
  604. //if (!faciltiesResult.result)
  605. //{
  606. // NotifyError(eEvent.ERR_TRANSPORTER, faciltiesResult.reason, -1);
  607. // return false;
  608. //}
  609. return true;
  610. }
  611. /// <summary>
  612. /// 重试
  613. /// </summary>
  614. /// <param name="step"></param>
  615. public RState Retry(int step)
  616. {
  617. InitializeParameters();
  618. List<Enum> preStepIds = new List<Enum>();
  619. return Runner.Retry(PutDownStep.CheckPreStatus, preStepIds, Module, "PickUp Moveto Retry");
  620. }
  621. /// <summary>
  622. /// 检验前面Unload完成状态
  623. /// </summary>
  624. /// <returns></returns>
  625. public bool CheckCompleteCondition(int index)
  626. {
  627. TransporterEntity transporterEntity = Singleton<RouteManager>.Instance.GetModule<TransporterEntity>(Module);
  628. if (transporterEntity.WaferHolderInfo != null)
  629. {
  630. NotifyError(eEvent.ERR_TRANSPORTER, $"{Module} has waferholder", index);
  631. return false;
  632. }
  633. if (!WaferHolderManager.Instance.HasWaferHolder(_cellName))
  634. {
  635. NotifyError(eEvent.ERR_TRANSPORTER, $"{_cellName} does not have waferholder", index);
  636. return false;
  637. }
  638. return true;
  639. }
  640. }
  641. }