JetPMBase.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. using Aitex.Core.RT.DataCenter;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.OperationCenter;
  4. using Aitex.Core.Util;
  5. using MECF.Framework.Common.Equipment;
  6. using System.Collections.Generic;
  7. using Venus_Core;
  8. using Aitex.Core.RT.Device.Unit;
  9. using Venus_RT.Modules;
  10. using System;
  11. using FabConnect.SecsGemInterface.Application.Objects.ProcessManagement;
  12. using Aitex.Core.RT.SCCore;
  13. namespace Venus_RT.Devices
  14. {
  15. abstract class JetPMBase : BaseDevice, IDevice
  16. {
  17. // 盖子的状态
  18. public abstract bool IsLidClosed { get; }
  19. public abstract bool IsLidLoadlockClosed { get; }
  20. public abstract bool IsSlitDoorClosed { get; }
  21. public abstract bool IsPumpRunning { get; }
  22. public abstract bool IsTurboPumpRunning { get; }
  23. public abstract bool IsTurboPumpAtSpeed { get; }
  24. public abstract float TurboPumpSpeed { get; }
  25. public abstract bool HasPumpError { get; }
  26. public abstract bool HasTurboPumpError { get; }
  27. public abstract bool IsCDA_OK { get; }
  28. public abstract bool IsFastPumpOpened { get; }
  29. public abstract bool IsSoftPumpOpened { get; }
  30. public abstract bool IsMfc1ValveOpened { get; }
  31. public abstract bool IsMfc2ValveOpened { get; }
  32. public abstract bool IsMfc3ValveOpened { get; }
  33. public abstract bool IsMfc4ValveOpened { get; }
  34. public abstract bool IsMfc5ValveOpened { get; }
  35. public abstract bool IsMfc6ValveOpened { get; }
  36. public abstract bool IsMfc7ValveOpened { get; }
  37. public abstract bool IsMfc8ValveOpened { get; }
  38. public abstract bool IsGuageValveOpened { get; }
  39. public abstract bool IsATM { get; }
  40. public abstract bool PVN22ValveIsOpen { get; }
  41. public abstract bool LiftPinIsDown { get; }
  42. public abstract bool LiftPinIsUp { get; }
  43. public abstract bool IsATMLoadlock { get; }
  44. public abstract bool IsVACLoadLock { get; }
  45. public abstract bool IsVAC { get; }
  46. public abstract bool IsWaterFlowOk { get; }
  47. public abstract bool IsWLK { get; }
  48. public abstract bool IsRFGInterlockOn { get; }
  49. public abstract bool PMLidClosed { get; }
  50. public abstract bool TurboPumpInterlock { get; }
  51. public abstract bool SourceRFFanInterlock { get; }
  52. public abstract bool SlitDoorClosed { get; }
  53. public abstract double ProcessLowPressure { get; }
  54. public abstract double ProcessHighPressure { get; }
  55. public abstract double ProcessPressure { get; }
  56. public abstract double ChamberPressure { get; }
  57. public abstract double ForelinePressure { get; }
  58. public abstract double TargetPressure { get; }
  59. public abstract double ESCHePressure { get; }
  60. public abstract int ESCOutputVoltage { get; }
  61. public abstract double ESCPositiveOutputCurrent { get; }//R+
  62. public abstract double ESCNegativeOutputCurrent { get; }//R-
  63. public abstract bool IsHVOn { get; }
  64. public abstract float CoolantInletTempFB { get; }
  65. public abstract float CoolantOutletTempFB { get; }
  66. public abstract bool ChillerIsRunning { get; }
  67. //Loadlock_Arm
  68. public abstract bool IsLoadlockArmRetract { get; }
  69. public abstract bool IsLoadlockArmExtend { get; }
  70. //Loadlock_Arm DO
  71. public abstract bool LoadlockArmRetract { get; }
  72. public abstract bool LoadlockArmExtend { get; }
  73. public abstract float ReflectPower { get; }
  74. public abstract float BiasReflectPower { get; }
  75. public abstract bool BackSideHeOutOfRange { get; }
  76. public abstract float RFMatchC1 { get; }
  77. public abstract float RFMatchC2 { get; }
  78. public abstract float BiasRFMatchC1 { get; }
  79. public abstract float BiasRFMatchC2 { get; }
  80. public new ModuleName Module;
  81. public abstract MovementPosition LiftPinPosition { get; }
  82. public abstract bool CheckAtm();
  83. public abstract bool CheckSlitDoorOpen();
  84. public abstract bool CheckSlitDoorClose();
  85. public abstract bool CheckLiftUp();
  86. public abstract bool CheckLiftDown();
  87. public abstract double TotalGasSetpoint { get; }
  88. public abstract bool HasGasOutOfRange { get; }
  89. public abstract bool PendulumValveIsOpen();
  90. public abstract double LoadlockPressure { get; }
  91. public double TMPressure { get { return Singleton<RouteManager>.Instance.TM.TMPressure; } }
  92. public bool IsTMATM
  93. {
  94. get
  95. {
  96. if (Singleton<RouteManager>.Instance.TM != null)
  97. {
  98. return Singleton<RouteManager>.Instance.TM.IsTMATM;
  99. }
  100. else
  101. {
  102. return Singleton<RouteManager>.Instance.seTM.TMIsATM;
  103. }
  104. }
  105. }
  106. public bool IsTMVAC
  107. {
  108. get
  109. {
  110. if (Singleton<RouteManager>.Instance.TM != null)
  111. {
  112. return Singleton<RouteManager>.Instance.TM.IsTMVac;
  113. }
  114. else
  115. {
  116. return Singleton<RouteManager>.Instance.seTM.TMIsVAC;
  117. }
  118. }
  119. }
  120. // EndPoint
  121. private readonly JetEPDBase _epdClient;
  122. public List<string> EPDCfgList => _epdClient?.CFGFileList;
  123. //public List<string> EPDCfgList=new List<string>() { "1","2"};
  124. public bool EPDCaptured => _epdClient.Captured;
  125. public bool EPDConnected => _epdClient.IsEPDConnected;
  126. public JetChamber ChamberType = JetChamber.None;
  127. public JetPMBase(ModuleName module) : base(module.ToString(), module.ToString(), module.ToString(), module.ToString())
  128. {
  129. Module = module;
  130. _epdClient = DEVICE.GetDevice<JetEPDBase>($"{Module}.{VenusDevice.EndPoint}");
  131. ChamberType = (JetChamber)SC.GetValue<int>($"{Module}.ChamberType");
  132. DATA.Subscribe($"{Name}.ForelinePressure", () => ForelinePressure);
  133. DATA.Subscribe($"{Name}.ProcessHighPressure", () => ProcessHighPressure);
  134. DATA.Subscribe($"{Name}.ProcessLowPressure", () => ProcessLowPressure);
  135. DATA.Subscribe($"{Name}.ESCHePressure", () => ESCHePressure);
  136. DATA.Subscribe($"{Name}.LoadlockPressure", () => LoadlockPressure);
  137. DATA.Subscribe($"{Name}.IsATM", () => IsATM, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  138. DATA.Subscribe($"{Name}.IsVAC", () => IsVAC, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  139. DATA.Subscribe($"{Name}.LiftPinIsUp", () => LiftPinIsUp, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  140. DATA.Subscribe($"{Name}.LiftPinIsDown", () => LiftPinIsDown, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  141. DATA.Subscribe($"{Name}.PumpIsRunning", () => IsPumpRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  142. DATA.Subscribe($"{Name}.TurboPumpIsRunning", () => IsTurboPumpRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  143. DATA.Subscribe($"{Name}.IsSlitDoorClosed", () => IsSlitDoorClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  144. DATA.Subscribe($"{Name}.IsLidClosed", () => IsLidClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  145. DATA.Subscribe($"{Name}.TurboPumpRotationalSpeed", () => TurboPumpSpeed);
  146. DATA.Subscribe($"{Name}.IsWaterFlowOk", () => IsWaterFlowOk, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  147. DATA.Subscribe($"{Name}.IsWLK", () => IsWLK, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  148. DATA.Subscribe($"{Name}.IsCDA_OK", () => IsCDA_OK, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  149. DATA.Subscribe($"{Name}.SourceRFFanInterlock", () => SourceRFFanInterlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  150. DATA.Subscribe($"{Name}.IsTurboPumpInterlock", () => TurboPumpInterlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  151. DATA.Subscribe($"{Name}.IsATMLoadlock", () => IsATMLoadlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  152. DATA.Subscribe($"{Name}.IsVACLoadlock", () => IsVACLoadLock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  153. DATA.Subscribe($"{Name}.GetPVPosition", () => GetPVPosition());
  154. DATA.Subscribe($"{Name}.ESCHV.Temp", () => CoolantOutletTempFB);
  155. DATA.Subscribe($"{Name}.Chiller.Temp", () => CoolantInletTempFB);
  156. //DATA.Subscribe($"{Name}.Chiller.IsOn", () => ChillerIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  157. DATA.Subscribe($"{Name}.IsTurboPumpAtSpeed", () => IsTurboPumpAtSpeed);
  158. DATA.Subscribe($"{Name}.EPDCfgList", () => EPDCfgList, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  159. OP.Subscribe($"{Module}.SetLiftPin", (cmd, args) =>
  160. {
  161. if ((bool)args[0] == true)
  162. {
  163. return SetLiftPin(MovementPosition.Up, out _);
  164. }
  165. else
  166. {
  167. return SetLiftPin(MovementPosition.Down, out _);
  168. }
  169. });
  170. OP.Subscribe($"{Module}.SetSRf", (cmd, args) =>
  171. {
  172. var ison = (bool)args[1];
  173. if (ison == true)
  174. {
  175. GeneratorPowerOn(true);
  176. GeneratorSetpower((float)args[0]);
  177. }
  178. else
  179. {
  180. GeneratorPowerOn(false);
  181. }
  182. return true;
  183. });
  184. OP.Subscribe($"{Module}.SetBRf", (cmd, args) =>
  185. {
  186. var ison = (bool)args[1];
  187. if (ison == true)
  188. {
  189. GeneratorBiasPowerOn(true);
  190. GeneratorBiasSetpower((float)args[0]);
  191. }
  192. else
  193. {
  194. GeneratorBiasPowerOn(false);
  195. }
  196. return true;
  197. });
  198. OP.Subscribe($"{Module}.SetSlitDoor", (cmd, args) =>
  199. {
  200. SetSlitDoor((bool)args[0], out _);
  201. return true;
  202. });
  203. OP.Subscribe($"{Module}.SetESCHVIsOn", (cmd, args) =>
  204. {
  205. OnOffSetESCHV((bool)args[0]);
  206. return true;
  207. });
  208. OP.Subscribe($"{Module}.SetESCHV", (cmd, args) =>
  209. {
  210. SetESCClampVoltage((int)args[0]);
  211. return true;
  212. });
  213. OP.Subscribe($"{Module}.SetPVPostion", (cmd, args) =>
  214. {
  215. SetPVPostion((int)args[0]);
  216. return true;
  217. });
  218. OP.Subscribe($"{Module}.SetPVPressure", (cmd, args) =>
  219. {
  220. SetPVPressure((int)args[0]);
  221. return true;
  222. });
  223. OP.Subscribe($"{Module}.ClosePump", (cmd, args) =>
  224. {
  225. TurnDryPump(false);
  226. return true;
  227. });
  228. OP.Subscribe($"{Module}.CloseTurboPump", (cmd, args) =>
  229. {
  230. TurnTurboPump(false);
  231. return true;
  232. });
  233. OP.Subscribe($"{Module}.ControlValve", (cmd, args) =>
  234. {
  235. if (ChamberType == JetChamber.VenusSE)
  236. {
  237. if (Enum.TryParse(args[0].ToString(), out ValveType targetvalve))
  238. {
  239. OpenValve(targetvalve, (bool)args[1]);
  240. }
  241. }
  242. else
  243. {
  244. OpenValve((ValveType)((int)args[0]), (bool)args[1]);
  245. }
  246. return true;
  247. });
  248. OP.Subscribe($"{Module}.TurnPendulumValve", (cmd, args) =>
  249. {
  250. TurnPendulumValve((bool)args[0]);
  251. return true;
  252. });
  253. OP.Subscribe($"{Module}.HeatChiller", (cmd, args) =>
  254. {
  255. var chillerType = (ChillerType)Enum.Parse(typeof(ChillerType), args[0].ToString());
  256. HeatChiller(chillerType, (float)args[1], (float)args[2]);
  257. return true;
  258. });
  259. OP.Subscribe($"{Module}.OnOffChiller", (cmd, args) =>
  260. {
  261. var chillerType = (ChillerType)Enum.Parse(typeof(ChillerType), args[0].ToString());
  262. var ison = Convert.ToBoolean(args[1]);
  263. OnOffChiller(chillerType, ison);
  264. return true;
  265. });
  266. OP.Subscribe($"{Module}.WallChiller", (cmd, args) =>
  267. {
  268. float value;
  269. float.TryParse(args[0].ToString(), out value);
  270. SetWallTCTemperature(value);
  271. return true;
  272. });
  273. OP.Subscribe($"{Module}.SetBacksideHeFlow", (cmd, args) =>
  274. {
  275. double value;
  276. double.TryParse(args[0].ToString(), out value);
  277. SetBacksideHeFlow(value);
  278. return true;
  279. });
  280. OP.Subscribe($"{Module}.SetBacksideHePressure", (cmd, args) =>
  281. {
  282. float value;
  283. float.TryParse(args[0].ToString(), out value);
  284. SetBacksideHePressure(value);
  285. return true;
  286. });
  287. OP.Subscribe($"{Module}.EndPoint.SearchCfg", (cmd, args) =>
  288. {
  289. _epdClient?.QueryConfigList();
  290. return true;
  291. });
  292. }
  293. public abstract void CloseValves();
  294. public abstract void TurnDryPump(bool on);
  295. public abstract void TurnTurboPump(bool on);
  296. public abstract void OpenValve(ValveType vlvType, bool on);
  297. public virtual void Monitor()
  298. {
  299. }
  300. public virtual bool Initialize()
  301. {
  302. return true;
  303. }
  304. public virtual void Terminate()
  305. {
  306. }
  307. public virtual void Reset()
  308. {
  309. }
  310. public abstract bool OnOffSetESCHV(bool on);
  311. public abstract bool SetWallTCTemperature(float value);
  312. protected abstract void CheckPermanentInterlock();
  313. public abstract void CheckIdleInterlock();
  314. public abstract void BuzzerBlinking(double time);
  315. public abstract void SwitchOnBuzzerAndRed();
  316. public abstract void Home();
  317. public virtual bool SetLiftPin(MovementPosition dirt, out string reason)
  318. {
  319. reason = "";
  320. return false;
  321. }
  322. public abstract bool SetSlitDoor(bool open, out string reason);
  323. public abstract bool RetractWafer();
  324. public abstract bool ExtendWafer();
  325. public abstract bool FlowGas(int gasNum, double val);
  326. public abstract bool StopGas(int gasNum);
  327. public abstract bool FlowN2(double val);
  328. public abstract bool StopN2();
  329. public abstract void StopAllGases();
  330. public abstract bool TurnPendulumValve(bool on);
  331. public abstract bool SetPVPressure(int pressure);
  332. public abstract bool SetPVPostion(int position);
  333. public abstract int GetPVPosition();
  334. public abstract void HeatChiller(ChillerType chillerType, double value, double offset);
  335. public abstract void OnOffChiller(ChillerType chillerType, bool onoff);
  336. public abstract bool CheckChillerStatus();
  337. public abstract void SetGeneratorCommunicationMode(int mode);
  338. public abstract bool GeneratorPowerOn(bool on);
  339. public abstract bool GeneratorSetpower(float val);
  340. public abstract bool GeneratorBiasPowerOn(bool on);
  341. public abstract bool GeneratorBiasSetpower(float val);
  342. public abstract bool GeneratorBiasSetMatchMode(bool val);
  343. public abstract bool SetMatchPosition(float c1, float c2);
  344. public abstract bool SetBiasMatchPosition(float c1, float c2);
  345. public virtual bool SetMatchWorkMode(MatchWorkMode matchWorkMode)
  346. {
  347. return false;
  348. }
  349. public virtual bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
  350. {
  351. return false;
  352. }
  353. public abstract bool SetBiasPulseMode(bool on);
  354. public abstract bool SetBiasPulseRateFreq(int nFreq);
  355. public abstract bool SetDiasPulseDutyCycle(int percentage);
  356. public abstract bool SetESCClampVoltage(int nVoltage);
  357. public abstract bool CheckGeneratorAndHVInterlock(VenusDevice device);
  358. #region EndPoint
  359. public void EPDRecipeStart(string recipe)
  360. {
  361. try
  362. {
  363. _epdClient?.RecipeStart(recipe);
  364. }
  365. catch
  366. {
  367. }
  368. }
  369. public void EPDRecipeStop()
  370. {
  371. try
  372. {
  373. _epdClient?.RecipeStop();
  374. }
  375. catch
  376. {
  377. }
  378. }
  379. public void EPDStepStart(string cfgName, int step)
  380. {
  381. try
  382. {
  383. _epdClient?.StepStart(cfgName, step);
  384. }
  385. catch
  386. {
  387. }
  388. }
  389. public void EPDStepStop()
  390. {
  391. try
  392. {
  393. _epdClient?.StepStop();
  394. }
  395. catch
  396. {
  397. }
  398. }
  399. #endregion
  400. public abstract void SetBacksideHeFlow(double flow);
  401. public abstract bool SetBacksideHePressure(float mTorr);
  402. public abstract bool SetBacksideHeThreshold(int nMin, int nMax);
  403. public virtual bool HighTemperatureHeaterGotoPosition(HighTemperatureHeaterPosition highTemperatureHeaterPosition)
  404. {
  405. return false;
  406. }
  407. public virtual bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
  408. {
  409. return false;
  410. }
  411. public virtual bool AbortControlPressure()
  412. {
  413. return false;
  414. }
  415. public virtual bool PreparePlace()
  416. {
  417. return false;
  418. }
  419. public virtual bool PreparePlaceIsOK()
  420. {
  421. return false;
  422. }
  423. public virtual bool PreparePick()
  424. {
  425. return false;
  426. }
  427. public virtual bool PreparePickIsOK()
  428. {
  429. return false;
  430. }
  431. public virtual bool EndPlace()
  432. {
  433. return false;
  434. }
  435. public virtual bool EndPlaceIsOK()
  436. {
  437. return false;
  438. }
  439. public virtual bool EndPick()
  440. {
  441. return false;
  442. }
  443. public virtual bool EndPickIsOK()
  444. {
  445. return false;
  446. }
  447. }
  448. }