JetPMBase.cs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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 { get { return Singleton<RouteManager>.Instance.TM.IsTMATM; } }
  93. public bool IsTMVAC { get { return Singleton<RouteManager>.Instance.TM.IsTMVac; } }
  94. // EndPoint
  95. private readonly JetEPDBase _epdClient;
  96. public List<string> EPDCfgList => _epdClient?.CFGFileList;
  97. //public List<string> EPDCfgList=new List<string>() { "1","2"};
  98. public bool EPDCaptured => _epdClient.Captured;
  99. public bool EPDConnected => _epdClient.IsEPDConnected;
  100. public JetChamber ChamberType= JetChamber.None;
  101. public JetPMBase(ModuleName module) : base(module.ToString(), module.ToString(), module.ToString(), module.ToString())
  102. {
  103. Module = module;
  104. _epdClient = DEVICE.GetDevice<JetEPDBase>($"{Module}.{VenusDevice.EndPoint}");
  105. ChamberType= (JetChamber)SC.GetValue<int>($"{Module}.ChamberType");
  106. DATA.Subscribe($"{Name}.ForelinePressure", () => ForelinePressure);
  107. DATA.Subscribe($"{Name}.ProcessHighPressure", () => ProcessHighPressure);
  108. DATA.Subscribe($"{Name}.ProcessLowPressure", () => ProcessLowPressure);
  109. DATA.Subscribe($"{Name}.ESCHePressure", () => ESCHePressure);
  110. DATA.Subscribe($"{Name}.LoadlockPressure", () => LoadlockPressure);
  111. DATA.Subscribe($"{Name}.IsATM", () => IsATM, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  112. DATA.Subscribe($"{Name}.IsVAC", () => IsVAC, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  113. DATA.Subscribe($"{Name}.LiftPinIsUp", () => LiftPinIsUp, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  114. DATA.Subscribe($"{Name}.LiftPinIsDown", () => LiftPinIsDown, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  115. DATA.Subscribe($"{Name}.PumpIsRunning", () => IsPumpRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  116. DATA.Subscribe($"{Name}.TurboPumpIsRunning", () => IsTurboPumpRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  117. DATA.Subscribe($"{Name}.IsSlitDoorClosed", () => IsSlitDoorClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  118. DATA.Subscribe($"{Name}.IsLidClosed", () => IsLidClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  119. DATA.Subscribe($"{Name}.TurboPumpRotationalSpeed", () => TurboPumpSpeed);
  120. DATA.Subscribe($"{Name}.IsWaterFlowOk", () => IsWaterFlowOk, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  121. DATA.Subscribe($"{Name}.IsWLK", () => IsWLK, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  122. DATA.Subscribe($"{Name}.IsCDA_OK", () => IsCDA_OK, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  123. DATA.Subscribe($"{Name}.SourceRFFanInterlock", () => SourceRFFanInterlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  124. DATA.Subscribe($"{Name}.IsTurboPumpInterlock", () => TurboPumpInterlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  125. DATA.Subscribe($"{Name}.IsATMLoadlock", () => IsATMLoadlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  126. DATA.Subscribe($"{Name}.IsVACLoadlock", () => IsVACLoadLock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  127. DATA.Subscribe($"{Name}.GetPVPosition", () => GetPVPosition());
  128. DATA.Subscribe($"{Name}.ESCHV.Temp", () => CoolantOutletTempFB);
  129. DATA.Subscribe($"{Name}.Chiller.Temp", () => CoolantInletTempFB);
  130. //DATA.Subscribe($"{Name}.Chiller.IsOn", () => ChillerIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  131. DATA.Subscribe($"{Name}.IsTurboPumpAtSpeed", () => IsTurboPumpAtSpeed);
  132. DATA.Subscribe($"{Name}.EPDCfgList", () => EPDCfgList, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  133. OP.Subscribe($"{Module}.SetLiftPin", (cmd, args) => {
  134. if ((bool)args[0] == true)
  135. {
  136. return SetLiftPin(MovementPosition.Up, out _);
  137. }
  138. else
  139. {
  140. return SetLiftPin(MovementPosition.Down, out _);
  141. }
  142. });
  143. OP.Subscribe($"{Module}.SetSRf", (cmd, args) =>
  144. {
  145. var ison = (bool)args[1];
  146. if (ison == true)
  147. {
  148. GeneratorPowerOn(true);
  149. GeneratorSetpower((float)args[0]);
  150. }
  151. else
  152. {
  153. GeneratorPowerOn(false);
  154. }
  155. return true;
  156. });
  157. OP.Subscribe($"{Module}.SetBRf", (cmd, args) => {
  158. var ison = (bool)args[1];
  159. if (ison == true)
  160. {
  161. GeneratorBiasPowerOn(true);
  162. GeneratorBiasSetpower((float)args[0]);
  163. }
  164. else
  165. {
  166. GeneratorBiasPowerOn(false);
  167. }
  168. return true;
  169. });
  170. OP.Subscribe($"{Module}.SetSlitDoor", (cmd, args) => {
  171. SetSlitDoor((bool)args[0], out _);
  172. return true;
  173. });
  174. OP.Subscribe($"{Module}.SetESCHVIsOn", (cmd, args) => {
  175. OnOffSetESCHV((bool)args[0]);
  176. return true;
  177. });
  178. OP.Subscribe($"{Module}.SetESCHV", (cmd, args) => {
  179. SetESCClampVoltage((int)args[0]);
  180. return true;
  181. });
  182. OP.Subscribe($"{Module}.SetPVPostion", (cmd, args) => {
  183. SetPVPostion((int)args[0]);
  184. return true;
  185. });
  186. OP.Subscribe($"{Module}.SetPVPressure", (cmd, args) => {
  187. SetPVPressure((int)args[0]);
  188. return true;
  189. });
  190. OP.Subscribe($"{Module}.ClosePump", (cmd, args) => {
  191. TurnDryPump(false);
  192. return true;
  193. });
  194. OP.Subscribe($"{Module}.CloseTurboPump", (cmd, args) => {
  195. TurnTurboPump(false);
  196. return true;
  197. });
  198. OP.Subscribe($"{Module}.ControlValve", (cmd, args) => {
  199. OpenValve((ValveType)((int)args[0]), (bool)args[1]);
  200. return true;
  201. });
  202. OP.Subscribe($"{Module}.TurnPendulumValve", (cmd, args) => {
  203. TurnPendulumValve((bool)args[0]);
  204. return true;
  205. });
  206. OP.Subscribe($"{Module}.HeatChiller", (cmd, args) => {
  207. var chillerType = (ChillerType)Enum.Parse(typeof(ChillerType), args[0].ToString());
  208. HeatChiller(chillerType, (float)args[1], (float)args[2]);
  209. return true;
  210. });
  211. OP.Subscribe($"{Module}.OnOffChiller", (cmd, args) => {
  212. var chillerType = (ChillerType)Enum.Parse(typeof(ChillerType), args[0].ToString());
  213. var ison = Convert.ToBoolean(args[1]);
  214. OnOffChiller(chillerType, ison);
  215. return true;
  216. });
  217. OP.Subscribe($"{Module}.WallChiller", (cmd, args) => {
  218. float value;
  219. float.TryParse(args[0].ToString(), out value);
  220. SetWallTCTemperature(value);
  221. return true;
  222. });
  223. OP.Subscribe($"{Module}.SetBacksideHeFlow", (cmd, args) => {
  224. double value;
  225. double.TryParse(args[0].ToString(), out value);
  226. SetBacksideHeFlow(value);
  227. return true;
  228. });
  229. OP.Subscribe($"{Module}.SetBacksideHePressure", (cmd, args) =>
  230. {
  231. float value;
  232. float.TryParse(args[0].ToString(), out value);
  233. SetBacksideHePressure(value);
  234. return true;
  235. });
  236. OP.Subscribe($"{Module}.EndPoint.SearchCfg", (cmd, args) =>
  237. {
  238. _epdClient?.QueryConfigList();
  239. return true;
  240. });
  241. }
  242. public abstract void CloseValves();
  243. public abstract void TurnDryPump(bool on);
  244. public abstract void TurnTurboPump(bool on);
  245. public abstract void OpenValve(ValveType vlvType, bool on);
  246. public virtual void Monitor()
  247. {
  248. }
  249. public virtual bool Initialize()
  250. {
  251. return true;
  252. }
  253. public virtual void Terminate()
  254. {
  255. }
  256. public virtual void Reset()
  257. {
  258. }
  259. public abstract bool OnOffSetESCHV(bool on);
  260. public abstract bool SetWallTCTemperature(float value);
  261. protected abstract void CheckPermanentInterlock();
  262. public abstract void CheckIdleInterlock();
  263. public abstract void BuzzerBlinking(double time);
  264. public abstract void SwitchOnBuzzerAndRed();
  265. public abstract void Home();
  266. public abstract bool SetLiftPin(MovementPosition dirt, out string reason);
  267. public abstract bool SetSlitDoor(bool open, out string reason);
  268. public abstract bool RetractWafer();
  269. public abstract bool ExtendWafer();
  270. public abstract bool FlowGas(int gasNum, double val);
  271. public abstract bool StopGas(int gasNum);
  272. public abstract bool FlowN2(double val);
  273. public abstract bool StopN2();
  274. public abstract void StopAllGases();
  275. public abstract bool TurnPendulumValve(bool on);
  276. public abstract bool SetPVPressure(int pressure);
  277. public abstract bool SetPVPostion(int position);
  278. public abstract int GetPVPosition();
  279. public abstract void HeatChiller(ChillerType chillerType,double value, double offset);
  280. public abstract void OnOffChiller(ChillerType chillerType,bool onoff);
  281. public abstract bool CheckChillerStatus();
  282. public abstract void SetGeneratorCommunicationMode(int mode);
  283. public abstract bool GeneratorPowerOn(bool on);
  284. public abstract bool GeneratorSetpower(float val);
  285. public abstract bool GeneratorBiasPowerOn(bool on);
  286. public abstract bool GeneratorBiasSetpower(float val);
  287. public abstract bool GeneratorBiasSetMatchMode(bool val);
  288. public abstract bool SetMatchPosition(float c1, float c2);
  289. public abstract bool SetBiasMatchPosition(float c1, float c2);
  290. public abstract bool SetBiasPulseMode(bool on);
  291. public abstract bool SetBiasPulseRateFreq(int nFreq);
  292. public abstract bool SetDiasPulseDutyCycle(int percentage);
  293. public abstract bool SetESCClampVoltage(int nVoltage);
  294. public abstract bool CheckGeneratorAndHVInterlock(VenusDevice device);
  295. #region EndPoint
  296. public void EPDRecipeStart(string recipe)
  297. {
  298. try
  299. {
  300. _epdClient?.RecipeStart(recipe);
  301. }
  302. catch
  303. {
  304. }
  305. }
  306. public void EPDRecipeStop()
  307. {
  308. try
  309. {
  310. _epdClient?.RecipeStop();
  311. }
  312. catch
  313. {
  314. }
  315. }
  316. public void EPDStepStart(string cfgName, int step)
  317. {
  318. try
  319. {
  320. _epdClient?.StepStart(cfgName, step);
  321. }
  322. catch
  323. {
  324. }
  325. }
  326. public void EPDStepStop()
  327. {
  328. try
  329. {
  330. _epdClient?.StepStop();
  331. }
  332. catch
  333. {
  334. }
  335. }
  336. #endregion
  337. public abstract void SetBacksideHeFlow(double flow);
  338. public abstract bool SetBacksideHePressure(float mTorr);
  339. public abstract bool SetBacksideHeThreshold(int nMin, int nMax);
  340. }
  341. }