JetPMBase.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  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. namespace Venus_RT.Devices
  13. {
  14. abstract class JetPMBase : BaseDevice, IDevice
  15. {
  16. // 盖子的状态
  17. public abstract bool IsLidClosed { get; }
  18. public abstract bool IsLidLoadlockClosed { get; }
  19. public abstract bool IsSlitDoorClosed { get; }
  20. public abstract bool IsPumpRunning { get; }
  21. public abstract bool IsTurboPumpRunning { get; }
  22. public abstract bool IsTurboPumpAtSpeed { get; }
  23. public abstract float TurboPumpSpeed { get; }
  24. public abstract bool HasPumpError { get; }
  25. public abstract bool HasTurboPumpError { get; }
  26. public abstract bool IsCDA_OK { get; }
  27. public abstract bool IsFastPumpOpened { get; }
  28. public abstract bool IsSoftPumpOpened { get; }
  29. public abstract bool IsMfc1ValveOpened { get; }
  30. public abstract bool IsMfc2ValveOpened { get; }
  31. public abstract bool IsMfc3ValveOpened { get; }
  32. public abstract bool IsMfc4ValveOpened { get; }
  33. public abstract bool IsMfc5ValveOpened { get; }
  34. public abstract bool IsMfc6ValveOpened { get; }
  35. public abstract bool IsMfc7ValveOpened { get; }
  36. public abstract bool IsMfc8ValveOpened { get; }
  37. public abstract bool IsGuageValveOpened { get; }
  38. public abstract bool IsATM { get; }
  39. public abstract bool PVN22ValveIsOpen { get; }
  40. public abstract bool LiftPinIsDown { get; }
  41. public abstract bool LiftPinIsUp { get; }
  42. public abstract bool IsATMLoadlock { get; }
  43. public abstract bool IsVACLoadLock { get; }
  44. public abstract bool IsVAC { get; }
  45. public abstract bool IsWaterFlowOk { get; }
  46. public abstract bool IsWLK { get; }
  47. public abstract bool IsRFGInterlockOn { get; }
  48. public abstract bool PMLidClosed { get; }
  49. public abstract bool TurboPumpInterlock { get; }
  50. public abstract bool SourceRFFanInterlock { get; }
  51. public abstract bool SlitDoorClosed { get; }
  52. public abstract double ProcessLowPressure { get; }
  53. public abstract double ProcessHighPressure { get; }
  54. public abstract double ProcessPressure { get; }
  55. public abstract double ChamberPressure { get; }
  56. public abstract double ForelinePressure { get; }
  57. public abstract double TargetPressure { get; }
  58. public abstract double ESCHePressure { get; }
  59. public abstract int ESCOutputVoltage { get; }
  60. public abstract double ESCPositiveOutputCurrent { get; }//R+
  61. public abstract double ESCNegativeOutputCurrent { get; }//R-
  62. public abstract bool IsHVOn { get; }
  63. public abstract float CoolantInletTempFB { get; }
  64. public abstract float CoolantOutletTempFB { get; }
  65. public abstract bool ChillerIsRunning { get; }
  66. //Loadlock_Arm
  67. public abstract bool IsLoadlockArmRetract { get; }
  68. public abstract bool IsLoadlockArmExtend { get; }
  69. //Loadlock_Arm DO
  70. public abstract bool LoadlockArmRetract { get; }
  71. public abstract bool LoadlockArmExtend { get; }
  72. public abstract float ReflectPower { get; }
  73. public abstract float BiasReflectPower { get; }
  74. public abstract bool BackSideHeOutOfRange { get; }
  75. public new ModuleName Module;
  76. public abstract MovementPosition LiftPinPosition { get; }
  77. public abstract bool CheckAtm();
  78. public abstract bool CheckSlitDoorOpen();
  79. public abstract bool CheckSlitDoorClose();
  80. public abstract bool CheckLiftUp();
  81. public abstract bool CheckLiftDown();
  82. public abstract double TotalGasSetpoint { get; }
  83. public abstract bool HasGasOutOfRange { get; }
  84. public abstract bool PendulumValveIsOpen();
  85. public abstract double LoadlockPressure { get; }
  86. public double TMPressure { get { return Singleton<RouteManager>.Instance.TM.TMPressure; } }
  87. public bool IsTMATM { get { return Singleton<RouteManager>.Instance.TM.IsTMATM; } }
  88. public bool IsTMVAC { get { return Singleton<RouteManager>.Instance.TM.IsTMVac; } }
  89. // EndPoint
  90. private readonly JetEPDBase _epdClient;
  91. public List<string> EPDCfgList => _epdClient?.CFGFileList;
  92. //public List<string> EPDCfgList=new List<string>() { "1","2"};
  93. public bool EPDCaptured => _epdClient.Captured;
  94. public bool EPDConnected => _epdClient.IsEPDConnected;
  95. public JetPMBase(ModuleName module) : base(module.ToString(), module.ToString(), module.ToString(), module.ToString())
  96. {
  97. Module = module;
  98. _epdClient = DEVICE.GetDevice<JetEPDBase>($"{Module}.{VenusDevice.EndPoint}");
  99. DATA.Subscribe($"{Name}.ForelinePressure", () => ForelinePressure);
  100. DATA.Subscribe($"{Name}.ProcessHighPressure", () => ProcessHighPressure);
  101. DATA.Subscribe($"{Name}.ProcessLowPressure", () => ProcessLowPressure);
  102. DATA.Subscribe($"{Name}.ESCHePressure", () => ESCHePressure);
  103. DATA.Subscribe($"{Name}.LoadlockPressure", () => LoadlockPressure);
  104. DATA.Subscribe($"{Name}.IsATM", () => IsATM, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  105. DATA.Subscribe($"{Name}.IsVAC", () => IsVAC, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  106. DATA.Subscribe($"{Name}.LiftPinIsUp", () => LiftPinIsUp, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  107. DATA.Subscribe($"{Name}.LiftPinIsDown", () => LiftPinIsDown, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  108. DATA.Subscribe($"{Name}.PumpIsRunning", () => IsPumpRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  109. DATA.Subscribe($"{Name}.TurboPumpIsRunning", () => IsTurboPumpRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  110. DATA.Subscribe($"{Name}.IsSlitDoorClosed", () => IsSlitDoorClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  111. DATA.Subscribe($"{Name}.IsLidClosed", () => IsLidClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  112. DATA.Subscribe($"{Name}.TurboPumpRotationalSpeed", () => TurboPumpSpeed);
  113. DATA.Subscribe($"{Name}.IsWaterFlowOk", () => IsWaterFlowOk, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  114. DATA.Subscribe($"{Name}.IsWLK", () => IsWLK, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  115. DATA.Subscribe($"{Name}.IsCDA_OK", () => IsCDA_OK, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  116. DATA.Subscribe($"{Name}.SourceRFFanInterlock", () => SourceRFFanInterlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  117. DATA.Subscribe($"{Name}.IsTurboPumpInterlock", () => TurboPumpInterlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  118. DATA.Subscribe($"{Name}.IsATMLoadlock", () => IsATMLoadlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  119. DATA.Subscribe($"{Name}.IsVACLoadlock", () => IsVACLoadLock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  120. DATA.Subscribe($"{Name}.GetPVPosition", () => GetPVPosition());
  121. DATA.Subscribe($"{Name}.ESCHV.Temp", () => CoolantOutletTempFB);
  122. DATA.Subscribe($"{Name}.Chiller.Temp", () => CoolantInletTempFB);
  123. //DATA.Subscribe($"{Name}.Chiller.IsOn", () => ChillerIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  124. DATA.Subscribe($"{Name}.IsTurboPumpAtSpeed", () => IsTurboPumpAtSpeed);
  125. DATA.Subscribe($"{Name}.EPDCfgList", () => EPDCfgList, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  126. OP.Subscribe($"{Module}.SetLiftPin", (cmd, args) => {
  127. if ((bool)args[0] == true)
  128. {
  129. return SetLiftPin(MovementPosition.Up, out _);
  130. }
  131. else
  132. {
  133. return SetLiftPin(MovementPosition.Down, out _);
  134. }
  135. });
  136. OP.Subscribe($"{Module}.SetSRf", (cmd, args) =>
  137. {
  138. var ison = (bool)args[1];
  139. if (ison == true)
  140. {
  141. GeneratorPowerOn(true);
  142. GeneratorSetpower((float)args[0]);
  143. }
  144. else
  145. {
  146. GeneratorPowerOn(false);
  147. }
  148. return true;
  149. });
  150. OP.Subscribe($"{Module}.SetBRf", (cmd, args) => {
  151. var ison = (bool)args[1];
  152. if (ison == true)
  153. {
  154. GeneratorBiasPowerOn(true);
  155. GeneratorBiasSetpower((float)args[0]);
  156. }
  157. else
  158. {
  159. GeneratorBiasPowerOn(false);
  160. }
  161. return true;
  162. });
  163. OP.Subscribe($"{Module}.SetSlitDoor", (cmd, args) => {
  164. SetSlitDoor((bool)args[0], out _);
  165. return true;
  166. });
  167. OP.Subscribe($"{Module}.SetESCHVIsOn", (cmd, args) => {
  168. OnOffSetESCHV((bool)args[0]);
  169. return true;
  170. });
  171. OP.Subscribe($"{Module}.SetESCHV", (cmd, args) => {
  172. SetESCClampVoltage((int)args[0]);
  173. return true;
  174. });
  175. OP.Subscribe($"{Module}.SetPVPostion", (cmd, args) => {
  176. SetPVPostion((int)args[0]);
  177. return true;
  178. });
  179. OP.Subscribe($"{Module}.SetPVPressure", (cmd, args) => {
  180. SetPVPressure((int)args[0]);
  181. return true;
  182. });
  183. OP.Subscribe($"{Module}.ClosePump", (cmd, args) => {
  184. TurnDryPump(false);
  185. return true;
  186. });
  187. OP.Subscribe($"{Module}.CloseTurboPump", (cmd, args) => {
  188. TurnTurboPump(false);
  189. return true;
  190. });
  191. OP.Subscribe($"{Module}.ControlValve", (cmd, args) => {
  192. OpenValve((ValveType)((int)args[0]), (bool)args[1]);
  193. return true;
  194. });
  195. OP.Subscribe($"{Module}.TurnPendulumValve", (cmd, args) => {
  196. TurnPendulumValve((bool)args[0]);
  197. return true;
  198. });
  199. OP.Subscribe($"{Module}.HeatChiller", (cmd, args) => {
  200. var chillerType = (ChillerType)Enum.Parse(typeof(ChillerType), args[0].ToString());
  201. HeatChiller(chillerType, (float)args[1], (float)args[2]);
  202. return true;
  203. });
  204. OP.Subscribe($"{Module}.OnOffChiller", (cmd, args) => {
  205. var chillerType = (ChillerType)Enum.Parse(typeof(ChillerType), args[0].ToString());
  206. var ison = Convert.ToBoolean(args[1]);
  207. OnOffChiller(chillerType, ison);
  208. return true;
  209. });
  210. OP.Subscribe($"{Module}.WallChiller", (cmd, args) => {
  211. float value;
  212. float.TryParse(args[0].ToString(), out value);
  213. SetWallTCTemperature(value);
  214. return true;
  215. });
  216. OP.Subscribe($"{Module}.SetBacksideHeFlow", (cmd, args) => {
  217. double value;
  218. double.TryParse(args[0].ToString(), out value);
  219. SetBacksideHeFlow(value);
  220. return true;
  221. });
  222. OP.Subscribe($"{Module}.SetBacksideHePressure", (cmd, args) =>
  223. {
  224. float value;
  225. float.TryParse(args[0].ToString(), out value);
  226. SetBacksideHePressure(value);
  227. return true;
  228. });
  229. OP.Subscribe($"{Module}.EndPoint.SearchCfg", (cmd, args) =>
  230. {
  231. _epdClient?.QueryConfigList();
  232. return true;
  233. });
  234. }
  235. public abstract void CloseValves();
  236. public abstract void TurnDryPump(bool on);
  237. public abstract void TurnTurboPump(bool on);
  238. public abstract void OpenValve(ValveType vlvType, bool on);
  239. public virtual void Monitor()
  240. {
  241. }
  242. public virtual bool Initialize()
  243. {
  244. return true;
  245. }
  246. public virtual void Terminate()
  247. {
  248. }
  249. public virtual void Reset()
  250. {
  251. }
  252. public abstract bool OnOffSetESCHV(bool on);
  253. public abstract bool SetWallTCTemperature(float value);
  254. protected abstract void CheckPermanentInterlock();
  255. public abstract void CheckIdleInterlock();
  256. public abstract void BuzzerBlinking(double time);
  257. public abstract void SwitchOnBuzzerAndRed();
  258. public abstract void Home();
  259. public abstract bool SetLiftPin(MovementPosition dirt, out string reason);
  260. public abstract bool SetSlitDoor(bool open, out string reason);
  261. public abstract bool RetractWafer();
  262. public abstract bool ExtendWafer();
  263. public abstract bool FlowGas(int gasNum, double val);
  264. public abstract bool StopGas(int gasNum);
  265. public abstract bool FlowN2(double val);
  266. public abstract bool StopN2();
  267. public abstract void StopAllGases();
  268. public abstract bool TurnPendulumValve(bool on);
  269. public abstract bool SetPVPressure(int pressure);
  270. public abstract bool SetPVPostion(int position);
  271. public abstract int GetPVPosition();
  272. public abstract void HeatChiller(ChillerType chillerType,double value, double offset);
  273. public abstract void OnOffChiller(ChillerType chillerType,bool onoff);
  274. public abstract bool CheckChillerStatus();
  275. public abstract void SetGeneratorCommunicationMode(int mode);
  276. public abstract bool GeneratorPowerOn(bool on);
  277. public abstract bool GeneratorSetpower(float val);
  278. public abstract bool GeneratorBiasPowerOn(bool on);
  279. public abstract bool GeneratorBiasSetpower(float val);
  280. public abstract bool GeneratorBiasSetMatchMode(bool val);
  281. public abstract bool SetMatchPosition(float c1, float c2);
  282. public abstract bool SetBiasMatchPosition(float c1, float c2);
  283. public abstract bool SetBiasPulseMode(bool on);
  284. public abstract bool SetBiasPulseRateFreq(int nFreq);
  285. public abstract bool SetDiasPulseDutyCycle(int percentage);
  286. public abstract bool SetESCClampVoltage(int nVoltage);
  287. public abstract bool CheckGeneratorAndHVInterlock(VenusDevice device);
  288. #region EndPoint
  289. public void EPDRecipeStart(string recipe)
  290. {
  291. try
  292. {
  293. _epdClient?.RecipeStart(recipe);
  294. }
  295. catch
  296. {
  297. }
  298. }
  299. public void EPDRecipeStop()
  300. {
  301. try
  302. {
  303. _epdClient?.RecipeStop();
  304. }
  305. catch
  306. {
  307. }
  308. }
  309. public void EPDStepStart(string cfgName, int step)
  310. {
  311. try
  312. {
  313. _epdClient?.StepStart(cfgName, step);
  314. }
  315. catch
  316. {
  317. }
  318. }
  319. public void EPDStepStop()
  320. {
  321. try
  322. {
  323. _epdClient?.StepStop();
  324. }
  325. catch
  326. {
  327. }
  328. }
  329. #endregion
  330. public abstract void SetBacksideHeFlow(double flow);
  331. public abstract bool SetBacksideHePressure(float mTorr);
  332. public abstract bool SetBacksideHeThreshold(int nMin, int nMax);
  333. }
  334. }