JetVenusSEPM.cs 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Device.Unit;
  4. using Aitex.Core.RT.Log;
  5. using Aitex.Core.RT.SCCore;
  6. using MECF.Framework.Common.Device.Bases;
  7. using MECF.Framework.Common.Equipment;
  8. using MECF.Framework.Common.SubstrateTrackings;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Threading.Tasks;
  14. using Venus_Core;
  15. using Venus_RT.Devices.IODevices;
  16. using IoMfc = Venus_RT.Devices.IODevices.IoMfc;
  17. namespace Venus_RT.Devices
  18. {
  19. class JetVenusSEPM : JetVenusSEPMBase
  20. {
  21. #region io变量定义
  22. private readonly IoLid _Lid;
  23. private readonly IoCylinder _slitDoor;
  24. private readonly IoCylinder _LiftPin;
  25. private readonly IoValve _PVN21Valve;
  26. private readonly IoValve _PVN22Valve;
  27. private readonly IoValve _PV11Valve;
  28. private readonly IoValve _PV12Valve;
  29. private readonly IoValve _PV21Valve;
  30. private readonly IoValve _PV22Valve;
  31. private readonly IoValve _PV31Valve;
  32. private readonly IoValve _PV32Valve;
  33. private readonly IoValve _PV41Valve;
  34. private readonly IoValve _PV42Valve;
  35. private readonly IoValve _PV51Valve;//新增
  36. private readonly IoValve _PV52Valve;//新增
  37. private readonly IoValve _PV61Valve;//新增
  38. private readonly IoValve _PV62Valve;//新增
  39. private readonly IoValve _PV71Valve;//新增
  40. private readonly IoValve _PV72Valve;//新增
  41. private readonly IoValve _PV81Valve;//新增
  42. private readonly IoValve _PV82Valve;//新增
  43. private readonly IoValve _PV91Valve;//新增
  44. private readonly IoValve _PV92Valve;//新增
  45. private readonly IoValve _PVA1Valve;//新增
  46. private readonly IoValve _PVA2Valve;//新增
  47. private readonly IoValve _PVB1Valve;//新增
  48. private readonly IoValve _PVB2Valve;//新增
  49. private readonly IoValve _PVC1Valve;//新增
  50. private readonly IoValve _PVC2Valve;//新增
  51. private readonly IoValve _N2Valve;
  52. private readonly IoValve _Mfc1Valve;
  53. private readonly IoValve _Mfc2Valve;
  54. private readonly IoValve _Mfc3Valve;
  55. private readonly IoValve _Mfc4Valve;
  56. private readonly IoValve _Mfc5Valve;
  57. private readonly IoValve _Mfc6Valve;
  58. private readonly IoValve _Mfc7Valve;
  59. private readonly IoValve _Mfc8Valve;
  60. private readonly IoValve _Mfc9Valve; //新增
  61. private readonly IoValve _Mfc10Valve;//新增
  62. private readonly IoValve _Mfc11Valve;//新增 空的
  63. private readonly IoValve _Mfc12Valve;//新增
  64. private readonly IoValve _PVHe1Valve;
  65. private readonly IoValve _PVHe2Valve;
  66. private readonly IoValve _GasFinalValve;
  67. private readonly IoValve _SoftPumpValve;
  68. private readonly IoValve _FastPumpValve;
  69. private readonly IoValve _TurboPumpPumpingValve;
  70. private readonly IoValve _TurboPumpPurgeValve;
  71. private readonly IoValve _GuageValve;
  72. private readonly IoValve _PVHe3Valve;
  73. private readonly IoValve _HeISOValve;
  74. private readonly IoValve _MainPurgeValve;//新增
  75. private readonly IoSensor _ATM_sw;
  76. private readonly IoSensor _CDAPressure;
  77. private readonly IoSensor _N2Pressure_sw;
  78. private readonly IoSensor _VAC_sw;
  79. private readonly IoSensor _WLK_sw;
  80. private readonly IoSensor _Water_Flow;
  81. private readonly IoSensor _RFG_Interlock;
  82. private readonly IoSensor _PM_Lid_Closed;
  83. private readonly IoSensor _Source_RF_Fan;
  84. private readonly IoSensor _TurboPumpInterlock;
  85. private readonly IoSensor _GasBoxDoor;
  86. private readonly IoSensor _GasBoxPressure;
  87. private readonly PumpBase _MainPump;
  88. private readonly ESC5HighVoltage _ESCHV;
  89. private readonly AdixenTurboPump _TurboPump;
  90. private readonly PendulumValve _pendulumValve;
  91. private readonly ChillerBase _Chiller;
  92. private readonly RfPowerBase _Generator;//srf=>AdTecGenerator
  93. private readonly RfPowerBase _GeneratorBias;//brf=>CometRF
  94. private readonly RfMatchBase _Match;
  95. private readonly RfMatchBase _BiasMatch;
  96. private readonly IoHeater _ForelineTC;
  97. private readonly IoHeater _WallTC;
  98. private readonly IoPressureControl _pressureController;
  99. private readonly IoGasStick[] _gasLines;
  100. private readonly IoGasStick _gasLineN2;
  101. private readonly IoBacksideHe _backsideHe;
  102. private readonly IoMfc _heMfc;
  103. private readonly double _foreline_interlock_pressure = 750;
  104. private readonly Dictionary<ValveType, IoValve> Valve2IO;
  105. #endregion
  106. #region 构造函数
  107. public JetVenusSEPM(ModuleName moduleName) : base(moduleName)
  108. {
  109. Module = moduleName;
  110. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
  111. _slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.SlitDoor}");
  112. _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
  113. _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
  114. _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
  115. _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
  116. _PV12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV12}");
  117. _PV21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV21}");
  118. _PV22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV22}");
  119. _PV31Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV31}");
  120. _PV32Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV32}");
  121. _PV41Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV41}");
  122. _PV42Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV42}");
  123. _PV51Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV51}");
  124. _PV52Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV52}");
  125. _PV61Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV61}");
  126. _PV62Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV62}");
  127. _PV71Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV71}");
  128. _PV72Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV72}");
  129. _PV81Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV81}");
  130. _PV82Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV82}");
  131. _PV91Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV91}");
  132. _PV92Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV92}");
  133. _PVA1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVA1}");
  134. _PVA2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVA2}");
  135. _PVB1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVB1}");
  136. _PVB2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVB2}");
  137. _PVC1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVC1}");
  138. _PVC2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVC2}");
  139. _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
  140. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
  141. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  142. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc3}");
  143. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc4}");
  144. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc5}");
  145. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc6}");
  146. _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc7}");
  147. _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc8}");
  148. _Mfc9Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc9}");
  149. _Mfc10Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc10}");
  150. _Mfc11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc11}");
  151. _Mfc12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc12}");
  152. _PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
  153. _PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
  154. _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
  155. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
  156. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
  157. _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
  158. _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
  159. _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
  160. _PVHe3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe3}");
  161. _HeISOValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveHeISO}");
  162. _heMfc = DEVICE.GetDevice<IoMfc>($"{Module}.MfcHe");
  163. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  164. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  165. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  166. _Water_Flow = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk");
  167. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  168. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  169. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  170. _PM_Lid_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorPMLidClosed");
  171. _Source_RF_Fan = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSourceRFFan");
  172. _TurboPumpInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.TurboPumpInterlock");
  173. _GasBoxDoor = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxDoorSW");
  174. _GasBoxPressure = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxPressureSW");
  175. _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  176. _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
  177. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  178. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
  179. _gasLines = new IoGasStick[8];
  180. for (int index = 0; index < 8; index++)
  181. {
  182. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  183. }
  184. _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
  185. _backsideHe = DEVICE.GetDevice<IoBacksideHe>($"{Module}.BacksideHelium");
  186. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VenusDevice.MainPump}");
  187. // RS232 Dry pump, SKY
  188. if (SC.GetValue<int>($"{Module}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  189. {
  190. if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  191. {
  192. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VenusDevice.MainPump}");
  193. }
  194. else if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  195. {
  196. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VenusDevice.MainPump}");
  197. }
  198. }
  199. _ESCHV = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
  200. _TurboPump = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
  201. _pendulumValve = DEVICE.GetDevice<PendulumValve>($"{Module}.{VenusDevice.PendulumValve}");
  202. if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
  203. SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS232)
  204. {
  205. if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
  206. {
  207. _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
  208. }
  209. else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
  210. {
  211. _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
  212. }
  213. }
  214. // RS223 AdTec Generator
  215. if (SC.GetValue<int>($"{Module}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  216. SC.GetValue<int>($"{Module}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  217. {
  218. _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.Rf}");
  219. }
  220. // Ethernet Comet Generator Bias
  221. if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
  222. {
  223. if (SC.GetValue<int>($"{Module}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  224. SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  225. {
  226. _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
  227. }
  228. else if (SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
  229. {
  230. _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.BiasRf}");
  231. }
  232. }
  233. // RS232 AdTec match
  234. if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  235. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.AdTec)
  236. {
  237. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
  238. }
  239. // Bias Match
  240. if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  241. SC.GetValue<int>($"{Module}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  242. SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  243. {
  244. _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
  245. }
  246. _foreline_interlock_pressure = SC.GetValue<double>($"{Module}.ForelineInterlockPressure");
  247. Valve2IO = new Dictionary<ValveType, IoValve>()
  248. {
  249. { ValveType.PVN21, _PVN21Valve },
  250. { ValveType.PVN22, _PVN22Valve },
  251. { ValveType.PV11, _PV11Valve },
  252. { ValveType.PV12, _PV12Valve },
  253. { ValveType.PV21, _PV21Valve },
  254. { ValveType.PV22, _PV22Valve },
  255. { ValveType.PV31, _PV31Valve },
  256. { ValveType.PV32, _PV32Valve },
  257. { ValveType.PV41, _PV41Valve },
  258. { ValveType.PV42, _PV42Valve },
  259. { ValveType.PV51, _PV51Valve },
  260. { ValveType.PV52, _PV52Valve },
  261. { ValveType.PV61, _PV61Valve },
  262. { ValveType.PV62, _PV62Valve },
  263. { ValveType.PV71, _PV71Valve },
  264. { ValveType.PV72, _PV72Valve },
  265. { ValveType.PV81, _PV81Valve },
  266. { ValveType.PV82, _PV82Valve },
  267. { ValveType.PV91, _PV91Valve },
  268. { ValveType.PV92, _PV92Valve },
  269. { ValveType.PVA1, _PVA1Valve },
  270. { ValveType.PVA2, _PVA2Valve },
  271. { ValveType.PVB1, _PVB1Valve },
  272. { ValveType.PVB2, _PVB2Valve },
  273. { ValveType.PVC1, _PVC1Valve },
  274. { ValveType.PVC2, _PVC2Valve },
  275. { ValveType.N2, _N2Valve },
  276. { ValveType.Mfc1, _Mfc1Valve },
  277. { ValveType.Mfc2, _Mfc2Valve },
  278. { ValveType.Mfc3, _Mfc3Valve },
  279. { ValveType.Mfc4, _Mfc4Valve },
  280. { ValveType.Mfc5, _Mfc5Valve },
  281. { ValveType.Mfc6, _Mfc6Valve },
  282. { ValveType.Mfc7, _Mfc7Valve },
  283. { ValveType.Mfc8, _Mfc8Valve },
  284. { ValveType.Mfc9, _Mfc9Valve },
  285. { ValveType.Mfc10, _Mfc10Valve },
  286. { ValveType.Mfc11, _Mfc11Valve },
  287. { ValveType.Mfc12, _Mfc12Valve },
  288. { ValveType.PVHe1, _PVHe1Valve },
  289. { ValveType.PVHe3, _PVHe3Valve },
  290. { ValveType.PVHe2, _PVHe2Valve },
  291. { ValveType.GasFinal, _GasFinalValve},
  292. { ValveType.SoftPump, _SoftPumpValve},
  293. { ValveType.FastPump, _FastPumpValve},
  294. { ValveType.TurboPumpPumping, _TurboPumpPumpingValve},
  295. { ValveType.TurboPumpPurge, _TurboPumpPurgeValve},
  296. { ValveType.Guage, _GuageValve},
  297. { ValveType.HeISO, _HeISOValve},
  298. { ValveType.MainPurge,_MainPurgeValve}
  299. };
  300. }
  301. #endregion
  302. #region 暴露变量
  303. public override bool IsLidClosed => _Lid.OFFFeedback;
  304. public override bool IsSlitDoorClosed => !_slitDoor.ONFeedback && _slitDoor.OFFFeedback;
  305. public override bool IsPumpRunning => _MainPump.IsRunning;
  306. public override bool IsTurboPumpRunning => _TurboPump.IsRunning;
  307. public override bool IsTurboPumpAtSpeed => _TurboPump.AtSpeed;
  308. public override float TurboPumpSpeed => _TurboPump.Speed;
  309. public override bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  310. public override bool HasTurboPumpError => _TurboPump.IsError || !_TurboPump.IsRunning;
  311. public override bool IsCDA_OK => _CDAPressure.Value;
  312. public override bool IsFastPumpOpened => _FastPumpValve.Status;
  313. public override bool IsSoftPumpOpened => _SoftPumpValve.Status;
  314. public override bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  315. public override bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  316. public override bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  317. public override bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  318. public override bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  319. public override bool IsMfc6ValveOpened => _Mfc6Valve.Status;
  320. public override bool IsMfc7ValveOpened => _Mfc7Valve.Status;
  321. public override bool IsMfc8ValveOpened => _Mfc8Valve.Status;
  322. public override bool IsMfc9ValveOpened => _Mfc9Valve.Status;
  323. public override bool IsMfc10ValveOpened => _Mfc10Valve.Status;
  324. public override bool IsMfc11ValveOpened => _Mfc11Valve.Status;
  325. public override bool IsMfc12ValveOpened => _Mfc12Valve.Status;
  326. public override bool IsGuageValveOpened => _GuageValve.Status;
  327. public override bool IsATM => _ATM_sw.Value;
  328. public override bool PVN22ValveIsOpen => _PVN22Valve.Status;
  329. public override bool LiftPinIsDown => _LiftPin.OFFFeedback;
  330. public override bool LiftPinIsUp => _LiftPin.ONFeedback;
  331. public override bool IsVAC => _VAC_sw.Value;
  332. public override bool IsWaterFlowOk => _Water_Flow.Value;
  333. public override bool IsWLK => _WLK_sw.Value;
  334. public override bool IsRFGInterlockOn => _RFG_Interlock.Value;
  335. public override bool PMLidClosed => _PM_Lid_Closed.Value;
  336. public override bool TurboPumpInterlock => _TurboPumpInterlock.Value;
  337. public override bool SourceRFFanInterlock => _Source_RF_Fan.Value;
  338. public override bool SlitDoorClosed => !_slitDoor.ONFeedback && _slitDoor.OFFFeedback;
  339. public override double ProcessLowPressure => _pressureController.ProcessLow.Value;
  340. public override double ProcessHighPressure => _pressureController.ProcessHigh.Value;
  341. public override double ProcessPressure => _pressureController.ProcessGauge.Value;
  342. public override double ChamberPressure => _pressureController.PressureGauge.Value;
  343. public override double ForelinePressure => _pressureController.ForelineGauge.Value;
  344. public override double TargetPressure => _pressureController.TargetPressure;
  345. public override double ESCHePressure => _pressureController.ESCHeGauge.Value;
  346. public override int ESCOutputVoltage => _ESCHV.OutputVoltage;
  347. public override double ESCPositiveOutputCurrent => _ESCHV.PositiveOutputCurrent;
  348. public override double ESCNegativeOutputCurrent => _ESCHV.NegativeOutputCurrent;
  349. public override bool IsHVOn => _ESCHV.IsOn;
  350. public override float CoolantInletTempFB => _Chiller.CoolantInletTcFeedback;
  351. public override float CoolantOutletTempFB => _Chiller.CoolantOutletTcFeedback;
  352. public override bool ChillerIsRunning => _Chiller.IsRunning;
  353. public override float ReflectPower => _Generator.ReflectPower;
  354. public override float BiasReflectPower => _GeneratorBias.ReflectPower;
  355. public override bool BackSideHeOutOfRange => _backsideHe.OutOfRange;
  356. public override MovementPosition LiftPinPosition
  357. {
  358. get
  359. {
  360. MovementPosition pos = MovementPosition.Unknown;
  361. if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
  362. {
  363. pos = MovementPosition.Up;
  364. }
  365. else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
  366. {
  367. pos = MovementPosition.Down;
  368. }
  369. return pos;
  370. }
  371. }
  372. public override double TotalGasSetpoint
  373. {
  374. get
  375. {
  376. double sum = 0;
  377. foreach (var gas in _gasLines)
  378. {
  379. sum += gas.FlowSP;
  380. }
  381. return sum;
  382. }
  383. }
  384. public override bool HasGasOutOfRange
  385. {
  386. get
  387. {
  388. foreach (var gas in _gasLines)
  389. {
  390. if (!gas.IsOutOfRange)
  391. return false;
  392. }
  393. return true;
  394. }
  395. }
  396. #endregion
  397. #region 公共方法
  398. public override bool CheckAtm()
  399. {
  400. //检查是否是ATM模式
  401. return _ATM_sw.Value && ChamberPressure > 700000;
  402. }
  403. public override bool CheckChillerStatus()
  404. {
  405. return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
  406. }
  407. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  408. {
  409. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  410. if (!PMLidClosed)
  411. {
  412. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  413. return false;
  414. }
  415. if (!IsVAC)
  416. {
  417. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  418. return false;
  419. }
  420. if (!IsWaterFlowOk)
  421. {
  422. LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  423. return false;
  424. }
  425. if (!IsRFGInterlockOn)
  426. {
  427. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  428. return false;
  429. }
  430. if (!SourceRFFanInterlock)
  431. {
  432. LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  433. return false;
  434. }
  435. if (!SlitDoorClosed)
  436. {
  437. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  438. return false;
  439. }
  440. if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
  441. {
  442. LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
  443. return false;
  444. }
  445. return true;
  446. }
  447. public override void CheckIdleInterlock()
  448. {
  449. if (ForelinePressure > _foreline_interlock_pressure)
  450. {
  451. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  452. {
  453. _pendulumValve.TurnValve(false);
  454. _TurboPumpPurgeValve.TurnValve(false, out _);
  455. _TurboPumpPumpingValve.TurnValve(false, out _);
  456. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  457. }
  458. }
  459. }
  460. public override bool CheckLiftDown()
  461. {
  462. return _LiftPin.State == CylinderState.Close;
  463. }
  464. public override bool CheckLiftUp()
  465. {
  466. return _LiftPin.State == CylinderState.Open;
  467. }
  468. public override bool CheckSlitDoorClose()
  469. => IsSlitDoorClosed;
  470. public override bool CheckSlitDoorOpen()
  471. => !IsSlitDoorClosed;
  472. public override void CloseValves()
  473. {
  474. _PVN21Valve.TurnValve(false, out _);
  475. //_PVN22Valve.TurnValve(false, out _);
  476. _PV11Valve.TurnValve(false, out _);
  477. _PV12Valve.TurnValve(false, out _);
  478. _PV21Valve.TurnValve(false, out _);
  479. _PV22Valve.TurnValve(false, out _);
  480. _PV31Valve.TurnValve(false, out _);
  481. _PV32Valve.TurnValve(false, out _);
  482. _PV41Valve.TurnValve(false, out _);
  483. _PV42Valve.TurnValve(false, out _);
  484. _PVHe1Valve.TurnValve(false, out _);
  485. _PVHe2Valve.TurnValve(false, out _);
  486. _GasFinalValve.TurnValve(false, out _);
  487. _SoftPumpValve.TurnValve(false, out _);
  488. _FastPumpValve.TurnValve(false, out _);
  489. _TurboPumpPumpingValve.TurnValve(false, out _);
  490. _TurboPumpPurgeValve.TurnValve(false, out _);
  491. _GuageValve.TurnValve(false, out _);
  492. _N2Valve.TurnValve(false, out _);
  493. _FastPumpValve.TurnValve(false, out _);
  494. _PVHe3Valve.TurnValve(false, out _);
  495. _HeISOValve.TurnValve(false, out _);
  496. //新增
  497. _Mfc1Valve.TurnValve(false, out _);
  498. _Mfc2Valve.TurnValve(false, out _);
  499. _Mfc3Valve.TurnValve(false, out _);
  500. _Mfc4Valve.TurnValve(false, out _);
  501. _Mfc5Valve.TurnValve(false, out _);
  502. _Mfc6Valve.TurnValve(false, out _);
  503. _Mfc7Valve.TurnValve(false, out _);
  504. _Mfc8Valve.TurnValve(false, out _);
  505. _Mfc9Valve.TurnValve(false, out _);
  506. _Mfc10Valve.TurnValve(false, out _);
  507. _Mfc11Valve.TurnValve(false, out _);
  508. _Mfc12Valve.TurnValve(false, out _);
  509. _PV51Valve.TurnValve(false, out _);
  510. _PV52Valve.TurnValve(false, out _);
  511. _PV61Valve.TurnValve(false, out _);
  512. _PV62Valve.TurnValve(false, out _);
  513. _PV71Valve.TurnValve(false, out _);
  514. _PV72Valve.TurnValve(false, out _);
  515. _PV81Valve.TurnValve(false, out _);
  516. _PV82Valve.TurnValve(false, out _);
  517. _PV91Valve.TurnValve(false, out _);
  518. _PV92Valve.TurnValve(false, out _);
  519. _PVA1Valve.TurnValve(false, out _);
  520. _PVA2Valve.TurnValve(false, out _);
  521. _PVB1Valve.TurnValve(false, out _);
  522. _PVB2Valve.TurnValve(false, out _);
  523. _PVC1Valve.TurnValve(false, out _);
  524. _PVC2Valve.TurnValve(false, out _);
  525. foreach (var stick in _gasLines)
  526. {
  527. stick.Stop();
  528. }
  529. }
  530. public override bool FlowGas(int gasNum, double val)
  531. {
  532. if (_gasLines.Length <= gasNum)
  533. return false;
  534. _gasLines[gasNum].Flow(val);
  535. return true;
  536. }
  537. public override bool FlowN2(double val)
  538. {
  539. _gasLineN2.Flow(val);
  540. return true;
  541. }
  542. public override bool GeneratorBiasPowerOn(bool on)
  543. {
  544. if (_GeneratorBias == null) return false;
  545. if (on && !IsRFGInterlockOn)
  546. {
  547. LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
  548. return false;
  549. }
  550. return _GeneratorBias.SetPowerOnOff(on, out _);
  551. }
  552. public override bool GeneratorBiasSetMatchMode(bool val)
  553. {
  554. if (_GeneratorBias == null) return false;
  555. string reason = string.Empty;
  556. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  557. return true;
  558. }
  559. public override bool GeneratorBiasSetpower(float val)
  560. {
  561. if (_GeneratorBias == null) return false;
  562. if (Math.Abs(val) > 0.01)
  563. _GeneratorBias.SetPower((ushort)val);
  564. return true;
  565. }
  566. public override bool GeneratorPowerOn(bool on)
  567. {
  568. if (_Generator == null) return false;
  569. if (on && !IsRFGInterlockOn)
  570. {
  571. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  572. return false;
  573. }
  574. return _Generator.SetPowerOnOff(on, out _);
  575. }
  576. public override bool GeneratorSetpower(float val)
  577. {
  578. if (_Generator == null) return false;
  579. if (Math.Abs(val) > 0.01)
  580. _Generator.SetPower((ushort)val);
  581. return true;
  582. }
  583. public override int GetPVPosition()
  584. {
  585. return _pendulumValve.Position;
  586. }
  587. public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  588. {
  589. _Chiller?.SetChillerTemp((float)value, (float)offset);
  590. await Task.Delay(1000);
  591. _Chiller?.SetChillerOnOff(true);
  592. }
  593. public override void Home()
  594. {
  595. SetLiftPin(MovementPosition.Down, out _);
  596. //转交TM
  597. //if (!_PM_SlitDoor_Closed.Value)
  598. //{
  599. // SetSlitDoor(true, out _);
  600. //}
  601. //else
  602. //{
  603. // SetSlitDoor(false, out _);
  604. //}
  605. //
  606. //SetSlitDoor(false, out _);
  607. OpenValve(ValveType.PVN22, true);
  608. }
  609. public override void OnOffChiller(ChillerType chillerType, bool onoff)
  610. => _Chiller?.SetChillerOnOff(onoff);
  611. public override bool OnOffSetESCHV(bool on)
  612. => _ESCHV.SetPowerOnOff(on);
  613. public override void OpenValve(ValveType vlvType, bool on)
  614. {
  615. if (Valve2IO.ContainsKey(vlvType))
  616. {
  617. Valve2IO[vlvType].TurnValve(on, out _);
  618. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
  619. }
  620. else
  621. {
  622. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  623. }
  624. }
  625. public override bool PendulumValveIsOpen()
  626. {
  627. return _pendulumValve.IsOpen;
  628. }
  629. public override void SetBacksideHeFlow(double flow)
  630. {
  631. if (_backsideHe == null) return;
  632. _backsideHe.Flow(flow);
  633. }
  634. public override bool SetBacksideHePressure(float mTorr)
  635. {
  636. if (_backsideHe == null) return false;
  637. return _backsideHe.SetBacksideHelium(mTorr);
  638. }
  639. public override bool SetBacksideHeThreshold(int nMin, int nMax)
  640. {
  641. if (_backsideHe == null) return false;
  642. return _backsideHe.SetFlowThreshold(nMin, nMax);
  643. }
  644. public override bool SetBiasMatchPosition(float c1, float c2)
  645. {
  646. if (_BiasMatch == null) return false;
  647. string reason = string.Empty;
  648. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  649. return true;
  650. }
  651. public override bool SetBiasPulseMode(bool on)
  652. {
  653. if (_GeneratorBias == null) return false;
  654. _GeneratorBias.SetPulseMode(on);
  655. return true;
  656. }
  657. public override bool SetBiasPulseRateFreq(int nFreq)
  658. {
  659. if (_GeneratorBias == null) return false;
  660. _GeneratorBias.SetPulseRateFreq(nFreq);
  661. return true;
  662. }
  663. public override bool SetDiasPulseDutyCycle(int percentage)
  664. {
  665. if (_GeneratorBias == null) return false;
  666. _GeneratorBias.SetPulseDutyCycle(percentage);
  667. return true;
  668. }
  669. public override bool SetESCClampVoltage(int nVoltage)
  670. {
  671. if (_ESCHV == null) return false;
  672. return _ESCHV.SetOutputVoltage(nVoltage);
  673. }
  674. public override void SetGeneratorCommunicationMode(int mode)
  675. => _Generator?.SetCommunicationMode(mode);
  676. public override bool SetLiftPin(MovementPosition dirt, out string reason)
  677. {
  678. reason = string.Empty;
  679. switch (dirt)
  680. {
  681. case MovementPosition.Down:
  682. return _LiftPin.SetCylinder(false, out reason);
  683. case MovementPosition.Up:
  684. return _LiftPin.SetCylinder(true, out reason);
  685. case MovementPosition.Left:
  686. case MovementPosition.Right:
  687. case MovementPosition.Middle:
  688. throw new ArgumentException("Movement argument error");
  689. }
  690. return true;
  691. }
  692. public override bool SetMatchPosition(float c1, float c2)
  693. {
  694. if (_Match == null) return false;
  695. string reason = string.Empty;
  696. _Match.SetMatchPosition(c1, c2, out reason);
  697. return true;
  698. }
  699. public override bool SetPVPostion(int position)
  700. => _pendulumValve.SetPosition(position);
  701. public override bool SetPVPressure(int pressure)
  702. => _pendulumValve.SetPressure(pressure);
  703. public override bool SetWallTCTemperature(float value)
  704. => _WallTC.RampTemp(value);
  705. public override void StopAllGases()
  706. {
  707. foreach (var line in _gasLines)
  708. {
  709. line.Stop();
  710. }
  711. }
  712. public override bool StopGas(int gasNum)
  713. {
  714. if (_gasLines.Length <= gasNum)
  715. return false;
  716. _gasLines[gasNum].Stop();
  717. return true;
  718. }
  719. public override bool StopN2()
  720. {
  721. _gasLineN2.Stop();
  722. return true;
  723. }
  724. public override void TurnDryPump(bool on)
  725. => _MainPump?.SetPumpOnOff(on);
  726. public override bool TurnPendulumValve(bool on)
  727. => _pendulumValve.TurnValve(on);
  728. public override void TurnTurboPump(bool on)
  729. {
  730. _TurboPump?.SetPumpOnOff(on);
  731. }
  732. #endregion
  733. protected override void CheckPermanentInterlock()
  734. {
  735. if (ProcessPressure > 100 && _GuageValve.SetPoint)
  736. {
  737. _GuageValve.TurnValve(false, out _);
  738. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ProcessPressure} exceed 100 mtorr, Guage Valve (DO-31) closed automaticlly.");
  739. }
  740. }
  741. }
  742. }