PMEntity.cs 61 KB

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