CarrierUnload.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. using Aitex.Core.RT.Routine;
  2. using Aitex.Core.RT.SCCore;
  3. using Aitex.Core.Util;
  4. using Aitex.Sorter.Common;
  5. using MECF.Framework.Common.Equipment;
  6. using MECF.Framework.Common.Schedulers;
  7. using MECF.Framework.Common.SubstrateTrackings;
  8. using MECF.Framework.RT.EquipmentLibrary.LogicUnits;
  9. using System;
  10. using System.Collections.Generic;
  11. using FurnaceRT.Equipments.FIMSs;
  12. using FurnaceRT.Equipments.LPs;
  13. using FurnaceRT.Equipments.Stockers;
  14. using FurnaceRT.Equipments.Systems;
  15. using static FurnaceRT.Equipments.FIMSs.FIMSModule;
  16. namespace FurnaceRT.Equipments.CarrierRobots
  17. {
  18. public class CarrierUnload : ModuleRoutine, IRoutine
  19. {
  20. enum RoutineStep
  21. {
  22. Place,
  23. DoorOpen,
  24. DoorClose,
  25. RobotRequestCassettePresent,
  26. CheckCassetteInfoByRobotSensor,
  27. SetStageLock,
  28. SetStageUnlock,
  29. CheckBeforePlace,
  30. }
  31. private CarrierRobotModule _cassetteRobotModule;
  32. private ModuleName _destination;
  33. private int _destinationSlot;
  34. private Hand _blade;
  35. private int _timeout = 0;
  36. private RD_TRIG _holdTrig = new RD_TRIG();
  37. private R_TRIG _emergencyStopTrig = new R_TRIG();
  38. private R_TRIG _pauseTrig = new R_TRIG();
  39. private R_TRIG _resumeTrig = new R_TRIG();
  40. private RoutineStep _routineStep;
  41. private double _durationTime = 0;
  42. private bool _isHasAlarm = false;
  43. private bool _needStartCheck = true;
  44. public CarrierUnload(CarrierRobotModule cassetteModule)
  45. {
  46. _cassetteRobotModule = cassetteModule;
  47. Module = cassetteModule.Module;
  48. Name = "Unload";
  49. }
  50. public void Init(ModuleName destination, int destinationSlot, Hand blade, bool isHasAlarm)
  51. {
  52. _destination = destination;
  53. _destinationSlot = destinationSlot;
  54. _blade = blade;
  55. var para = new List<object> { _destination, _destinationSlot, _blade, true };
  56. _cassetteRobotModule.PlaceCassetteFailAlarm.RetryMessage = (int)CarrierRobotModule.MSG.UnloadRetry;
  57. _cassetteRobotModule.PlaceCassetteFailAlarm.RetryMessageParas = para.ToArray();
  58. _cassetteRobotModule.PlaceCassetteTimeoutAlarm.RetryMessage = (int)CarrierRobotModule.MSG.UnloadRetry;
  59. _cassetteRobotModule.PlaceCassetteTimeoutAlarm.RetryMessageParas = para.ToArray();
  60. _cassetteRobotModule.RequestCassettePresentFailAlarm.RetryMessage = (int)CarrierRobotModule.MSG.UnloadRetry;
  61. _cassetteRobotModule.RequestCassettePresentFailAlarm.RetryMessageParas = para.ToArray();
  62. _cassetteRobotModule.RequestCassettePresentTimeoutAlarm.RetryMessage = (int)CarrierRobotModule.MSG.UnloadRetry;
  63. _cassetteRobotModule.RequestCassettePresentTimeoutAlarm.RetryMessageParas = para.ToArray();
  64. _cassetteRobotModule.RobotHasError.RetryMessage = (int)CarrierRobotModule.MSG.UnloadRetry;
  65. _cassetteRobotModule.RobotHasError.RetryMessageParas = para.ToArray();
  66. _cassetteRobotModule.ShutterOpenTimeoutAlarm.RetryMessage = (int)CarrierRobotModule.MSG.UnloadRetry;
  67. _cassetteRobotModule.ShutterOpenTimeoutAlarm.RetryMessageParas = para.ToArray();
  68. _cassetteRobotModule.ShutterCloseTimeoutAlarm.RetryMessage = (int)CarrierRobotModule.MSG.UnloadRetry;
  69. _cassetteRobotModule.ShutterCloseTimeoutAlarm.RetryMessageParas = para.ToArray();
  70. _isHasAlarm = isHasAlarm;
  71. if (!_isHasAlarm)
  72. _needStartCheck = true;
  73. }
  74. public Result Start(params object[] objs)
  75. {
  76. // 抛出过alarm就不reset
  77. if (!_isHasAlarm)
  78. {
  79. Reset();
  80. }
  81. else
  82. {
  83. _historySteps.Remove((int)_routineStep);
  84. _isHasAlarm = false;
  85. ResetState();
  86. }
  87. _holdTrig.RST = true;
  88. _emergencyStopTrig.RST = true;
  89. _pauseTrig.RST = true;
  90. _resumeTrig.RST = true;
  91. _timeout = SC.GetValue<int>($"{Module}.MotionTimeout");
  92. if (_needStartCheck)
  93. {
  94. if (!Singleton<EquipmentManager>.Instance.Modules.ContainsKey(_destination))
  95. {
  96. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for not install");
  97. return Result.FAIL;
  98. }
  99. if (ModuleHelper.IsLoadPort(_destination))
  100. {
  101. var lpModule = Singleton<EquipmentManager>.Instance.Modules[_destination] as LoadPortModule;
  102. if (lpModule == null)
  103. {
  104. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for not install");
  105. return Result.FAIL;
  106. }
  107. if (lpModule != null && !lpModule.CheckReadyForTransfer(ModuleHelper.Converter(Module), _blade, _destinationSlot, EnumTransferType.Place, out string reason))
  108. {
  109. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for {reason}");
  110. return Result.FAIL;
  111. }
  112. }
  113. else if (_destination == ModuleName.FIMS1 || _destination == ModuleName.FIMS2)
  114. {
  115. var fims = Singleton<EquipmentManager>.Instance.Modules[_destination] as FIMSModule;
  116. if (fims == null)
  117. {
  118. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for not install");
  119. return Result.FAIL;
  120. }
  121. if (fims != null && !fims.CheckReadyForTransfer(ModuleHelper.Converter(Module), _blade, _destinationSlot, EnumTransferType.Place, out string reason))
  122. {
  123. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for {reason}");
  124. return Result.FAIL;
  125. }
  126. if (!SC.GetValue<bool>("System.IsSimulatorMode"))
  127. {
  128. if (fims != null && fims.IsFoupExist)
  129. {
  130. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for carrier is present");
  131. return Result.FAIL;
  132. }
  133. }
  134. }
  135. else
  136. {
  137. var stockerModule = Singleton<EquipmentManager>.Instance.Modules[_destination] as StockerModule;
  138. if (stockerModule == null)
  139. {
  140. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for not install");
  141. return Result.FAIL;
  142. }
  143. if (!SC.GetValue<bool>("System.IsSimulatorMode"))
  144. {
  145. if (stockerModule != null && stockerModule.IsFoupPresent)
  146. {
  147. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for carrier is present");
  148. return Result.FAIL;
  149. }
  150. }
  151. }
  152. if (SC.GetValue<bool>("System.IsSimulatorMode"))
  153. {
  154. if (!CarrierManager.Instance.CheckHasCarrier(ModuleName.CarrierRobot, 0))
  155. {
  156. _cassetteRobotModule.BladeCassetteNotPresentWarning.Set($"{ModuleName.CarrierRobot} cassette not present");
  157. return Result.FAIL;
  158. }
  159. }
  160. else
  161. {
  162. if (!_cassetteRobotModule.CarrierRobotDevice.IsWaferPresenceOnBlade1 || !CarrierManager.Instance.CheckHasCarrier(ModuleName.CarrierRobot, 0))
  163. {
  164. _cassetteRobotModule.BladeCassetteNotPresentWarning.Set($"{ModuleName.CarrierRobot} cassette not present");
  165. return Result.FAIL;
  166. }
  167. }
  168. if (!CarrierManager.Instance.CheckNoCarrier(_destination, 0))
  169. {
  170. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for carrier is present");
  171. return Result.FAIL;
  172. }
  173. }
  174. Notify($"Start");
  175. return Result.RUN;
  176. }
  177. public void Abort()
  178. {
  179. _cassetteRobotModule.Stop();
  180. (Singleton<EquipmentManager>.Instance.Modules[_destination] as ITransferTarget)?.NoteTransferStop(ModuleHelper.Converter(_cassetteRobotModule.Module), _blade, _destinationSlot, EnumTransferType.Place);
  181. }
  182. public override Result Monitor()
  183. {
  184. try
  185. {
  186. PauseRountine(_cassetteRobotModule.CarrierRobotDevice.IsPause);
  187. if (_cassetteRobotModule.CarrierRobotDevice.IsPause)
  188. return Result.RUN;
  189. CheckBeforePlace((int)RoutineStep.CheckBeforePlace, _destination, _destinationSlot, _blade);
  190. if (_destination == ModuleName.LP1 || _destination == ModuleName.LP2)
  191. SaferDoorOpen((int)RoutineStep.DoorOpen, true, _timeout);
  192. Place((int)RoutineStep.Place, _destination, _destinationSlot, _blade, _timeout);
  193. if (_destination == ModuleName.LP1 || _destination == ModuleName.LP2)
  194. SaferDoorOpen((int)RoutineStep.DoorClose, false, _timeout);
  195. RobotRequestCassettePresent((int)RoutineStep.RobotRequestCassettePresent, _blade, _timeout);
  196. CheckCassetteInfoByRobotSensor((int)RoutineStep.CheckCassetteInfoByRobotSensor, _blade, false);
  197. }
  198. catch (RoutineBreakException)
  199. {
  200. return Result.RUN;
  201. }
  202. catch (RoutineFaildException ex)
  203. {
  204. (Singleton<EquipmentManager>.Instance.Modules[_destination] as ITransferTarget)?.NoteTransferStop(ModuleHelper.Converter(_cassetteRobotModule.Module), _blade, _destinationSlot, EnumTransferType.Place);
  205. return Result.FAIL;
  206. }
  207. if (SC.GetValue<bool>("System.IsSimulatorMode"))
  208. CarrierManager.Instance.DeleteCarrier(_destination.ToString());
  209. (Singleton<EquipmentManager>.Instance.Modules[_destination] as ITransferTarget)?.NoteTransferStop(ModuleHelper.Converter(_cassetteRobotModule.Module), _blade, _destinationSlot, EnumTransferType.Place);
  210. Notify("Finished");
  211. return Result.DONE;
  212. }
  213. private void Place(int id, ModuleName target, int slot, Hand hand, int timeout)
  214. {
  215. _routineStep = (RoutineStep)Enum.Parse(typeof(RoutineStep), id.ToString());
  216. Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
  217. {
  218. Notify($"Send place to {target} command to robot device");
  219. string reason;
  220. (Singleton<EquipmentManager>.Instance.Modules[target] as ITransferTarget)?.NoteTransferStart(ModuleHelper.Converter(_cassetteRobotModule.Module), hand, slot, EnumTransferType.Place);
  221. if (!_cassetteRobotModule.RobotPlace(target, slot, hand, out reason))
  222. {
  223. //_cassetteRobotModule.PlaceCassetteFailAlarm.Description = reason;
  224. _cassetteRobotModule.PlaceCassetteFailAlarm.Set(reason);
  225. return false;
  226. }
  227. return true;
  228. }, () =>
  229. {
  230. if (_cassetteRobotModule.CarrierRobotDevice.IsReady() && !_cassetteRobotModule.CarrierRobotDevice.IsError)
  231. {
  232. return true;
  233. }
  234. return false;
  235. }, timeout * 1000);
  236. if (ret.Item1)
  237. {
  238. if (ret.Item2 == Result.FAIL)
  239. {
  240. //_cassetteRobotModule.PlaceCassetteFailAlarm.Description = $"{_cassetteRobotModule.CassetteRobotDevice.ErrorCode}";
  241. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {target} failed for robot error, error code={_cassetteRobotModule.CarrierRobotDevice.ErrorCode}");
  242. throw (new RoutineFaildException());
  243. }
  244. else if (ret.Item2 == Result.TIMEOUT) //timeout
  245. {
  246. //_cassetteRobotModule.PlaceCassetteTimeoutAlarm.Description = $"timeout over {timeout} seconds";
  247. _cassetteRobotModule.PlaceCassetteTimeoutAlarm.Set($"timeout over {timeout} seconds");
  248. throw (new RoutineFaildException());
  249. }
  250. else
  251. throw (new RoutineBreakException());
  252. }
  253. }
  254. private void RobotRequestCassettePresent(int id, Hand hand, int timeout)
  255. {
  256. Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
  257. {
  258. Notify("Request cassette present");
  259. if (!_cassetteRobotModule.RequestCassettePresent(hand, out string reason))
  260. {
  261. //_cassetteRobotModule.RequestCassettePresentFailAlarm.Description = reason;
  262. _cassetteRobotModule.RequestCassettePresentFailAlarm.Set(reason);
  263. return false;
  264. }
  265. return true;
  266. }, () =>
  267. {
  268. if (_cassetteRobotModule.CarrierRobotDevice.IsReady() && !_cassetteRobotModule.CarrierRobotDevice.IsError)
  269. {
  270. return true;
  271. }
  272. return false;
  273. }, timeout * 1000);
  274. if (ret.Item1)
  275. {
  276. if (ret.Item2 == Result.FAIL)
  277. {
  278. throw (new RoutineFaildException());
  279. }
  280. else if (ret.Item2 == Result.TIMEOUT) //timeout
  281. {
  282. //_cassetteRobotModule.RequestCassettePresentTimeoutAlarm.Description = $"timeout over {timeout} seconds";
  283. _cassetteRobotModule.RequestCassettePresentTimeoutAlarm.Set($"timeout over {timeout} seconds");
  284. throw (new RoutineFaildException());
  285. }
  286. else
  287. throw (new RoutineBreakException());
  288. }
  289. }
  290. private void CheckCassetteInfoByRobotSensor(int id, Hand hand, bool isAfterPick)
  291. {
  292. Tuple<bool, Result> ret = Execute(id, () =>
  293. {
  294. Notify($"Check cassette info by robot RQ present");
  295. if (SC.GetValue<bool>("System.IsSimulatorMode"))
  296. return true;
  297. if (hand == Hand.Blade1 || hand == Hand.Both)
  298. {
  299. if (!isAfterPick && _cassetteRobotModule.CarrierRobotDevice.IsWaferPresenceOnBlade1)
  300. {
  301. //_cassetteRobotModule.RobotSensorFoundCassetteOnBladeAfterPlaceAlarm.Description = "Cassette Robot sensor found cassette on blade 1";
  302. _cassetteRobotModule.RobotSensorFoundCassetteOnBladeAfterPlaceAlarm.Set("Cassette Robot sensor found cassette on blade 1");
  303. return false;
  304. }
  305. if (isAfterPick && !_cassetteRobotModule.CarrierRobotDevice.IsWaferPresenceOnBlade1)
  306. {
  307. //_cassetteRobotModule.RobotSensorNotFoundCassetteOnBladeAfterPickAlarm.Description = "Cassette Robot sensor no cassette on blade 1";
  308. _cassetteRobotModule.RobotSensorNotFoundCassetteOnBladeAfterPickAlarm.Set("Cassette Robot sensor no cassette on blade 1");
  309. return false;
  310. }
  311. }
  312. if (hand == Hand.Blade2 || hand == Hand.Both)
  313. {
  314. if (!isAfterPick && _cassetteRobotModule.CarrierRobotDevice.IsWaferPresenceOnBlade2)
  315. {
  316. //_cassetteRobotModule.RobotSensorFoundCassetteOnBladeAfterPlaceAlarm.Description = "Cassette Robot sensor found cassette on blade 2";
  317. _cassetteRobotModule.RobotSensorFoundCassetteOnBladeAfterPlaceAlarm.Set("Cassette Robot sensor found cassette on blade 2");
  318. return false;
  319. }
  320. if (isAfterPick && !_cassetteRobotModule.CarrierRobotDevice.IsWaferPresenceOnBlade2)
  321. {
  322. //_cassetteRobotModule.RobotSensorNotFoundCassetteOnBladeAfterPickAlarm.Description = "Cassette Robot sensor no cassette on blade 2";
  323. _cassetteRobotModule.RobotSensorNotFoundCassetteOnBladeAfterPickAlarm.Set("Cassette Robot sensor no cassette on blade 2");
  324. return false;
  325. }
  326. }
  327. return true;
  328. });
  329. if (ret.Item1)
  330. {
  331. if (ret.Item2 == Result.FAIL)
  332. {
  333. //_cassetteRobotModule.CheckCassetteInformationFailAlarm.Description = $"check cassette info failed.";
  334. _cassetteRobotModule.CheckCassetteInformationFailAlarm.Set($"check cassette info failed.");
  335. throw (new RoutineFaildException());
  336. }
  337. else
  338. throw (new RoutineBreakException());
  339. }
  340. }
  341. private void CheckBeforePlace(int id, ModuleName target, int slot, Hand blade)
  342. {
  343. Tuple<bool, Result> ret = Execute(id, () =>
  344. {
  345. Notify($"Check place to {target} condition");
  346. string reason = string.Empty;
  347. if (_cassetteRobotModule.CarrierRobotDevice.IsError)
  348. {
  349. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {target} failed for robot error, error code={_cassetteRobotModule.CarrierRobotDevice.ErrorCode}");
  350. return false;
  351. }
  352. if (!_cassetteRobotModule.CarrierRobotDevice.IsReady())
  353. {
  354. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {target} failed for robot isn't Ready");
  355. return false;
  356. }
  357. if (!CarrierManager.Instance.CheckNoCarrier(_destination, 0))
  358. {
  359. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for pod is present");
  360. return false;
  361. }
  362. if (target == ModuleName.LP1 || target == ModuleName.LP2)
  363. {
  364. var lpModule = Singleton<EquipmentManager>.Instance.Modules[_destination] as LoadPortModule;
  365. if (lpModule != null && !lpModule.CheckReadyForTransfer(ModuleHelper.Converter(Module), blade, slot, EnumTransferType.Place, out reason))
  366. {
  367. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for {reason}");
  368. return false;
  369. }
  370. }
  371. else if (target == ModuleName.FIMS1 || target == ModuleName.FIMS2)
  372. {
  373. var fims = Singleton<EquipmentManager>.Instance.Modules[_destination] as FIMSModule;
  374. if (fims != null && !fims.CheckReadyForTransfer(ModuleHelper.Converter(Module), _blade, _destinationSlot, EnumTransferType.Place, out reason))
  375. {
  376. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for {reason}");
  377. return false;
  378. }
  379. if (!SC.GetValue<bool>("System.IsSimulatorMode"))
  380. {
  381. if (fims != null && fims.IsFoupExist)
  382. {
  383. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {_destination} failed for carrier is present");
  384. return false;
  385. }
  386. }
  387. }
  388. else
  389. {
  390. if (!SC.GetValue<bool>("System.IsSimulatorMode"))
  391. {
  392. var stockerModule = Singleton<EquipmentManager>.Instance.Modules[target] as StockerModule;
  393. if (stockerModule != null && stockerModule.IsFoupPresent)
  394. {
  395. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {target} failed for carrier is present");
  396. return false;
  397. }
  398. }
  399. }
  400. if (blade == Hand.Blade1)
  401. {
  402. if (!CarrierManager.Instance.CheckNoCarrier(target, 0))
  403. {
  404. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {target} failed for {target} has carrier");
  405. return false;
  406. }
  407. if (!CarrierManager.Instance.CheckHasCarrier(Module, 0))
  408. {
  409. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {target} failed for blade no carrier");
  410. return false;
  411. }
  412. }
  413. else if (blade == Hand.Blade2)
  414. {
  415. if (!CarrierManager.Instance.CheckNoCarrier(target, 0))
  416. {
  417. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {target} failed for {target} has carrier");
  418. return false;
  419. }
  420. if (!CarrierManager.Instance.CheckHasCarrier(Module, 0))
  421. {
  422. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {target} failed for blade no carrier");
  423. return false;
  424. }
  425. }
  426. else
  427. {
  428. if (!CarrierManager.Instance.CheckNoCarrier(target, 0))
  429. {
  430. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {target} failed for {target} has carrier");
  431. return false;
  432. }
  433. if (!CarrierManager.Instance.CheckHasCarrier(Module, 0))
  434. {
  435. _cassetteRobotModule.PlaceCassetteFailAlarm.Set($"place to {target} failed for blade no carrier");
  436. return false;
  437. }
  438. }
  439. return true;
  440. });
  441. if (ret.Item1)
  442. {
  443. if (ret.Item2 == Result.FAIL)
  444. {
  445. throw (new RoutineFaildException());
  446. }
  447. }
  448. _needStartCheck = false;
  449. }
  450. private void SaferDoorOpen(int id, bool isOpen, int timeout)
  451. {
  452. Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
  453. {
  454. Notify($"Shutter Door {(isOpen ? "Open" : "Close")}");
  455. if (isOpen)
  456. _cassetteRobotModule.DoorDevice.Open();
  457. else
  458. _cassetteRobotModule.DoorDevice.Close();
  459. return true;
  460. }, () =>
  461. {
  462. return isOpen ? _cassetteRobotModule.DoorDevice.OpenCloseStatus == Devices.DeviceStatus.Open : _cassetteRobotModule.DoorDevice.OpenCloseStatus == Devices.DeviceStatus.Close;
  463. }, timeout * 1000);
  464. if (ret.Item1)
  465. {
  466. if (ret.Item2 == Result.FAIL)
  467. {
  468. throw new RoutineFaildException();
  469. }
  470. else if (ret.Item2 == Result.TIMEOUT) //timeout
  471. {
  472. if (isOpen)
  473. _cassetteRobotModule.ShutterOpenTimeoutAlarm.Set($"timeout over {timeout} seconds");
  474. else
  475. _cassetteRobotModule.ShutterCloseTimeoutAlarm.Set($"timeout over {timeout} seconds");
  476. throw (new RoutineFaildException());
  477. }
  478. else
  479. throw new RoutineBreakException();
  480. }
  481. }
  482. }
  483. }