PMEntity.cs 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708
  1. using System;
  2. using System.Collections.Generic;
  3. using Aitex.Core.Common;
  4. using Aitex.Core.RT.DataCenter;
  5. using Aitex.Core.RT.Device;
  6. using Aitex.Core.RT.Event;
  7. using Aitex.Core.RT.Fsm;
  8. using Aitex.Core.RT.OperationCenter;
  9. using Aitex.Core.RT.SCCore;
  10. using Aitex.Core.Util;
  11. using Aitex.Sorter.Common;
  12. using MECF.Framework.Common.Equipment;
  13. using MECF.Framework.Common.Schedulers;
  14. using MECF.Framework.Common.SubstrateTrackings;
  15. using Venus_Core;
  16. using Venus_RT.Devices;
  17. using Aitex.Core.RT.Log;
  18. using Aitex.Core.UI.DeviceControl;
  19. using MECF.Framework.Common.DataCenter;
  20. using Aitex.Core.RT.DataCollection;
  21. namespace Venus_RT.Modules.PMs
  22. {
  23. public class RecipeRunningInfo
  24. {
  25. public Guid InnerId { get; set; }
  26. public RecipeHead Head { get; set; }
  27. public List<RecipeStep> RecipeStepList { get; set; }
  28. public string RecipeName { get; set; }
  29. public DateTime BeginTime { get; set; }
  30. public DateTime EndTime { get; set; }
  31. public int StepNumber { get; set; }
  32. public string StepName { get; set; }
  33. public double StepTime { get; set; }
  34. public double StepElapseTime { get; set; }
  35. public double TotalTime { get; set; }
  36. public double TotalElapseTime { get; set; }
  37. }
  38. public class PMEntity : Entity, IModuleEntity
  39. {
  40. public enum PMStatus
  41. {
  42. Not_Ready,
  43. Ready_For_Pick,
  44. Ready_For_Place,
  45. Exchange_Ready,
  46. }
  47. public enum MSG
  48. {
  49. Home,
  50. Transfer,
  51. PrepareTransfer,
  52. PostTransfer,
  53. Reset,
  54. Abort,
  55. Error,
  56. LaunchPump,
  57. LaunchTurboPump,
  58. Pump,
  59. Vent,
  60. PumpLoadLock,
  61. VentLoadLock,
  62. PurgeLoadLock,
  63. LoadLockLeakCheck,
  64. CyclePurge,
  65. GasLinePurge,
  66. Heat,
  67. TransferHandoff,
  68. StartTransfer,
  69. LeakCheck,
  70. GasLeakCheck,
  71. MoveLiftPin,
  72. MoveGuidePin,
  73. PartialPressure,
  74. VATPerformance,
  75. LLPlace,
  76. LLPick,
  77. Process,
  78. RunRecipe,
  79. PostProcess,
  80. RecipeSkipStep,
  81. RecipeUpdate,
  82. RecipeResume,
  83. RecipePause,
  84. RecipeAbort,
  85. PreProcess,
  86. AutoMode,
  87. ManualMode,
  88. LockLid,
  89. Clean,
  90. Online,
  91. Offline,
  92. GasFlow,
  93. StopGasFlow,
  94. RfPower,
  95. MFCVerification,
  96. // exchange wafer with TM
  97. PreparePick,
  98. PreparePlace,
  99. LiftUpWafer,
  100. DropDownWafer,
  101. PickReady,
  102. PlaceReady,
  103. MaxMsg
  104. }
  105. private readonly JetPMBase _chamber;
  106. public ModuleName Module { get; }
  107. public PMStatus Status { get; private set; }
  108. private StatsDataItem _statProcessedWafer;
  109. private StatsDataItemRFAndPump _statRfOnTime;
  110. private StatsDataItemRFAndPump _statBiasRfOnTime;
  111. //private StatsDataItemRFAndPump _statPumpOnTime;
  112. private readonly PMHomeRoutine _home;
  113. private readonly StartDryPumpRoutine _startDryPumpRoutine;
  114. private readonly StartTurboPumpRoutine _startTurboPumpRoutine;
  115. private readonly VentRoutine _ventRoutine;
  116. private readonly VenusVentRoutine _venusVentRoutine;
  117. private readonly PumpDownRoutine _pumpRoutine;
  118. //private readonly LoadLockVentRoutine _ventLoadLockRoutine;
  119. //private readonly LoadLockPumpRoutine _pumpLoadLockRoutine;
  120. //private readonly LoadLockPurgeRoutine _purgeLoadLockRoutine;
  121. //private readonly LoadLockLeakCheckRoutine _loadLockLeakCheckRoutine;
  122. private readonly PMPurgeRoutine _purgeRoutine;
  123. private readonly PMGaslinePurgeRoutine _gaslinePurgeRoutine;
  124. private readonly PMLeakCheckRoutine _leakCheckRoutine;
  125. private readonly GasBoxLeakCheckRoutine _gasBoxLeakCheckRoutine;
  126. //private readonly LLPlaceRoutine _llPlaceRoutine;
  127. //private readonly LLPickRoutine _llPickRoutine;
  128. private readonly PMProcessRoutine _processRoutine;
  129. private readonly GasFlowRoutine _gasFlowRoutine;
  130. private readonly RFPowerSwitchRoutine _rfPowerRoutine;
  131. private readonly PMGasVerificationRoutine _gasVerificationRoutine;
  132. private readonly PMPartialPressureRoutine _pmPartialPressureRoutine;
  133. private readonly PMVATPerformanceRoutine _pmVATPerformanceRoutine;
  134. //private readonly PMHeatRoutine _pmHeatRoutine;
  135. private AutoFlag _AutoMode;
  136. private bool _isOnline = false;
  137. //private bool _isAlarm;
  138. //private DateTime _pumpStartTime;
  139. //private TimeSpan _pumpElapsedTime;
  140. //private DateTime _rfStartTime;
  141. //private DateTime _tcStartTime;
  142. //private TimeSpan _rfElapsedTime;
  143. //private TimeSpan _tcElapsedTime;
  144. //private MovementPosition _goalLiftPin;
  145. //private ushort _ActivatedActionID;
  146. //private Stopwatch _LifpinSleepTimer;
  147. private bool startControlPressureFlag = true;
  148. //private bool stopControlPressureFlag = false;
  149. private int _controlPressureSetPoint = 90;
  150. private int _controlFlowSetPoint = 90;
  151. public JetChamber ChamberType => _chamber.ChamberType;
  152. public bool IsIdle
  153. {
  154. get { return fsm.State == (int)PMState.Idle; }
  155. }
  156. public bool IsError
  157. {
  158. get { return fsm.State == (int)PMState.Error; }
  159. }
  160. public bool IsInit
  161. {
  162. get { return fsm.State == (int)PMState.Init; }
  163. }
  164. public bool IsBusy
  165. {
  166. get { return !IsInit && !IsError && !IsIdle; }
  167. }
  168. public bool IsProcessing
  169. {
  170. get { return fsm.State == (int)PMState.PreProcess || fsm.State == (int)PMState.Processing || fsm.State == (int)PMState.PostProcess; }
  171. }
  172. public bool IsOnline
  173. {
  174. get { return _isOnline; }
  175. }
  176. public bool IsInclude
  177. {
  178. get;
  179. private set;
  180. } = true;
  181. private Dictionary<string, int> _dictRecipeTime = new Dictionary<string, int>();
  182. public override int TimeToReady
  183. {
  184. get
  185. {
  186. switch ((PMState)fsm.State)
  187. {
  188. case PMState.Processing:
  189. case PMState.Clean:
  190. if (Singleton<RouteManager>.Instance.IsAutoMode && IsOnline)
  191. {
  192. if (_dictRecipeTime.ContainsKey(_processRoutine.currentRecipeResult.RecipeName))
  193. {
  194. return Math.Max(_dictRecipeTime[_processRoutine.currentRecipeResult.RecipeName] - fsm.ElapsedTime, 0);
  195. }
  196. }
  197. break;
  198. }
  199. return int.MaxValue / 2;
  200. }
  201. }
  202. public bool IsAutoMode => _AutoMode == AutoFlag.Auto;
  203. public bool IsSlitDoorOpen => _chamber.CheckSlitDoorOpen();
  204. public bool IsSlitDoorClose => _chamber.CheckSlitDoorClose();
  205. public bool LiftPinIsDown => _chamber.LiftPinIsDown;
  206. public bool LiftPinIsUp => _chamber.LiftPinIsUp;
  207. public double ChamberPressure => _chamber.ChamberPressure;
  208. public double ProcessPressure => _chamber.ProcessPressure;
  209. public bool IsVac => _chamber.IsVAC;
  210. public bool IsAtm => _chamber.IsATM;
  211. public float ChamberTemperature => _chamber.ChamberTemperature;
  212. public bool Check(int msg, out string reason, object[] objs)
  213. {
  214. reason = "";
  215. return true;
  216. }
  217. //
  218. private bool CheckToPostMessage(int msg, params object[] args)
  219. {
  220. if (!fsm.FindTransition(fsm.State, msg))
  221. {
  222. EV.PostWarningLog(Module.ToString(), eEvent.WARN_State, $"{Module} is in {(PMState)fsm.State} state,can not do {(MSG)msg}");
  223. return false;
  224. }
  225. fsm.PostMsg(msg, args);
  226. return true;
  227. }
  228. public int Invoke(string function, params object[] args)
  229. {
  230. switch (function)
  231. {
  232. case "Home":
  233. CheckToPostMessage((int)MSG.Home);
  234. return (int)MSG.Home;
  235. }
  236. return (int)FSM_MSG.NONE;
  237. }
  238. public bool CheckAcked(int msg)
  239. {
  240. return fsm.CheckExecuted(msg);
  241. }
  242. public void ResetRecipeTime()
  243. {
  244. _dictRecipeTime.Clear();
  245. }
  246. public bool IsPrepareTransferReady(ModuleName robot, EnumTransferType type, int slot, Hand blade)
  247. {
  248. //if (type == EnumTransferType.Pick)
  249. //{
  250. // return _chamber.CheckEnableTransfer(type, WaferManager.Instance.GetWafer(_chamber.Module, 0).Size);
  251. //}
  252. //else if (type == EnumTransferType.Place)
  253. //{
  254. // return _chamber.CheckEnableTransfer(type, WaferManager.Instance.GetWafer(robot, (int)blade).Size);
  255. //}
  256. return false;
  257. }
  258. public int InvokePrepareTransfer(ModuleName robot, EnumTransferType type, int slot)
  259. {
  260. if (CheckToPostMessage((int)MSG.PrepareTransfer, type.ToString()))
  261. return (int)MSG.PrepareTransfer;
  262. return (int)FSM_MSG.NONE;
  263. }
  264. public int InvokePrepareTransfer(ModuleName robot, EnumTransferType type, int slot, float temp)
  265. {
  266. if (CheckToPostMessage((int)MSG.PrepareTransfer, type.ToString(), temp))
  267. return (int)MSG.PrepareTransfer;
  268. return (int)FSM_MSG.NONE;
  269. }
  270. public int InvokePrepareTransfer(ModuleName robot, EnumTransferType type, int slot, float temp, WaferSize size)
  271. {
  272. if (CheckToPostMessage((int)MSG.PrepareTransfer, type.ToString(), temp, size))
  273. return (int)MSG.PrepareTransfer;
  274. return (int)FSM_MSG.NONE;
  275. }
  276. public int InvokePostTransfer(ModuleName robot, EnumTransferType type, int slot)
  277. {
  278. if (CheckToPostMessage((int)MSG.PostTransfer, type.ToString()))
  279. return (int)MSG.PostTransfer;
  280. return (int)FSM_MSG.NONE;
  281. }
  282. public int InvokeClean(string recipeName, string waferID, RecipeType recipeType)
  283. {
  284. if (CheckToPostMessage((int)MSG.Clean, recipeName, waferID, recipeType))
  285. {
  286. return (int)MSG.Clean;
  287. }
  288. return (int)FSM_MSG.NONE;
  289. }
  290. public int InvokeProcess(string recipeName, string waferID, RecipeType recipeType)
  291. {
  292. if (CheckToPostMessage((int)MSG.RunRecipe, recipeName, waferID, recipeType))
  293. return (int)MSG.RunRecipe;
  294. return (int)FSM_MSG.NONE;
  295. }
  296. public int InvokePreHeat(float temperature)
  297. {
  298. if (CheckToPostMessage((int)MSG.Heat, (double)temperature))
  299. return (int)MSG.Heat;
  300. return (int)FSM_MSG.NONE;
  301. }
  302. public void InvokeReset()
  303. {
  304. PostMsg((int)MSG.Reset);
  305. }
  306. public void SetAuto()
  307. {
  308. this._AutoMode = AutoFlag.Auto;
  309. }
  310. private bool FnSetManual(object[] param)
  311. {
  312. if (fsm.State == (int)PMState.PreProcess || fsm.State == (int)PMState.Processing || fsm.State == (int)PMState.PostProcess)
  313. {
  314. EV.PostWarningLog(Module.ToString(), $"{Module} is in {(PMState)fsm.State},can not do SetAutoMode");
  315. return false;
  316. }
  317. this._AutoMode = AutoFlag.Manual;
  318. if (IsOnline)
  319. {
  320. EV.PostWarningLog(Module.ToString(), $"{Module} is online,change to offline due to the chamber change to manual mode");
  321. this._isOnline = false;
  322. }
  323. return true;
  324. }
  325. private bool FnSetInclude()
  326. {
  327. if (IsOnline == true)
  328. {
  329. LOG.Write(eEvent.WARN_PM, Module, $"{Module} is online,can not set Include");
  330. return false;
  331. }
  332. IsInclude = true;
  333. LOG.Write(eEvent.INFO_PM, Module, $"{Module} Set Include Success");
  334. return true;
  335. }
  336. private bool FnSetExclude()
  337. {
  338. if (IsOnline == true)
  339. {
  340. LOG.Write(eEvent.WARN_PM, Module, $"{Module} is online,can not set Exclude");
  341. return false;
  342. }
  343. IsInclude = false;
  344. LOG.Write(eEvent.INFO_PM, Module, $"{Module} Set Exclude Success");
  345. return true;
  346. }
  347. private bool FnSetOnline(object[] param)
  348. {
  349. //if (!IsAutoMode)
  350. //{
  351. // EV.PostWarningLog(Module.ToString(), $"{Module} in manual mode,can not set online.");
  352. // return false;
  353. //}
  354. if (!IsInclude)
  355. {
  356. LOG.Write(eEvent.WARN_PM, Module, $"{Module} is excluded,can not be put online");
  357. return false;
  358. }
  359. if (!_chamber.HomeIsOK(out string reason))
  360. {
  361. LOG.Write(eEvent.WARN_PM, Module, $"{Module} {reason},can not be put online");
  362. return false;
  363. }
  364. if (!_chamber.CheckSlitDoorClose())
  365. {
  366. EV.PostWarningLog(Module.ToString(), $"{Module} slit door is open,can not set online.");
  367. return false;
  368. }
  369. this._isOnline = true;
  370. return true;
  371. }
  372. private bool FnSetOffline(object[] param)
  373. {
  374. this._isOnline = false;
  375. return true;
  376. }
  377. private List<eEvent> stopEntityId = new List<eEvent>()
  378. {
  379. eEvent.ERR_MATCH,
  380. eEvent.ERR_RF,
  381. eEvent.ERR_PENDULUM_VALVE,
  382. eEvent.ERR_DEVICE_INFO,
  383. eEvent.ERR_DRY_PUMP,
  384. eEvent.ERR_HighTemperatureHeater,
  385. eEvent.ERR_HighTemperatureHeater_SetRatio_OverRange,
  386. eEvent.ERR_HighTemperatureHeater_SetTemperature_OverRange,
  387. };
  388. public PMEntity(ModuleName module)
  389. {
  390. Module = module;
  391. _chamber = DEVICE.GetDevice<JetPMBase>(Module.ToString());
  392. _home = new PMHomeRoutine(_chamber);
  393. _startDryPumpRoutine = new StartDryPumpRoutine(_chamber);
  394. _startTurboPumpRoutine = new StartTurboPumpRoutine(_chamber);
  395. _ventRoutine = new VentRoutine(_chamber);
  396. _venusVentRoutine = new VenusVentRoutine(_chamber);
  397. _pumpRoutine = new PumpDownRoutine(_chamber);
  398. //_ventLoadLockRoutine = new LoadLockVentRoutine(_chamber);
  399. //_pumpLoadLockRoutine = new LoadLockPumpRoutine(_chamber);
  400. //_purgeLoadLockRoutine = new LoadLockPurgeRoutine(_chamber);
  401. //_loadLockLeakCheckRoutine = new LoadLockLeakCheckRoutine(_chamber);
  402. _purgeRoutine = new PMPurgeRoutine(_chamber);
  403. _gaslinePurgeRoutine = new PMGaslinePurgeRoutine(_chamber, _pumpRoutine);
  404. _leakCheckRoutine = new PMLeakCheckRoutine(_chamber);
  405. _gasBoxLeakCheckRoutine = new GasBoxLeakCheckRoutine(_chamber);
  406. //_llPlaceRoutine = new LLPlaceRoutine(_chamber);
  407. //_llPickRoutine = new LLPickRoutine(_chamber, _ventLoadLockRoutine);
  408. _processRoutine = new PMProcessRoutine(_chamber, _pumpRoutine);
  409. _gasFlowRoutine = new GasFlowRoutine(_chamber);
  410. _rfPowerRoutine = new RFPowerSwitchRoutine(_chamber, true);
  411. _gasVerificationRoutine = new PMGasVerificationRoutine(_chamber, _pumpRoutine);
  412. _pmPartialPressureRoutine = new PMPartialPressureRoutine(_chamber);
  413. _pmVATPerformanceRoutine = new PMVATPerformanceRoutine(_chamber);
  414. //_pmControlPressureRoutine = new PMControlPressureRoutine(_chamber);
  415. //_pmHeatRoutine = new PMHeatRoutine(_chamber);
  416. fsm = new StateMachine<PMEntity>(Module.ToString(), (int)PMState.Init, 50);
  417. //Idle
  418. EnterExitTransition((int)PMState.Idle, FnIdle, (int)FSM_MSG.NONE, null);
  419. EnterExitTransition<PMState, FSM_MSG>(PMState.Error, fEnterError, FSM_MSG.NONE, null);
  420. EnterExitTransition<PMState, FSM_MSG>(PMState.ReadyForPick, fnEnterPickReady, FSM_MSG.NONE, fnExitPickReady);
  421. EnterExitTransition<PMState, FSM_MSG>(PMState.ReadyForPlace, fnEnterPlaceReady, FSM_MSG.NONE, fnExitPlaceReady);
  422. EnterExitTransition<PMState, FSM_MSG>(PMState.DropDownReady, fnEnterDropDownReady, FSM_MSG.NONE, fnExitDropDownReady);
  423. EnterExitTransition<PMState, FSM_MSG>(PMState.LiftUpReady, fnEnterLiftUpReady, FSM_MSG.NONE, fnExitLiftUpReady);
  424. //Home
  425. //EnterExitTransition((int)PMState.Homing, FnEnterHome, (int)FSM_MSG.NONE, FnExitHome);
  426. AnyStateTransition(MSG.Error, FnError, PMState.Error);
  427. AnyStateTransition(MSG.Online, FnSetOnline, FSM_STATE.SAME);
  428. AnyStateTransition(MSG.Offline, FnSetOffline, FSM_STATE.SAME);
  429. AnyStateTransition(FSM_MSG.ALARM, FnAlarm, PMState.Error);
  430. Transition(PMState.Init, FSM_MSG.TIMER, FnTimeout, PMState.Init);
  431. Transition(PMState.Init, MSG.Home, FnStartHome, PMState.Homing);
  432. Transition(PMState.Error, MSG.Home, FnStartHome, PMState.Homing);
  433. Transition(PMState.Idle, MSG.Home, FnStartHome, PMState.Homing);
  434. Transition(PMState.Homing, MSG.Home, FnStartHome, PMState.Homing);
  435. Transition(PMState.Homing, FSM_MSG.TIMER, FnMonitorHome, PMState.Idle);
  436. Transition(PMState.Homing, MSG.Abort, FnAbortHome, PMState.Idle);
  437. Transition(PMState.Idle, FSM_MSG.TIMER, FnIdleTimeout, PMState.Idle);
  438. Transition(PMState.Error, FSM_MSG.TIMER, FnErrorTimeout, PMState.Error);
  439. //Launch DryPump sequence
  440. Transition(PMState.Idle, MSG.LaunchPump, FnLaunchPump, PMState.LaunchingPump);
  441. Transition(PMState.LaunchingPump, FSM_MSG.TIMER, FnLaunchPumpTimeout, PMState.Idle);
  442. Transition(PMState.LaunchingPump, MSG.Abort, FnAbortStartPumping, PMState.Idle);
  443. //Launch TurboPump sequence
  444. Transition(PMState.Idle, MSG.LaunchTurboPump, FnLaunchTurboPump, PMState.LaunchingTurboPump);
  445. Transition(PMState.LaunchingTurboPump, FSM_MSG.TIMER, FnLaunchTurboPumpTimeout, PMState.Idle);
  446. Transition(PMState.LaunchingTurboPump, MSG.Abort, FnAbortStartTurboPumping, PMState.Idle);
  447. //vent sequence
  448. Transition(PMState.Idle, MSG.Vent, FnStartVent, PMState.Venting);
  449. Transition(PMState.Pumping, MSG.Vent, FnVentToPumping, PMState.Venting);
  450. Transition(PMState.Venting, FSM_MSG.TIMER, FnVentTimeout, PMState.Idle);
  451. Transition(PMState.Venting, MSG.Abort, FnAbortVent, PMState.Idle);
  452. //Pump sequence
  453. Transition(PMState.Idle, MSG.Pump, FnStartPumpDown, PMState.Pumping);
  454. Transition(PMState.Venting, MSG.Pump, FnVentToPumping, PMState.Pumping);
  455. Transition(PMState.Pumping, FSM_MSG.TIMER, FnPumpDownTimeout, PMState.Idle);
  456. Transition(PMState.Pumping, MSG.Abort, FnAbortPumping, PMState.Idle);
  457. //Pump Loadlock sequence
  458. //Transition(PMState.Idle, MSG.PumpLoadLock, FnStartPumpDownLoadLock, PMState.PumpingLoadLock);
  459. //Transition(PMState.VentingLoadLock, MSG.PumpLoadLock, FnVentLoadLockToPumpingLoadLock, PMState.PumpingLoadLock);
  460. //Transition(PMState.PumpingLoadLock, FSM_MSG.TIMER, FnPumpDownLoadLockTimeout, PMState.Idle);
  461. //Transition(PMState.PumpingLoadLock, MSG.Abort, FnAbortPumpingLoadLock, PMState.Idle);
  462. //Vent Loadlock sequence
  463. //Transition(PMState.Idle, MSG.VentLoadLock, FnStartVentLoadlock, PMState.VentingLoadLock);
  464. //Transition(PMState.PumpingLoadLock, MSG.VentLoadLock, FnPumpingLoadLockToVentLoadLock, PMState.VentingLoadLock);
  465. //Transition(PMState.VentingLoadLock, FSM_MSG.TIMER, FnVentLoadLockTimeout, PMState.Idle);
  466. //Transition(PMState.VentingLoadLock, MSG.Abort, FnAbortVentLoadLock, PMState.Idle);
  467. // Purge LoadLock sequence
  468. //Transition(PMState.Idle, MSG.PurgeLoadLock, FnStartPurgeLoadlock, PMState.PurgingLoadLock);
  469. //Transition(PMState.PurgingLoadLock, FSM_MSG.TIMER, FnPurgeLoadLockTimeout, PMState.Idle);
  470. //Transition(PMState.PurgingLoadLock, MSG.Abort, FnAbortPurgeLoadLock, PMState.Idle);
  471. //LoadLock Leak check sequence
  472. //Transition(PMState.Idle, MSG.LoadLockLeakCheck, FnStartLoadLockLeakCheck, PMState.LoadLockLeakCheck);
  473. //Transition(PMState.LoadLockLeakCheck, FSM_MSG.TIMER, FnLoadLockLeakCheckTimeout, PMState.Idle);
  474. //Transition(PMState.LoadLockLeakCheck, MSG.Abort, FnAbortLoadLockLeakCheck, PMState.Idle);
  475. // PM Purge sequence
  476. Transition(PMState.Idle, MSG.CyclePurge, FnStartPurge, PMState.Purging);
  477. Transition(PMState.Purging, FSM_MSG.TIMER, FnPurgeTimeout, PMState.Idle);
  478. Transition(PMState.Purging, MSG.Abort, FnAbortPurge, PMState.Idle);
  479. // PM GasLine Purge sequence
  480. Transition(PMState.Idle, MSG.GasLinePurge, FnStartGasLinePurge, PMState.GasLinePurge);
  481. Transition(PMState.GasLinePurge, FSM_MSG.TIMER, FnGasLinePurgeTimeout, PMState.Idle);
  482. Transition(PMState.GasLinePurge, MSG.Abort, FnAbortGasLinePurge, PMState.Idle);
  483. //PM Leak check sequence
  484. Transition(PMState.Idle, MSG.LeakCheck, FnStartPMLeakCheck, PMState.LeakCheck);
  485. Transition(PMState.LeakCheck, FSM_MSG.TIMER, FnPMLeakCheckTimeout, PMState.Idle);
  486. Transition(PMState.LeakCheck, MSG.Abort, FnAbortPMLeakCheck, PMState.Idle);
  487. //PM GasBox Leak check sequence
  488. Transition(PMState.Idle, MSG.GasLeakCheck, FnStartGasBoxLeakCheck, PMState.GasBoxLeakCheck);
  489. Transition(PMState.GasBoxLeakCheck, FSM_MSG.TIMER, FnGasBoxLeakCheckTimeout, PMState.Idle);
  490. Transition(PMState.GasBoxLeakCheck, MSG.Abort, FnAbortGasBoxLeakCheck, PMState.Idle);
  491. // PlaceWafer from LoadLock Arm sequence
  492. //Transition(PMState.Idle, MSG.LLPlace, FnStartLLPlace, PMState.LLPlacing);
  493. //Transition(PMState.LLPlacing, FSM_MSG.TIMER, FnLLPlaceTimeout, PMState.Idle);
  494. //Transition(PMState.LLPlacing, MSG.Abort, FnAbortLLPlace, PMState.Idle);
  495. // PickWafer to LoadLock Arm sequence
  496. //Transition(PMState.Idle, MSG.LLPick, FnStartLLPick, PMState.LLPicking);
  497. //Transition(PMState.LLPicking, FSM_MSG.TIMER, FnLLPickTimeout, PMState.Idle);
  498. //Transition(PMState.LLPicking, MSG.Abort, FnAbortLLPick, PMState.Idle);
  499. // Process
  500. Transition(PMState.Idle, MSG.RunRecipe, FnRunRecipe, PMState.Processing);
  501. Transition(PMState.Processing, FSM_MSG.TIMER, FnProcessTimeout, PMState.Idle);
  502. Transition(PMState.Processing, MSG.Abort, FnAbortProcess, PMState.Idle);
  503. // Clean
  504. Transition(PMState.Idle, MSG.Clean, FnRunRecipe, PMState.Clean);
  505. Transition(PMState.Clean, FSM_MSG.TIMER, FnProcessTimeout, PMState.Idle);
  506. Transition(PMState.Clean, MSG.Abort, FnAbortProcess, PMState.Idle);
  507. // Gas Flow sequence
  508. Transition(PMState.Idle, MSG.GasFlow, FnStartGasFlow, PMState.GasFlowing);
  509. Transition(PMState.GasFlowing, MSG.GasFlow, FnAbortGasFlow, PMState.Idle);
  510. Transition(PMState.GasFlowing, FSM_MSG.TIMER, FnGasFlowTimeout, PMState.Idle);
  511. Transition(PMState.GasFlowing, MSG.StopGasFlow, FnStopGasFlow, PMState.Idle);
  512. Transition(PMState.GasFlowing, MSG.Abort, FnAbortGasFlow, PMState.Idle);
  513. //RF Power sequence
  514. Transition(PMState.Idle, MSG.RfPower, FnStartRfPower, PMState.RfPowering);
  515. Transition(PMState.GasFlowing, MSG.RfPower, FnStartRfPower, PMState.RfPowering);
  516. Transition(PMState.RfPowering, FSM_MSG.TIMER, FnRfPowerTimeout, PMState.Idle);
  517. Transition(PMState.RfPowering, MSG.Abort, FnAbortRfPower, PMState.Idle);
  518. //MFC verification
  519. Transition(PMState.Idle, MSG.MFCVerification, FnStartMFCVerification, PMState.MFCVerification);
  520. Transition(PMState.MFCVerification, FSM_MSG.TIMER, FnMFCVerificationTimeout, PMState.Idle);
  521. Transition(PMState.MFCVerification, MSG.Abort, FnAbortMFCVerification, PMState.Idle);
  522. //////////////////////// Exchange Wafer with TM ///////////////////////////////////////////////////////
  523. // Pick Wafer from PM
  524. Transition(PMState.Idle, MSG.PreparePick, FnStartPreparePick, PMState.PreparePick);
  525. Transition(PMState.PreparePick, MSG.Abort, FnAbortPreparePick, PMState.Idle);
  526. Transition(PMState.PreparePick, FSM_MSG.TIMER, FnPreparePickTimeout, PMState.ReadyForPick);
  527. Transition(PMState.PreparePick, MSG.PreparePick, null, PMState.PreparePick);
  528. Transition(PMState.ReadyForPick, MSG.Abort, FnAbortPick, PMState.Idle);
  529. Transition(PMState.ReadyForPick, MSG.DropDownWafer, FnStartDropDownWafer, PMState.DropDownWafer);
  530. Transition(PMState.ReadyForPick, MSG.PreparePick, null, PMState.ReadyForPick);
  531. Transition(PMState.DropDownWafer, FSM_MSG.TIMER, FnDropDownTimeout, PMState.DropDownReady);
  532. Transition(PMState.DropDownReady, MSG.PickReady, FnStartFinishPick, PMState.FinishPick);
  533. Transition(PMState.ReadyForPick, MSG.PickReady, FnStartFinishPick, PMState.FinishPick);
  534. Transition(PMState.FinishPick, FSM_MSG.TIMER, FnFinishPickTimeout, PMState.Idle);
  535. // Place Wafer to PM
  536. Transition(PMState.Idle, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
  537. //Transition(PMState.Heating, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
  538. Transition(PMState.PreparePlace, MSG.Abort, FnAbortPreparePlace, PMState.Idle);
  539. Transition(PMState.PreparePlace, FSM_MSG.TIMER, FnPreparePlaceTimeout, PMState.ReadyForPlace);
  540. Transition(PMState.PreparePlace, MSG.PreparePlace, null, PMState.PreparePlace);
  541. Transition(PMState.ReadyForPlace, MSG.LiftUpWafer, FnStartLiftUpWafer, PMState.LiftUpWafer);
  542. Transition(PMState.LiftUpWafer, FSM_MSG.TIMER, FnLiftUpTimeout, PMState.LiftUpReady);
  543. Transition(PMState.LiftUpReady, MSG.PlaceReady, FnStartFinishPlace, PMState.FinishPlace);
  544. Transition(PMState.ReadyForPlace, MSG.PlaceReady, FnStartFinishPlace, PMState.FinishPlace);
  545. Transition(PMState.PreparePlace, MSG.Abort, FnAortPlace, PMState.Idle);
  546. Transition(PMState.ReadyForPlace, MSG.Abort, FnAortPlace, PMState.Idle);
  547. Transition(PMState.ReadyForPlace, MSG.PreparePlace, null, PMState.ReadyForPlace);
  548. Transition(PMState.LiftUpReady, MSG.Abort, FnAortPlace, PMState.Idle);
  549. Transition(PMState.FinishPlace, FSM_MSG.TIMER, FnFinishPlaceTimeout, PMState.Idle);
  550. // Swap Wafer With PM
  551. Transition(PMState.DropDownReady, MSG.PreparePlace, FnStartSwapPlace, PMState.PreparePlace);
  552. Transition(PMState.ReadyForPick, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
  553. Transition(PMState.Idle, MSG.PartialPressure, FnStartPartialPressure, PMState.PartialPressureTesting);
  554. Transition(PMState.PartialPressureTesting, FSM_MSG.TIMER, FnPartialPressureTimeout, PMState.Idle);
  555. Transition(PMState.PartialPressureTesting, MSG.Abort, FnAbortPartialPressure, PMState.Idle);
  556. Transition(PMState.Idle, MSG.VATPerformance, FnStartVATPerformance, PMState.VATPerformanceTesting);
  557. Transition(PMState.VATPerformanceTesting, FSM_MSG.TIMER, FnVATPerformanceTimeout, PMState.Idle);
  558. Transition(PMState.VATPerformanceTesting, MSG.Abort, FnAbortVATPerformance, PMState.Idle);
  559. //Transition(PMState.Idle, MSG.Heat, FnStartHeat, PMState.Heating);
  560. AnyStateTransition(FSM_MSG.TIMER, FnControlPressure, FSM_STATE.SAME);
  561. Running = true;
  562. WaferManager.Instance.SubscribeLocation(Module, 1);
  563. }
  564. protected override bool Init()
  565. {
  566. DATA.Subscribe($"{Module}.FsmState", () => (((PMState)fsm.State)), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  567. DATA.Subscribe($"{Module}.FsmPrevState", () => (((PMState)fsm.PrevState).ToString()), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  568. DATA.Subscribe($"{Module}.FsmLastMessage", () => (((MSG)fsm.LastMsg).ToString()), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  569. //DATA.Subscribe($"{Module}.LoadLockPurge.PurgeCounter", () => _purgeLoadLockRoutine.PurgeCounter, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  570. DATA.Subscribe($"{Module}.PartialPressureCounter", () => _pmPartialPressureRoutine.counter, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  571. DATA.Subscribe($"{Module}.VATPerformanceCounter", () => _pmVATPerformanceRoutine.counter, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  572. DATA.Subscribe($"{Module}.VATPerformanceResult", () => _pmVATPerformanceRoutine?.m_sb.ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  573. DATA.Subscribe($"{Module}.PartialPressureResult", () => _pmPartialPressureRoutine?.m_sb.ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
  574. DATA.Subscribe($"{Module}.MFCCalibrationDatas", () => _gasVerificationRoutine?._MFCCalibrationDatas, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  575. DATA.Subscribe($"{Module}.IsIdle", () => IsIdle, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  576. DATA.Subscribe($"{Module}.IsAlarm", () => IsError, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  577. DATA.Subscribe($"{Module}.IsBusy", () => IsBusy, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  578. DATA.Subscribe($"{Module}.IsInit", () => IsInit, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  579. DATA.Subscribe($"{Module}.IsOnline", () => _isOnline, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  580. DATA.Subscribe($"{Module}.VentingFlag", () => ChamberType == JetChamber.VenusSE || ChamberType == JetChamber.VenusDE ? _venusVentRoutine.VentingFlag: _ventRoutine.VentingFlag, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  581. //DATA.Subscribe($"{Module}.GetLeakCheckDatas", () => LeakCheckDataRecorder.GetAllLeakCheckData(Module.ToString()));
  582. DATA.Subscribe($"{Module}.CurrentRecipeResult", () => _processRoutine.currentRecipeResult, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  583. DATA.Subscribe($"{Module}.LeakCheck.Step", () => _leakCheckRoutine.CurrentStep, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  584. DATA.Subscribe($"{Module}.GasLeakCheck.Step", () => _gasBoxLeakCheckRoutine.CurrentStep, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  585. DATA.Subscribe($"{Module}.IsInclude", () => IsInclude, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  586. OP.Subscribe($"{Module}.{RtOperation.GasFlow}", (cmd, args) => CheckToPostMessage((int)MSG.GasFlow, args));
  587. OP.Subscribe($"{Module}.{RtOperation.LeakCheck}", (cmd, args) => CheckToPostMessage((int)MSG.LeakCheck, args));
  588. OP.Subscribe($"{Module}.{RtOperation.GasLeakCheck}", (cmd, args) => CheckToPostMessage((int)MSG.GasLeakCheck, args));
  589. OP.Subscribe($"{Module}.Home", (cmd, args) => CheckToPostMessage((int)MSG.Home));
  590. OP.Subscribe($"{Module}.{RtOperation.StartPump}", (cmd, args) => CheckToPostMessage((int)MSG.LaunchPump));
  591. OP.Subscribe($"{Module}.{RtOperation.StartTurboPump}", (cmd, args) => CheckToPostMessage((int)MSG.LaunchTurboPump));
  592. OP.Subscribe($"{Module}.{RtOperation.Pump}", (cmd, args) => CheckToPostMessage((int)MSG.Pump));
  593. OP.Subscribe($"{Module}.{RtOperation.Purge}", (cmd, args) => CheckToPostMessage((int)MSG.CyclePurge));
  594. OP.Subscribe($"{Module}.{RtOperation.RfPower}", (cmd, args) => CheckToPostMessage((int)MSG.RfPower));
  595. OP.Subscribe($"{Module}.{RtOperation.Vent}", (cmd, args) => CheckToPostMessage((int)MSG.Vent));
  596. OP.Subscribe($"{Module}.{RtOperation.VentLoadLock}", (cmd, args) => CheckToPostMessage((int)MSG.VentLoadLock));
  597. OP.Subscribe($"{Module}.{RtOperation.PurgeLoadLock}", (cmd, args) => CheckToPostMessage((int)MSG.PurgeLoadLock));
  598. OP.Subscribe($"{Module}.{RtOperation.PumpLoadLock}", (cmd, args) => CheckToPostMessage((int)MSG.PumpLoadLock));
  599. OP.Subscribe($"{Module}.{RtOperation.Reset}", (cmd, args) => CheckToPostMessage((int)MSG.Reset));
  600. OP.Subscribe($"{Module}.{RtOperation.Abort}", (cmd, args) => CheckToPostMessage((int)MSG.Abort));
  601. OP.Subscribe($"{Module}.{RtOperation.LLPick}", (cmd, args) => CheckToPostMessage((int)MSG.LLPick));
  602. OP.Subscribe($"{Module}.{RtOperation.LLPlace}", (cmd, args) => CheckToPostMessage((int)MSG.LLPlace));
  603. OP.Subscribe($"{Module}.{RtOperation.MFCVerification}", (cmd, args) => CheckToPostMessage((int)MSG.MFCVerification, args));
  604. OP.Subscribe($"{Module}.{RtOperation.RunRecipe}", (cmd, args) => CheckToPostMessage((int)MSG.RunRecipe, args));
  605. OP.Subscribe($"{Module}.{RtOperation.RunCleanRecipe}", (cmd, args) => CheckToPostMessage((int)MSG.Clean, args));
  606. OP.Subscribe($"{Module}.PartialPressureTest", (cmd, args) => CheckToPostMessage((int)MSG.PartialPressure, args[0], args[1]));
  607. OP.Subscribe($"{Module}.VATPerformanceTest", (cmd, args) => CheckToPostMessage((int)MSG.VATPerformance, args[0], args[1], args[2]));
  608. OP.Subscribe($"{Module}.GasLinePurge", (cmd, args) => CheckToPostMessage((int)MSG.GasLinePurge, args[0]));
  609. OP.Subscribe($"{Module}.ManualEndStep", (cmd, args) => ManualEndStep());
  610. OP.Subscribe($"{Module}.{RtOperation.Online}", (cmd, args) => CheckToPostMessage((int)MSG.Online));
  611. OP.Subscribe($"{Module}.{RtOperation.Offline}", (cmd, args) => CheckToPostMessage((int)MSG.Offline));
  612. OP.Subscribe($"{Module}.{RtOperation.PmError}", (cmd, args) => CheckToPostMessage((int)MSG.Error));
  613. OP.Subscribe($"{Module}.{RtOperation.Include}", (cmd, args) => FnSetInclude());
  614. OP.Subscribe($"{Module}.{RtOperation.Exclude}", (cmd, args) => FnSetExclude());
  615. OP.Subscribe($"{Module}.SubscribeStatsData",(cmd, args) =>
  616. {
  617. StatsDataManager.Instance.Subscribe(args[0].ToString(), args[1].ToString());
  618. return true;
  619. });
  620. StatsDataManager.Instance.Subscribe($"{Module}.ProcessedWaferCount", "Processed Wafer Count", 0);
  621. if (_chamber.IsRFAble())
  622. StatsDataManager.Instance.Subscribe($"{Module}.RfOnTime", "Rf On Time");
  623. if (_chamber.IsBiasRFAble())
  624. StatsDataManager.Instance.Subscribe($"{Module}.BiasRfOnTime", "Bias Rf On Time");
  625. StatsDataManager.Instance.Subscribe($"{Module}.PumpOnTime", "Pump On Time");
  626. _statProcessedWafer = StatsDataManager.Instance.GetItem($"{Module}.ProcessedWaferCount");
  627. _statRfOnTime = StatsDataManager.Instance.GetItemRFAndPump($"{Module}.RfOnTime");
  628. if (_chamber.IsBiasRFAble())
  629. _statBiasRfOnTime = StatsDataManager.Instance.GetItemRFAndPump($"{Module}.BiasRfOnTime");
  630. //_statPumpOnTime = StatsDataManager.Instance.GetItemRFAndPump($"{Module}.PumpOnTime");
  631. DATA.Subscribe($"{Module}.ProcessedWaferCount", () => _statProcessedWafer.Value, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  632. if (_chamber.IsRFAble())
  633. DATA.Subscribe($"{Module}.RfOnTime", () => _statRfOnTime.fromLastPM);
  634. if (_chamber.IsBiasRFAble())
  635. DATA.Subscribe($"{Module}.BiasRfOnTime", () => _statBiasRfOnTime.fromLastPM);
  636. //DATA.Subscribe($"{Module}.PumpOnTime", () => _statPumpOnTime.fromLastPM);
  637. if (ChamberType == JetChamber.Kepler2200A || ChamberType == JetChamber.Kepler2200B)
  638. {
  639. LOG.PMErrorInterrupt += (pmname,id) => PMErrorInterrupt(pmname,id);
  640. }
  641. return true;
  642. }
  643. private void PMErrorInterrupt(ModuleName pmname, eEvent eEventid)
  644. {
  645. if ( pmname == Module && stopEntityId.Contains(eEventid) && fsm.State != (int)PMState.Error)
  646. {
  647. CheckToPostMessage((int)MSG.Error);
  648. }
  649. }
  650. private bool ManualEndStep()
  651. {
  652. _processRoutine.isMaualEndStep = true;
  653. return true;
  654. }
  655. private bool FnIdle(object[] objs)
  656. {
  657. Running = false;
  658. return true;
  659. }
  660. private bool fEnterError(object[] objs)
  661. {
  662. DataCollectionManager.Instance.ManualInsertData();
  663. return true;
  664. }
  665. private bool fnEnterPickReady(object[] objs)
  666. {
  667. Status = PMStatus.Ready_For_Pick;
  668. return true;
  669. }
  670. private bool fnExitPickReady(object[] objs)
  671. {
  672. Status = PMStatus.Not_Ready;
  673. return true;
  674. }
  675. private bool fnEnterPlaceReady(object[] objs)
  676. {
  677. Status = PMStatus.Ready_For_Place;
  678. return true;
  679. }
  680. private bool fnExitPlaceReady(object[] objs)
  681. {
  682. Status = PMStatus.Not_Ready;
  683. return true;
  684. }
  685. private bool fnEnterDropDownReady(object[] objs)
  686. {
  687. Status = PMStatus.Exchange_Ready;
  688. return true;
  689. }
  690. private bool fnExitDropDownReady(object[] objs)
  691. {
  692. Status = PMStatus.Not_Ready;
  693. return true;
  694. }
  695. private bool fnEnterLiftUpReady(object[] objs)
  696. {
  697. Status = PMStatus.Exchange_Ready;
  698. return true;
  699. }
  700. private bool fnExitLiftUpReady(object[] objs)
  701. {
  702. Status = PMStatus.Not_Ready;
  703. return true;
  704. }
  705. private bool FnAlarm(object[] objs)
  706. {
  707. if ((PMState)fsm.State == PMState.Processing)
  708. {
  709. }
  710. return true;
  711. }
  712. private bool FnError(object[] objs)
  713. {
  714. Running = false;
  715. _isOnline = false;
  716. //if (((PMState)fsm.State == PMState.Processing) || ((PMState)fsm.State == PMState.PreProcess)
  717. // || ((PMState)fsm.State == PMState.Homing) || ((PMState)fsm.State == PMState.LoadProcessRecipe))
  718. // return false;
  719. //_chamber.CloseValves();
  720. //_chamber.GeneratorPowerOn(false);
  721. //_chamber.GeneratorBiasPowerOn(false);
  722. //_chamber.OpenValve(ValveType.TurboPumpPumping, true);
  723. //_chamber.OpenValve(ValveType.TurboPumpPurge, true);
  724. //_chamber.OnOffSetESCHV(false);
  725. _chamber.PMInError();
  726. if (IsProcessing)
  727. {
  728. WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Failed);
  729. }
  730. return true;
  731. }
  732. private bool FnTimeout(object[] objs)
  733. {
  734. _debugRoutine();
  735. return true;
  736. }
  737. private bool FnIdleTimeout(object[] objs)
  738. {
  739. _chamber.CheckIdleInterlock(0);
  740. //_debugRoutine();
  741. return true;
  742. }
  743. private bool FnErrorTimeout(object[] objs)
  744. {
  745. _chamber.CheckIdleInterlock(0);
  746. //_debugRoutine();
  747. return true;
  748. }
  749. private bool FnStartHome(object[] objs)
  750. {
  751. return _home.Start() == RState.Running;
  752. }
  753. private bool FnMonitorHome(object[] objs)
  754. {
  755. RState ret = _home.Monitor();
  756. if (ret == RState.Failed || ret == RState.Timeout)
  757. {
  758. PostMsg(MSG.Error);
  759. return false;
  760. }
  761. return ret == RState.End;
  762. }
  763. private bool FnAbortHome(object[] objs)
  764. {
  765. _home.Abort();
  766. return true;
  767. }
  768. private bool FnLaunchPump(object[] param)
  769. {
  770. return _startDryPumpRoutine.Start() == RState.Running;
  771. }
  772. private bool FnLaunchPumpTimeout(object[] param)
  773. {
  774. RState ret = _startDryPumpRoutine.Monitor();
  775. if (ret == RState.Failed || ret == RState.Timeout)
  776. {
  777. PostMsg(MSG.Error);
  778. return false;
  779. }
  780. return ret == RState.End;
  781. }
  782. private bool FnAbortStartPumping(object[] param)
  783. {
  784. _startDryPumpRoutine.Abort();
  785. return true;
  786. }
  787. private bool FnLaunchTurboPump(object[] param)
  788. {
  789. return _startTurboPumpRoutine.Start() == RState.Running;
  790. }
  791. private bool FnLaunchTurboPumpTimeout(object[] param)
  792. {
  793. RState ret = _startTurboPumpRoutine.Monitor();
  794. if (ret == RState.Failed || ret == RState.Timeout)
  795. {
  796. PostMsg(MSG.Error);
  797. return false;
  798. }
  799. return ret == RState.End;
  800. }
  801. private bool FnAbortStartTurboPumping(object[] param)
  802. {
  803. _startTurboPumpRoutine.Abort();
  804. return true;
  805. }
  806. private bool FnStartVent(object[] param)
  807. {
  808. switch (ChamberType)
  809. {
  810. case JetChamber.VenusSE:
  811. case JetChamber.VenusDE:
  812. return _venusVentRoutine.Start() == RState.Running;
  813. default:
  814. return _ventRoutine.Start() == RState.Running;
  815. }
  816. }
  817. private bool FnVentTimeout(object[] param)
  818. {
  819. RState ret;
  820. switch (ChamberType)
  821. {
  822. case JetChamber.VenusSE:
  823. case JetChamber.VenusDE:
  824. ret = _venusVentRoutine.Monitor();
  825. break;
  826. default:
  827. ret = _ventRoutine.Monitor();
  828. break;
  829. }
  830. if (ret == RState.Failed || ret == RState.Timeout)
  831. {
  832. PostMsg(MSG.Error);
  833. return false;
  834. }
  835. return ret == RState.End;
  836. }
  837. private bool FnVentToPumping(object[] param)
  838. {
  839. switch (ChamberType)
  840. {
  841. case JetChamber.VenusSE:
  842. case JetChamber.VenusDE:
  843. _venusVentRoutine.Abort();
  844. break;
  845. default:
  846. _ventRoutine.Abort();
  847. break;
  848. }
  849. return true; // FnStartPumpDown(param);
  850. }
  851. private bool FnAbortVent(object[] param)
  852. {
  853. switch (ChamberType)
  854. {
  855. case JetChamber.VenusSE:
  856. case JetChamber.VenusDE:
  857. _venusVentRoutine.Abort();
  858. break;
  859. default:
  860. _ventRoutine.Abort();
  861. break;
  862. }
  863. return true;
  864. }
  865. private bool FnStartPumpDown(object[] param)
  866. {
  867. return _pumpRoutine.Start() == RState.Running;
  868. }
  869. private bool FnPumpDownTimeout(object[] param)
  870. {
  871. RState ret = _pumpRoutine.Monitor();
  872. if (ret == RState.Failed || ret == RState.Timeout)
  873. {
  874. PostMsg(MSG.Error);
  875. return false;
  876. }
  877. return ret == RState.End;
  878. }
  879. private bool FnAbortPumping(object[] param)
  880. {
  881. _pumpRoutine.Abort();
  882. return true;
  883. }
  884. //private bool FnStartVentLoadlock(object[] param)
  885. //{
  886. // return _ventLoadLockRoutine.Start() == RState.Running;
  887. //}
  888. //private bool FnVentLoadLockTimeout(object[] param)
  889. //{
  890. // RState ret = _ventLoadLockRoutine.Monitor();
  891. // if (ret == RState.Failed || ret == RState.Timeout)
  892. // {
  893. // PostMsg(MSG.Error);
  894. // return false;
  895. // }
  896. // return ret == RState.End;
  897. //}
  898. //private bool FnVentLoadLockToPumpingLoadLock(object[] param)
  899. //{
  900. // _ventLoadLockRoutine.Abort();
  901. // return FnStartPumpDownLoadLock(param);
  902. //}
  903. //private bool FnAbortVentLoadLock(object[] param)
  904. //{
  905. // _ventLoadLockRoutine.Abort();
  906. // return true;
  907. //}
  908. //private bool FnStartPumpDownLoadLock(object[] param)
  909. //{
  910. // return _pumpLoadLockRoutine.Start() == RState.Running;
  911. //}
  912. //private bool FnPumpDownLoadLockTimeout(object[] param)
  913. //{
  914. // RState ret = _pumpLoadLockRoutine.Monitor();
  915. // if (ret == RState.Failed || ret == RState.Timeout)
  916. // {
  917. // PostMsg(MSG.Error);
  918. // return false;
  919. // }
  920. // return ret == RState.End;
  921. //}
  922. private bool FnPumpingToVent(object[] param)
  923. {
  924. _pumpRoutine.Abort();
  925. return FnStartVent(param);
  926. }
  927. //private bool FnPumpingLoadLockToVentLoadLock(object[] param)
  928. //{
  929. // _pumpLoadLockRoutine.Abort();
  930. // return FnStartVentLoadlock(param);
  931. //}
  932. //private bool FnAbortPumpingLoadLock(object[] param)
  933. //{
  934. // _pumpLoadLockRoutine.Abort();
  935. // return true;
  936. //}
  937. //private bool FnStartPurgeLoadlock(object[] param)
  938. //{
  939. // return _purgeLoadLockRoutine.Start() == RState.Running;
  940. //}
  941. //private bool FnPurgeLoadLockTimeout(object[] param)
  942. //{
  943. // RState ret = _purgeLoadLockRoutine.Monitor();
  944. // if (ret == RState.Failed || ret == RState.Timeout)
  945. // {
  946. // PostMsg(MSG.Error);
  947. // return false;
  948. // }
  949. // return ret == RState.End;
  950. //}
  951. //private bool FnAbortPurgeLoadLock(object[] param)
  952. //{
  953. // _purgeLoadLockRoutine.Abort();
  954. // return true;
  955. //}
  956. //private bool FnStartLoadLockLeakCheck(object[] param)
  957. //{
  958. // return _loadLockLeakCheckRoutine.Start() == RState.Running;
  959. //}
  960. //private bool FnLoadLockLeakCheckTimeout(object[] param)
  961. //{
  962. // RState ret = _loadLockLeakCheckRoutine.Monitor();
  963. // if (ret == RState.Failed || ret == RState.Timeout)
  964. // {
  965. // PostMsg(MSG.Error);
  966. // return false;
  967. // }
  968. // return ret == RState.End;
  969. //}
  970. //private bool FnAbortLoadLockLeakCheck(object[] param)
  971. //{
  972. // _loadLockLeakCheckRoutine.Abort();
  973. // return true;
  974. //}
  975. private bool FnStartPurge(object[] param)
  976. {
  977. return _purgeRoutine.Start() == RState.Running;
  978. }
  979. private bool FnPurgeTimeout(object[] param)
  980. {
  981. RState ret = _purgeRoutine.Monitor();
  982. if (ret == RState.Failed || ret == RState.Timeout)
  983. {
  984. PostMsg(MSG.Error);
  985. return false;
  986. }
  987. return ret == RState.End;
  988. }
  989. private bool FnAbortPurge(object[] param)
  990. {
  991. _purgeRoutine.Abort();
  992. return true;
  993. }
  994. private bool FnStartGasLinePurge(object[] param)
  995. {
  996. return _gaslinePurgeRoutine.Start(param) == RState.Running;
  997. }
  998. private bool FnGasLinePurgeTimeout(object[] param)
  999. {
  1000. RState ret = _gaslinePurgeRoutine.Monitor();
  1001. if (ret == RState.Failed || ret == RState.Timeout)
  1002. {
  1003. PostMsg(MSG.Error);
  1004. return false;
  1005. }
  1006. return ret == RState.End;
  1007. }
  1008. private bool FnAbortGasLinePurge(object[] param)
  1009. {
  1010. _gaslinePurgeRoutine.Abort();
  1011. return true;
  1012. }
  1013. private bool FnStartPMLeakCheck(object[] param)
  1014. {
  1015. return _leakCheckRoutine.Start(param) == RState.Running;
  1016. }
  1017. private bool FnPMLeakCheckTimeout(object[] param)
  1018. {
  1019. RState ret = _leakCheckRoutine.Monitor();
  1020. if (ret == RState.Failed || ret == RState.Timeout)
  1021. {
  1022. PostMsg(MSG.Error);
  1023. return false;
  1024. }
  1025. return ret == RState.End;
  1026. }
  1027. private bool FnAbortPMLeakCheck(object[] param)
  1028. {
  1029. _leakCheckRoutine.Abort();
  1030. return true;
  1031. }
  1032. private bool FnStartGasBoxLeakCheck(object[] param)
  1033. {
  1034. return _gasBoxLeakCheckRoutine.Start(param) == RState.Running;
  1035. }
  1036. private bool FnGasBoxLeakCheckTimeout(object[] param)
  1037. {
  1038. RState ret = _gasBoxLeakCheckRoutine.Monitor();
  1039. if (ret == RState.Failed || ret == RState.Timeout)
  1040. {
  1041. PostMsg(MSG.Error);
  1042. return false;
  1043. }
  1044. return ret == RState.End;
  1045. }
  1046. private bool FnAbortGasBoxLeakCheck(object[] param)
  1047. {
  1048. _gasBoxLeakCheckRoutine.Abort();
  1049. return true;
  1050. }
  1051. //private bool FnStartLLPlace(object[] param)
  1052. //{
  1053. // return _llPlaceRoutine.Start() == RState.Running;
  1054. //}
  1055. //private bool FnLLPlaceTimeout(object[] param)
  1056. //{
  1057. // RState ret = _llPlaceRoutine.Monitor();
  1058. // if (ret == RState.Failed || ret == RState.Timeout)
  1059. // {
  1060. // PostMsg(MSG.Error);
  1061. // return false;
  1062. // }
  1063. // return ret == RState.End;
  1064. //}
  1065. //private bool FnAbortLLPlace(object[] param)
  1066. //{
  1067. // _llPlaceRoutine.Abort();
  1068. // return true;
  1069. //}
  1070. //private bool FnStartLLPick(object[] param)
  1071. //{
  1072. // return _llPickRoutine.Start() == RState.Running;
  1073. //}
  1074. //private bool FnLLPickTimeout(object[] param)
  1075. //{
  1076. // RState ret = _llPickRoutine.Monitor();
  1077. // if (ret == RState.Failed || ret == RState.Timeout)
  1078. // {
  1079. // PostMsg(MSG.Error);
  1080. // return false;
  1081. // }
  1082. // return ret == RState.End;
  1083. //}
  1084. //private bool FnAbortLLPick(object[] param)
  1085. //{
  1086. // _llPickRoutine.Abort();
  1087. // return true;
  1088. //}
  1089. private bool FnRunRecipe(object[] param)
  1090. {
  1091. RState ret = _processRoutine.Start(param);
  1092. if (ret == RState.Failed || ret == RState.Timeout)
  1093. {
  1094. PostMsg(MSG.Error);
  1095. return false;
  1096. }
  1097. return ret == RState.Running;
  1098. }
  1099. private bool FnProcessTimeout(object[] param)
  1100. {
  1101. _chamber.CheckIdleInterlock(500);
  1102. RState ret = _processRoutine.Monitor();
  1103. if (ret == RState.Failed || ret == RState.Timeout)
  1104. {
  1105. PostMsg(MSG.Error);
  1106. return false;
  1107. }
  1108. if (ret == RState.End)
  1109. {
  1110. StatsDataManager.Instance.Increase(_statProcessedWafer.Name);
  1111. _dictRecipeTime[_processRoutine.currentRecipeResult.RecipeName] = fsm.ElapsedTime;
  1112. return true;
  1113. }
  1114. return false;
  1115. }
  1116. private bool FnAbortProcess(object[] param)
  1117. {
  1118. StatsDataManager.Instance.Increase(_statProcessedWafer.Name);
  1119. _processRoutine.Abort();
  1120. return true;
  1121. }
  1122. private bool FnStartGasFlow(object[] param)
  1123. {
  1124. return _gasFlowRoutine.Start(param) == RState.Running;
  1125. }
  1126. private bool FnGasFlowTimeout(object[] param)
  1127. {
  1128. RState ret = _gasFlowRoutine.Monitor();
  1129. if (ret == RState.Failed || ret == RState.Timeout)
  1130. {
  1131. PostMsg(MSG.Error);
  1132. return false;
  1133. }
  1134. return ret == RState.End;
  1135. }
  1136. private bool FnStopGasFlow(object[] param)
  1137. {
  1138. _gasFlowRoutine.Abort();
  1139. return true;
  1140. }
  1141. private bool FnAbortGasFlow(object[] param)
  1142. {
  1143. _gasFlowRoutine.Abort();
  1144. return true;
  1145. }
  1146. private bool FnStartRfPower(object[] param)
  1147. {
  1148. return _rfPowerRoutine.Start(param) == RState.Running;
  1149. }
  1150. private bool FnRfPowerTimeout(object[] param)
  1151. {
  1152. RState ret = _rfPowerRoutine.Monitor();
  1153. if (ret == RState.Failed || ret == RState.Timeout)
  1154. {
  1155. PostMsg(MSG.Error);
  1156. return false;
  1157. }
  1158. return ret == RState.End;
  1159. }
  1160. private bool FnAbortRfPower(object[] param)
  1161. {
  1162. _rfPowerRoutine.Abort();
  1163. if (_gasFlowRoutine._gasStatus)
  1164. {
  1165. _gasFlowRoutine.StopFlow();
  1166. }
  1167. return true;
  1168. }
  1169. private bool FnStartMFCVerification(object[] param)
  1170. {
  1171. _gasVerificationRoutine.Init((string)param[0], Convert.ToDouble(param[1]), (int)param[2]);
  1172. return _gasVerificationRoutine.Start(param) == RState.Running;
  1173. }
  1174. private bool FnMFCVerificationTimeout(object[] param)
  1175. {
  1176. RState ret = _gasVerificationRoutine.Monitor();
  1177. if (ret == RState.Failed || ret == RState.Timeout)
  1178. {
  1179. PostMsg(MSG.Error);
  1180. return false;
  1181. }
  1182. return ret == RState.End;
  1183. }
  1184. private bool FnAbortMFCVerification(object[] param)
  1185. {
  1186. _gasVerificationRoutine.Abort();
  1187. return true;
  1188. }
  1189. private bool FnControlPressure(object[] param)
  1190. {
  1191. if (RouteManager.IsATMMode)
  1192. {
  1193. return true;
  1194. }
  1195. if (IsOnline == true && fsm.State != (int)PMState.Processing && fsm.State != (int)PMState.Clean)
  1196. {
  1197. if (startControlPressureFlag == true)
  1198. {
  1199. startControlPressureFlag = false;
  1200. if (_chamber.GetPVPosition() <= 0)
  1201. {
  1202. LOG.Write(eEvent.WARN_PM, Module, $"{Module} control pressure fail,due to pendulum valve is not Open");
  1203. return false;
  1204. }
  1205. if (_chamber.IsTurboPumpRunning == false)
  1206. {
  1207. LOG.Write(eEvent.WARN_PM, Module, $"{Module} control pressure fail,due to turbo pump is not Open");
  1208. return false;
  1209. }
  1210. _controlPressureSetPoint = SC.GetValue<int>($"{Module}.ControlPressureSetPoint");
  1211. _controlFlowSetPoint = SC.GetValue<int>($"{Module}.ControlPressureN2FlowSetPoint");
  1212. _chamber.StartControlPressure(_controlPressureSetPoint, _controlFlowSetPoint);
  1213. }
  1214. }
  1215. else
  1216. {
  1217. if (startControlPressureFlag == false)
  1218. {
  1219. _chamber.AbortControlPressure();
  1220. startControlPressureFlag = true;
  1221. }
  1222. }
  1223. return true;
  1224. }
  1225. #region Exchange wafer with TM
  1226. private bool FnStartPreparePick(object[] param)
  1227. {
  1228. if (!_chamber.PreparePick())
  1229. {
  1230. LOG.Write(eEvent.ERR_PM, Module, $"Prepare Pick failed");
  1231. return false;
  1232. }
  1233. return true;
  1234. }
  1235. private bool FnPreparePickTimeout(object[] param)
  1236. {
  1237. // return _chamber.WaferIsDown && IsSlitDoorOpen;
  1238. return _chamber.PreparePickIsOK();
  1239. }
  1240. private bool FnAbortPreparePick(object[] param)
  1241. {
  1242. return true;
  1243. }
  1244. private bool FnStartFinishPick(object[] param)
  1245. {
  1246. //if (!_chamber.SetSlitDoor(false, out string reason))
  1247. //{
  1248. // LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
  1249. // return false;
  1250. //}
  1251. //return true;
  1252. return _chamber.EndPick();
  1253. }
  1254. private bool FnAbortPick(object[] param)
  1255. {
  1256. return true;
  1257. }
  1258. private bool FnFinishPickTimeout(object[] param)
  1259. {
  1260. //return IsSlitDoorClose;
  1261. return _chamber.EndPickIsOK();
  1262. }
  1263. private bool FnStartDropDownWafer(object[] param)
  1264. {
  1265. if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
  1266. {
  1267. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  1268. return false;
  1269. }
  1270. return _chamber.SetLiftPin(MovementPosition.Down, out string _);
  1271. }
  1272. private bool FnDropDownTimeout(object[] param)
  1273. {
  1274. return _chamber.LiftPinIsDown;
  1275. }
  1276. private bool FnStartPreparePlace(object[] param)
  1277. {
  1278. //if (_chamber.ChamberType == JetChamber.Venus || _chamber.ChamberType == JetChamber.Kepler2300)
  1279. //{
  1280. // if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
  1281. // {
  1282. // LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1283. // return false;
  1284. // }
  1285. //}
  1286. if (!_chamber.PreparePlace())
  1287. {
  1288. LOG.Write(eEvent.ERR_PM, Module, $"Set Wafer Down failed");
  1289. return false;
  1290. }
  1291. //string reason = "";
  1292. //if (!_chamber.SetLiftPin(MovementPosition.Down, out string reason))
  1293. //{
  1294. // LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1295. // return false;
  1296. //}
  1297. return true;
  1298. }
  1299. private bool FnPreparePlaceTimeout(object[] param)
  1300. {
  1301. return _chamber.PreparePlaceIsOK();
  1302. }
  1303. private bool FnAbortPreparePlace(object[] param)
  1304. {
  1305. return true;
  1306. }
  1307. private bool FnStartLiftUpWafer(object[] param)
  1308. {
  1309. if (!_chamber.SetLiftPin(MovementPosition.Up, out string reason))
  1310. {
  1311. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
  1312. return false;
  1313. }
  1314. return true;
  1315. }
  1316. private bool FnLiftUpTimeout(object[] param)
  1317. {
  1318. return _chamber.LiftPinIsUp;
  1319. }
  1320. private bool FnStartFinishPlace(object[] param)
  1321. {
  1322. return _chamber.EndPlace();
  1323. }
  1324. private bool FnAortPlace(object[] param)
  1325. {
  1326. return true;
  1327. }
  1328. private bool FnFinishPlaceTimeout(object[] param)
  1329. {
  1330. //return _chamber.LiftPinIsDown && IsSlitDoorClose;
  1331. return _chamber.EndPlaceIsOK();
  1332. }
  1333. private bool FnStartSwapPlace(object[] param)
  1334. {
  1335. return true;
  1336. }
  1337. private bool FnStartPartialPressure(object[] param)
  1338. {
  1339. return _pmPartialPressureRoutine.Start(param) == RState.Running;
  1340. }
  1341. private bool FnPartialPressureTimeout(object[] param)
  1342. {
  1343. RState ret = _pmPartialPressureRoutine.Monitor();
  1344. if (ret == RState.Failed || ret == RState.Timeout)
  1345. {
  1346. PostMsg(MSG.Error);
  1347. return false;
  1348. }
  1349. return ret == RState.End;
  1350. }
  1351. private bool FnAbortPartialPressure(object[] param)
  1352. {
  1353. _pmPartialPressureRoutine.Abort();
  1354. return true;
  1355. }
  1356. private bool FnStartVATPerformance(object[] param)
  1357. {
  1358. return _pmVATPerformanceRoutine.Start(param) == RState.Running;
  1359. }
  1360. private bool FnVATPerformanceTimeout(object[] param)
  1361. {
  1362. RState ret = _pmVATPerformanceRoutine.Monitor();
  1363. if (ret == RState.Failed || ret == RState.Timeout)
  1364. {
  1365. PostMsg(MSG.Error);
  1366. return false;
  1367. }
  1368. return ret == RState.End;
  1369. }
  1370. private bool FnAbortVATPerformance(object[] param)
  1371. {
  1372. _pmVATPerformanceRoutine.Abort();
  1373. return true;
  1374. }
  1375. //private bool FnStartHeat(object[] param)
  1376. //{
  1377. // if (ChamberType == JetChamber.Kepler2200A || ChamberType == JetChamber.Kepler2200B)
  1378. // {
  1379. // _pmHeatRoutine.Start();
  1380. // }
  1381. // return true;
  1382. //}
  1383. #endregion
  1384. private void _debugRoutine()
  1385. {
  1386. int flag = 0;
  1387. // Test Home routine
  1388. if (flag == 1)
  1389. {
  1390. PostMsg(MSG.Home);
  1391. }
  1392. else if (flag == 2)
  1393. {
  1394. PostMsg(MSG.Vent);
  1395. }
  1396. else if (flag == 3)
  1397. {
  1398. PostMsg(MSG.Pump);
  1399. }
  1400. else if (flag == 4)
  1401. {
  1402. PostMsg(MSG.PumpLoadLock);
  1403. }
  1404. else if (flag == 5)
  1405. {
  1406. PostMsg(MSG.VentLoadLock);
  1407. }
  1408. else if (flag == 6)
  1409. {
  1410. PostMsg(MSG.PurgeLoadLock);
  1411. }
  1412. else if (flag == 7)
  1413. {
  1414. PostMsg(MSG.LaunchPump);
  1415. }
  1416. else if (flag == 8)
  1417. {
  1418. PostMsg(MSG.LaunchTurboPump);
  1419. }
  1420. else if (flag == 9)
  1421. {
  1422. PostMsg(MSG.LoadLockLeakCheck);
  1423. }
  1424. else if (flag == 10)
  1425. {
  1426. PostMsg(MSG.CyclePurge);
  1427. }
  1428. else if (flag == 11)
  1429. {
  1430. PostMsg(MSG.GasLinePurge);
  1431. }
  1432. else if (flag == 12)
  1433. {
  1434. PostMsg(MSG.LeakCheck);
  1435. }
  1436. else if (flag == 13)
  1437. {
  1438. PostMsg(MSG.GasLeakCheck);
  1439. }
  1440. else if (flag == 14)
  1441. {
  1442. PostMsg(MSG.LLPlace);
  1443. }
  1444. else if (flag == 15)
  1445. {
  1446. PostMsg(MSG.LLPick);
  1447. }
  1448. else if (flag == 16)
  1449. {
  1450. PostMsg(MSG.RunRecipe, "7777");
  1451. }
  1452. else if (flag == 17)
  1453. {
  1454. PostMsg(MSG.MFCVerification, "MFC2", (double)50, 10);
  1455. }
  1456. }
  1457. }
  1458. }