JetVenusSEPM.cs 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400
  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.OperationCenter;
  6. using Aitex.Core.RT.SCCore;
  7. using Aitex.Core.UI.Control;
  8. using Aitex.Core.Util;
  9. using Aitex.Core.RT.Fsm;
  10. using MECF.Framework.Common.Device.Bases;
  11. using MECF.Framework.Common.Equipment;
  12. using MECF.Framework.Common.SubstrateTrackings;
  13. using System;
  14. using System.Collections.Generic;
  15. using System.Diagnostics;
  16. using System.Linq;
  17. using System.Text;
  18. using System.Threading.Tasks;
  19. using Venus_Core;
  20. using Venus_RT.Devices.IODevices;
  21. using Venus_RT.Modules;
  22. using IoMfc = Venus_RT.Devices.IODevices.IoMfc;
  23. using Aitex.Core.RT.DataCenter;
  24. namespace Venus_RT.Devices
  25. {
  26. class JetVenusSEPM : JetPMBase
  27. {
  28. #region io变量定义
  29. private readonly IoLid _Lid;
  30. //private readonly IoCylinder _slitDoor;
  31. private readonly IoCylinder _LiftPin;
  32. private readonly IoValve _PVN21Valve;
  33. private readonly IoValve _PVN22Valve;
  34. private readonly IoValve _PV11Valve;
  35. private readonly IoValve _PV12Valve;
  36. private readonly IoValve _PV21Valve;
  37. private readonly IoValve _PV22Valve;
  38. private readonly IoValve _PV31Valve;
  39. private readonly IoValve _PV32Valve;
  40. private readonly IoValve _PV41Valve;
  41. private readonly IoValve _PV42Valve;
  42. private readonly IoValve _PV51Valve;//新增
  43. private readonly IoValve _PV52Valve;//新增
  44. private readonly IoValve _PV61Valve;//新增
  45. private readonly IoValve _PV62Valve;//新增
  46. private readonly IoValve _PV71Valve;//新增
  47. private readonly IoValve _PV72Valve;//新增
  48. private readonly IoValve _PV81Valve;//新增
  49. private readonly IoValve _PV82Valve;//新增
  50. private readonly IoValve _PV91Valve;//新增
  51. private readonly IoValve _PV92Valve;//新增
  52. private readonly IoValve _PVA1Valve;//新增
  53. private readonly IoValve _PVA2Valve;//新增
  54. private readonly IoValve _PVB1Valve;//新增
  55. private readonly IoValve _PVB2Valve;//新增
  56. private readonly IoValve _PVC1Valve;//新增
  57. private readonly IoValve _PVC2Valve;//新增
  58. private readonly IoValve _PV14Valve;//新增
  59. private readonly IoValve _N2Valve;
  60. private readonly IoValve _Mfc1Valve;
  61. private readonly IoValve _Mfc2Valve;
  62. private readonly IoValve _Mfc3Valve;
  63. private readonly IoValve _Mfc4Valve;
  64. private readonly IoValve _Mfc5Valve;
  65. private readonly IoValve _Mfc6Valve;
  66. private readonly IoValve _Mfc7Valve;
  67. private readonly IoValve _Mfc8Valve;
  68. private readonly IoValve _Mfc9Valve; //新增
  69. private readonly IoValve _Mfc10Valve;//新增
  70. private readonly IoValve _Mfc11Valve;//新增 空的
  71. private readonly IoValve _Mfc12Valve;//新增
  72. private readonly IoValve _PVHe1Valve;
  73. private readonly IoValve _PVHe2Valve;
  74. private readonly IoValve _GasFinalValve;
  75. private readonly IoValve _SoftPumpValve;
  76. private readonly IoValve _FastPumpValve;
  77. private readonly IoValve _TurboPumpPumpingValve;
  78. private readonly IoValve _TurboPumpPurgeValve;
  79. private readonly IoValve _GuageValve;
  80. private readonly IoValve _PVHe3Valve;
  81. private readonly IoValve _HeISOValve;
  82. private readonly IoValve _MainPurgeValve;//新增
  83. private readonly IoValve _SecondPurgeValve;//新增
  84. private readonly IoSensor _ATM_sw;
  85. private readonly IoSensor _CDAPressure;
  86. private readonly IoSensor _N2Pressure_sw;
  87. private readonly IoSensor _VAC_sw;
  88. private readonly IoSensor _WLK_sw;
  89. private readonly IoSensor _Water_Flow;
  90. private readonly IoSensor _RFG_Interlock;
  91. //private readonly IoSensor _PM_Lid_Closed;
  92. private readonly IoSensor _Source_RF_Fan;
  93. private readonly IoSensor _TurboPumpInterlock;
  94. private readonly IoSensor _GasBoxDoor;
  95. private readonly IoSensor _GasBoxPressure;
  96. private readonly PumpBase _MainPump;
  97. private readonly ESC5HighVoltage _ESCHV;
  98. private readonly AdixenTurboPump _TurboPump;
  99. private readonly PendulumValve _pendulumValve;
  100. private readonly ChillerBase _Chiller;
  101. private readonly RfPowerBase _Generator;//srf=>AdTecGenerator
  102. private readonly RfPowerBase _GeneratorBias;//brf=>CometRF
  103. private readonly RfMatchBase _Match;
  104. private readonly RfMatchBase _BiasMatch;
  105. private readonly IoHeater _ForelineTC;
  106. private readonly IoHeater _WallTC;
  107. private readonly IoPressureControl _pressureController;
  108. private readonly IoGasStick[] _gasLines;
  109. private readonly IoGasStick _gasLineN2;
  110. private readonly IoBacksideHe _backsideHe;
  111. //private readonly IoMfc _heMfc;
  112. private readonly double _foreline_interlock_pressure = 750;
  113. private readonly Dictionary<ValveType, IoValve> Valve2IO;
  114. public override double MFC1FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas1").FeedBack;
  115. public override double MFC2FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas2").FeedBack;
  116. public override double MFC3FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas3").FeedBack;
  117. public override double MFC4FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas4").FeedBack;
  118. public override double MFC5FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas5").FeedBack;
  119. public override double MFC6FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas6").FeedBack;
  120. public override double MFC7FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas7").FeedBack;
  121. public override double MFC8FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas8").FeedBack;
  122. public override double MFC9FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas9").FeedBack;
  123. public override double MFC10FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas10").FeedBack;
  124. public override double MFC11FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas11").FeedBack;
  125. public override double MFC12FeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcGas12").FeedBack;
  126. public override double HeliumFeedBack => DEVICE.GetDevice<IoMfc>($"{Module}.MfcHe").FeedBack;
  127. public override float ReflectPower => _Generator.ReflectPower;
  128. public override float BiasReflectPower => _GeneratorBias.ReflectPower;
  129. public override float ForwardPower => _Generator.ForwardPower;
  130. public override float BiasForwardPower => _GeneratorBias.ForwardPower;
  131. public override float PendulumPressure => _pendulumValve.Pressure;
  132. public override float PendulumPosition => _pendulumValve.Position;
  133. //public override float WallTemperature => _WallTC.ControlTcFeedback;
  134. //public override float ESCTemperature => _Chiller.CoolantOutletTcFeedback;
  135. #endregion
  136. #region 构造函数
  137. public JetVenusSEPM(ModuleName moduleName) : base(moduleName)
  138. {
  139. DATA.Subscribe($"{Name}.ESCHV.Temp", () => CoolantOutletTempFB);
  140. DATA.Subscribe($"{Name}.ESCHePressure", () => ESCHePressure);
  141. Module = moduleName;
  142. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
  143. _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
  144. _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
  145. _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
  146. _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
  147. _PV12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV12}");
  148. _PV21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV21}");
  149. _PV22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV22}");
  150. _PV31Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV31}");
  151. _PV32Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV32}");
  152. _PV41Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV41}");
  153. _PV42Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV42}");
  154. _PV51Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV51}");
  155. _PV52Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV52}");
  156. _PV61Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV61}");
  157. _PV62Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV62}");
  158. _PV71Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV71}");
  159. _PV72Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV72}");
  160. _PV81Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV81}");
  161. _PV82Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV82}");
  162. _PV91Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV91}");
  163. _PV92Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV92}");
  164. _PVA1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVA1}");
  165. _PVA2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVA2}");
  166. _PVB1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVB1}");
  167. _PVB2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVB2}");
  168. _PVC1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVC1}");
  169. _PVC2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVC2}");
  170. _PV14Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV14}");
  171. _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
  172. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
  173. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
  174. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc3}");
  175. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc4}");
  176. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc5}");
  177. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc6}");
  178. _Mfc7Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc7}");
  179. _Mfc8Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc8}");
  180. _Mfc9Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc9}");
  181. _Mfc10Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc10}");
  182. _Mfc11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc11}");
  183. _Mfc12Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc12}");
  184. _PVHe1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe1}");
  185. _PVHe2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe2}");
  186. _GasFinalValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGasFinal}");
  187. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSoftPump}");
  188. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveFastPump}");
  189. _TurboPumpPumpingValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPumping}");
  190. _TurboPumpPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveTurboPumpPurge}");
  191. _GuageValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveGuage}");
  192. _PVHe3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVHe3}");
  193. _HeISOValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveHeISO}");
  194. _MainPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMainPurge}");
  195. _SecondPurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveSecondPurge}");
  196. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  197. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  198. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  199. _Water_Flow = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterFlowOk");
  200. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  201. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  202. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  203. //_PM_Lid_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorPMLidClosed");
  204. _Source_RF_Fan = DEVICE.GetDevice<IoSensor>($"{Module}.SensorSourceRFFan");
  205. _TurboPumpInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.TurboPumpInterlock");
  206. _GasBoxDoor = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxDoorSW");
  207. _GasBoxPressure = DEVICE.GetDevice<IoSensor>($"{Module}.GasBoxPressureSW");
  208. _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  209. _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
  210. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  211. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");
  212. _gasLines = new IoGasStick[12];
  213. for (int index = 0; index < 12; index++)
  214. {
  215. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  216. }
  217. _gasLineN2 = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStickN2");
  218. _backsideHe = DEVICE.GetDevice<IoBacksideHe>($"{Module}.BacksideHelium");
  219. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VenusDevice.MainPump}");
  220. // RS232 Dry pump, SKY
  221. if (SC.GetValue<int>($"{Module}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  222. {
  223. if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  224. {
  225. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VenusDevice.MainPump}");
  226. }
  227. else if (SC.GetValue<int>($"{Module}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  228. {
  229. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VenusDevice.MainPump}");
  230. }
  231. }
  232. _ESCHV = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
  233. _TurboPump = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
  234. _pendulumValve = DEVICE.GetDevice<PendulumValve>($"{Module}.{VenusDevice.PendulumValve}");
  235. if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
  236. SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS232)
  237. {
  238. if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
  239. {
  240. _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
  241. }
  242. else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
  243. {
  244. _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
  245. }
  246. }
  247. if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller") &&
  248. SC.GetValue<int>($"{Module}.Chiller.CommunicationType") == (int)CommunicationType.RS485 &&
  249. SC.GetValue<bool>($"{Module}.Chiller.ShareCOM"))
  250. {
  251. if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.SMC)
  252. {
  253. _Chiller = DEVICE.GetDevice<SMCShareChiller>($"{Module}.{VenusDevice.Chiller}");
  254. }
  255. else if (SC.GetValue<int>($"{Module}.Chiller.MFG") == (int)ChillerMFG.AIRSYS)
  256. {
  257. _Chiller = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VenusDevice.Chiller}");
  258. }
  259. }
  260. // RS232 AdTec Generator
  261. if (SC.GetValue<int>($"{Module}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  262. SC.GetValue<int>($"{Module}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  263. {
  264. _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.Rf}");
  265. }
  266. // Ethernet Comet Generator Bias
  267. if (SC.GetValue<bool>($"{Module}.BiasRf.EnableBiasRF"))
  268. {
  269. if (SC.GetValue<int>($"{Module}.BiasRf.CommunicationType") == (int)CommunicationType.Ethernet &&
  270. SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.Comet)
  271. {
  272. _GeneratorBias = DEVICE.GetDevice<CometRF>($"{Module}.{VenusDevice.BiasRf}");
  273. }
  274. else if (SC.GetValue<int>($"{Module}.BiasRf.MFG") == (int)GeneratorMFG.AdTec)
  275. {
  276. _GeneratorBias = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VenusDevice.BiasRf}");
  277. }
  278. }
  279. // RS232 AdTec match
  280. if (SC.GetValue<int>($"{Module}.Match.CommunicationType") == (int)CommunicationType.RS232 &&
  281. SC.GetValue<int>($"{Module}.Match.MFG") == (int)MatchMFG.AdTec)
  282. {
  283. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.Match}");
  284. }
  285. // Bias Match
  286. if (SC.GetValue<bool>($"{Module}.BiasMatch.EnableBiasMatch") &&
  287. SC.GetValue<int>($"{Module}.BiasMatch.CommunicationType") == (int)CommunicationType.RS232 &&
  288. SC.GetValue<int>($"{Module}.BiasMatch.MFG") == (int)MatchMFG.AdTec)
  289. {
  290. _BiasMatch = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VenusDevice.BiasMatch}");
  291. }
  292. _foreline_interlock_pressure = SC.GetValue<double>($"{Module}.ForelineInterlockPressure");
  293. Valve2IO = new Dictionary<ValveType, IoValve>()
  294. {
  295. { ValveType.PVN21, _PVN21Valve },
  296. { ValveType.PVN22, _PVN22Valve },
  297. { ValveType.PV11, _PV11Valve },
  298. { ValveType.PV12, _PV12Valve },
  299. { ValveType.PV21, _PV21Valve },
  300. { ValveType.PV22, _PV22Valve },
  301. { ValveType.PV31, _PV31Valve },
  302. { ValveType.PV32, _PV32Valve },
  303. { ValveType.PV41, _PV41Valve },
  304. { ValveType.PV42, _PV42Valve },
  305. { ValveType.PV51, _PV51Valve },
  306. { ValveType.PV52, _PV52Valve },
  307. { ValveType.PV61, _PV61Valve },
  308. { ValveType.PV62, _PV62Valve },
  309. { ValveType.PV71, _PV71Valve },
  310. { ValveType.PV72, _PV72Valve },
  311. { ValveType.PV81, _PV81Valve },
  312. { ValveType.PV82, _PV82Valve },
  313. { ValveType.PV91, _PV91Valve },
  314. { ValveType.PV92, _PV92Valve },
  315. { ValveType.PVA1, _PVA1Valve },
  316. { ValveType.PVA2, _PVA2Valve },
  317. { ValveType.PVB1, _PVB1Valve },
  318. { ValveType.PVB2, _PVB2Valve },
  319. { ValveType.PVC1, _PVC1Valve },
  320. { ValveType.PVC2, _PVC2Valve },
  321. { ValveType.N2, _N2Valve },
  322. { ValveType.Mfc1, _Mfc1Valve },
  323. { ValveType.Mfc2, _Mfc2Valve },
  324. { ValveType.Mfc3, _Mfc3Valve },
  325. { ValveType.Mfc4, _Mfc4Valve },
  326. { ValveType.Mfc5, _Mfc5Valve },
  327. { ValveType.Mfc6, _Mfc6Valve },
  328. { ValveType.Mfc7, _Mfc7Valve },
  329. { ValveType.Mfc8, _Mfc8Valve },
  330. { ValveType.Mfc9, _Mfc9Valve },
  331. { ValveType.Mfc10, _Mfc10Valve },
  332. { ValveType.Mfc11, _Mfc11Valve },
  333. { ValveType.Mfc12, _Mfc12Valve },
  334. { ValveType.PVHe1, _PVHe1Valve },
  335. { ValveType.PVHe3, _PVHe3Valve },
  336. { ValveType.PVHe2, _PVHe2Valve },
  337. { ValveType.GasFinal, _GasFinalValve},
  338. { ValveType.SoftPump, _SoftPumpValve},
  339. { ValveType.FastPump, _FastPumpValve},
  340. { ValveType.TurboPumpPumping, _TurboPumpPumpingValve},
  341. { ValveType.TurboPumpPurge, _TurboPumpPurgeValve},
  342. { ValveType.Guage, _GuageValve},
  343. { ValveType.HeISO, _HeISOValve},
  344. { ValveType.MainPurge, _MainPurgeValve},
  345. { ValveType.SecondPurge, _SecondPurgeValve},
  346. { ValveType.PV14, _PV14Valve},
  347. };
  348. SensorWithAlarm();
  349. //_ESCHV.SetDownRampTime(5);
  350. DATA.Subscribe($"{Name}.ESCHePressure", () => ESCHePressure);
  351. DATA.Subscribe($"{Name}.ESCHV.Temp", () => CoolantOutletTempFB);
  352. DATA.Subscribe($"{Name}.Chiller.Temp", () => CoolantInletTempFB);
  353. }
  354. #endregion
  355. #region 暴露变量
  356. public override bool IsLidClosed => _Lid.OFFFeedback;
  357. public override bool IsSlitDoorClosed
  358. {
  359. get
  360. {
  361. if (Singleton<RouteManager>.Instance.seTM != null)
  362. {
  363. switch (Module)
  364. {
  365. case ModuleName.PMA:
  366. return Singleton<RouteManager>.Instance.seTM.IsPMASlitDoorClosed;
  367. case ModuleName.PMB:
  368. return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorClosed;
  369. case ModuleName.PMC:
  370. return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorClosed;
  371. case ModuleName.PMD:
  372. return Singleton<RouteManager>.Instance.seTM.IsPMDSlitDoorClosed;
  373. default:
  374. return false;
  375. }
  376. }
  377. else
  378. return false;
  379. }
  380. }
  381. public bool IsSlitDoorOpen
  382. {
  383. get
  384. {
  385. if (Singleton<RouteManager>.Instance.seTM != null)
  386. {
  387. switch (Module)
  388. {
  389. case ModuleName.PMA:
  390. return Singleton<RouteManager>.Instance.seTM.IsPMASlitDoorOpen;
  391. case ModuleName.PMB:
  392. return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorOpen;
  393. case ModuleName.PMC:
  394. return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorOpen;
  395. case ModuleName.PMD:
  396. return Singleton<RouteManager>.Instance.seTM.IsPMDSlitDoorOpen;
  397. default:
  398. return false;
  399. }
  400. }
  401. else
  402. return false;
  403. }
  404. }
  405. public override bool IsPumpRunning => _MainPump.IsRunning;
  406. public override bool IsISOOpen => _TurboPumpPumpingValve.Status;
  407. public override bool IsTurboPumpRunning => _TurboPump.IsRunning;
  408. public override bool IsPenVOpen => _pendulumValve.IsOpen;
  409. public override bool IsTurboPumpAtSpeed => _TurboPump.AtSpeed;
  410. public override float TurboPumpSpeed => _TurboPump.Speed;
  411. public override bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  412. public override bool HasTurboPumpError => _TurboPump.IsError || !_TurboPump.IsRunning;
  413. public override bool IsCDA_OK => _CDAPressure.Value;
  414. public override bool IsFastPumpOpened => _FastPumpValve.Status;
  415. public override bool IsSoftPumpOpened => _SoftPumpValve.Status;
  416. public override bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  417. public override bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  418. public override bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  419. public override bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  420. public override bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  421. public override bool IsMfc6ValveOpened => _Mfc6Valve.Status;
  422. public override bool IsMfc7ValveOpened => _Mfc7Valve.Status;
  423. public override bool IsMfc8ValveOpened => _Mfc8Valve.Status;
  424. public bool IsMfc9ValveOpened => _Mfc9Valve.Status;
  425. public bool IsMfc10ValveOpened => _Mfc10Valve.Status;
  426. public bool IsMfc11ValveOpened => _Mfc11Valve.Status;
  427. public bool IsMfc12ValveOpened => _Mfc12Valve.Status;
  428. public override bool IsGuageValveOpened => _GuageValve.Status;
  429. public override bool IsATM => _ATM_sw.Value;
  430. public override bool PVN22ValveIsOpen => _PVN22Valve.Status;
  431. public override bool LiftPinIsDown => _LiftPin.OFFFeedback;
  432. public override bool LiftPinIsUp => _LiftPin.ONFeedback;
  433. public override bool IsVAC => _VAC_sw.Value;
  434. //public override bool IsWaterFlowOk => _Water_Flow.Value;
  435. public override bool IsWaterFlowOk => false;
  436. public override bool IsWLK => _WLK_sw.Value;
  437. public override bool IsRFGInterlockOn => _RFG_Interlock.Value;
  438. //public override bool PMLidClosed => _PM_Lid_Closed.Value;
  439. public override bool TurboPumpInterlock => _TurboPumpInterlock.Value;
  440. public override bool SourceRFFanInterlock => _Source_RF_Fan.Value;
  441. public override bool SlitDoorClosed
  442. {
  443. get
  444. {
  445. switch (Module)
  446. {
  447. case ModuleName.PMA:
  448. return Singleton<RouteManager>.Instance.seTM.IsPMASlitDoorClosed;
  449. case ModuleName.PMB:
  450. return Singleton<RouteManager>.Instance.seTM.IsPMBSlitDoorClosed;
  451. case ModuleName.PMC:
  452. return Singleton<RouteManager>.Instance.seTM.IsPMCSlitDoorClosed;
  453. case ModuleName.PMD:
  454. return Singleton<RouteManager>.Instance.seTM.IsPMDSlitDoorClosed;
  455. default:
  456. return true;
  457. }
  458. }
  459. }
  460. //public override double ProcessLowPressure => _pressureController.ProcessLow.Value;
  461. //public override double ProcessHighPressure => _pressureController.ProcessHigh.Value;
  462. public override double ChamberPressure => _pressureController.PressureGauge.Value;
  463. public override double ProcessPressure => _pendulumValve.Pressure >= 95 ? 95 : _pendulumValve.Pressure;
  464. //public override double ChamberPressure => _pendulumValve.Pressure;
  465. public override double ForelinePressure => _pressureController.ForelineGauge.Value;
  466. public override double TargetPressure => _pressureController.TargetPressure;
  467. public override double ESCHePressure => _pressureController.ESCHeGauge.Value;
  468. public override int ESCOutputVoltage => _ESCHV.OutputVoltage;
  469. public override double ESCPositiveOutputCurrent => _ESCHV.PositiveOutputCurrent;
  470. public override double ESCNegativeOutputCurrent => _ESCHV.NegativeOutputCurrent;
  471. public override bool IsHVOn => _ESCHV.IsOn;
  472. public override float CoolantInletTempFB
  473. {
  474. get
  475. {
  476. switch (SC.GetValue<int>($"{Module}.Chiller.CommunicationType"))
  477. {
  478. case (int)CommunicationType.RS232:
  479. return _Chiller.CoolantInletTcFeedback;
  480. case (int)CommunicationType.RS485:
  481. return _Chiller.Temperature;
  482. default:
  483. return 0;
  484. }
  485. }
  486. }
  487. public override float CoolantOutletTempFB => _Chiller.CoolantOutletTcFeedback;
  488. public override bool ChillerIsRunning => _Chiller.IsRunning;
  489. public override bool BackSideHeOutOfRange => _backsideHe.OutOfRange;
  490. public override MovementPosition LiftPinPosition
  491. {
  492. get
  493. {
  494. MovementPosition pos = MovementPosition.Unknown;
  495. if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
  496. {
  497. pos = MovementPosition.Up;
  498. }
  499. else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
  500. {
  501. pos = MovementPosition.Down;
  502. }
  503. return pos;
  504. }
  505. }
  506. public override double TotalGasSetpoint
  507. {
  508. get
  509. {
  510. double sum = 0;
  511. foreach (var gas in _gasLines)
  512. {
  513. sum += gas.FlowSP;
  514. }
  515. return sum;
  516. }
  517. }
  518. public override bool HasGasOutOfRange
  519. {
  520. get
  521. {
  522. foreach (var gas in _gasLines)
  523. {
  524. if (!gas.IsOutOfRange)
  525. return false;
  526. }
  527. return true;
  528. }
  529. }
  530. public override bool IsLidLoadlockClosed
  531. {
  532. get
  533. {
  534. //LOG.Write(eEvent.ERR_PM,Module,"VenusSE PM is not exist Loadlock!");
  535. return false;
  536. }
  537. }
  538. //public override bool IsATMLoadlock
  539. //{
  540. // get
  541. // {
  542. // //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  543. // return false;
  544. // }
  545. //}
  546. //public override bool IsVACLoadLock
  547. //{
  548. // get
  549. // {
  550. // //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  551. // return false;
  552. // }
  553. //}
  554. public override bool IsLoadlockArmRetract
  555. {
  556. get
  557. {
  558. //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  559. return false;
  560. }
  561. }
  562. public override bool IsLoadlockArmExtend
  563. {
  564. get
  565. {
  566. //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  567. return false;
  568. }
  569. }
  570. public override bool LoadlockArmRetract
  571. {
  572. get
  573. {
  574. //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  575. return false;
  576. }
  577. }
  578. public override bool LoadlockArmExtend
  579. {
  580. get
  581. {
  582. //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  583. return false;
  584. }
  585. }
  586. public override float RFMatchC1 => _Match != null ? _Match.TunePosition1 : 0;
  587. public override float RFMatchC2 => _Match != null ? _Match.TunePosition1 : 0;
  588. public override float BiasRFMatchC1 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  589. public override float BiasRFMatchC2 => _BiasMatch != null ? _BiasMatch.TunePosition1 : 0;
  590. //public override double LoadlockPressure
  591. //{
  592. // get
  593. // {
  594. // //LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist Loadlock!");
  595. // return -100;
  596. // }
  597. //}
  598. public override void BuzzerBlinking(double time)
  599. {
  600. LOG.Write(eEvent.ERR_PM, Module, "VenusSE PM is not exist SignalTower!");
  601. }
  602. #endregion
  603. #region 公共方法
  604. //public override bool CheckAtm()
  605. //{
  606. // //检查是否是ATM模式
  607. // return _ATM_sw.Value && ChamberPressure > 700000;
  608. //}
  609. public override bool CheckChillerStatus()
  610. {
  611. return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
  612. }
  613. public override bool CheckGeneratorAndHVInterlock(VenusDevice device)
  614. {
  615. eEvent evt = device == VenusDevice.Rf ? eEvent.ERR_RF : eEvent.ERR_ESC_HV;
  616. if (!IsLidClosed)
  617. {
  618. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM Lid is Open.");
  619. return false;
  620. }
  621. if (!IsVAC)
  622. {
  623. LOG.Write(evt, Module, $"Cannot Power ON {device} as PM is not Vacuum.");
  624. return false;
  625. }
  626. //if (!IsWaterFlowOk)
  627. //{
  628. // LOG.Write(evt, Module, $"Cannot Power ON {device} as Water Flow is OFF.");
  629. // return false;
  630. //}
  631. if (!IsRFGInterlockOn)
  632. {
  633. LOG.Write(evt, Module, $"Cannot Power ON {device} as Generator Interlock is OFF.");
  634. return false;
  635. }
  636. //2024-02-05 15:15:56 TPS 朱永吉温海波确认已经去掉该interlock
  637. //if (!SourceRFFanInterlock)
  638. //{
  639. // LOG.Write(evt, Module, $"Cannot Power ON {device} as Source RF Fan is OFF.");
  640. // return false;
  641. //}
  642. if (!SlitDoorClosed)
  643. {
  644. LOG.Write(evt, Module, $"Cannot Power ON {device} as Slit Door is open.");
  645. return false;
  646. }
  647. if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
  648. {
  649. LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
  650. return false;
  651. }
  652. return true;
  653. }
  654. public override void CheckIdleInterlock()
  655. {
  656. if (ForelinePressure > _foreline_interlock_pressure)
  657. {
  658. if (_TurboPumpPumpingValve.SetPoint || _TurboPumpPurgeValve.SetPoint || _pendulumValve.IsOpen)
  659. {
  660. _pendulumValve.TurnValve(false);
  661. _TurboPumpPurgeValve.TurnValve(false, out _);
  662. _TurboPumpPumpingValve.TurnValve(false, out _);
  663. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Foreline pressure:{ForelinePressure} exceed {_foreline_interlock_pressure} mtorr, Pendulum valve & PV6 & PV7 closed automaticlly.");
  664. }
  665. }
  666. }
  667. public override bool CheckLiftDown()
  668. {
  669. return _LiftPin.State == CylinderState.Close;
  670. }
  671. public override bool CheckLiftUp()
  672. {
  673. return _LiftPin.State == CylinderState.Open;
  674. }
  675. public override bool CheckSlitDoorClose()
  676. => IsSlitDoorClosed;
  677. public override bool CheckSlitDoorOpen()
  678. => IsSlitDoorOpen;
  679. public override void CloseValves(int? delayTime = null)
  680. {
  681. _PVN21Valve.TurnValve(false, out _);
  682. //_PVN22Valve.TurnValve(false, out _);
  683. _PV11Valve.TurnValve(false, out _);
  684. _PV12Valve.TurnValve(false, out _);
  685. _PV21Valve.TurnValve(false, out _);
  686. _PV22Valve.TurnValve(false, out _);
  687. _PV31Valve.TurnValve(false, out _);
  688. _PV32Valve.TurnValve(false, out _);
  689. _PV41Valve.TurnValve(false, out _);
  690. _PV42Valve.TurnValve(false, out _);
  691. _PVHe1Valve.TurnValve(false, out _);
  692. _PVHe2Valve.TurnValve(false, out _);
  693. _GasFinalValve.TurnValve(false, out _);
  694. _SoftPumpValve.TurnValve(false, out _);
  695. _FastPumpValve.TurnValve(false, out _);
  696. //_TurboPumpPumpingValve.TurnValve(false, out _);
  697. //_TurboPumpPurgeValve.TurnValve(false, out _);
  698. _GuageValve.TurnValve(false, out _);
  699. _N2Valve.TurnValve(false, out _);
  700. _FastPumpValve.TurnValve(false, out _);
  701. _PVHe3Valve.TurnValve(false, out _);
  702. _HeISOValve.TurnValve(false, out _);
  703. _MainPurgeValve.TurnValve(false, out _);
  704. _SecondPurgeValve.TurnValve(false, out _);
  705. //新增
  706. _Mfc1Valve.TurnValve(false, out _);
  707. _Mfc2Valve.TurnValve(false, out _);
  708. _Mfc3Valve.TurnValve(false, out _);
  709. _Mfc4Valve.TurnValve(false, out _);
  710. _Mfc5Valve.TurnValve(false, out _);
  711. _Mfc6Valve.TurnValve(false, out _);
  712. _Mfc7Valve.TurnValve(false, out _);
  713. _Mfc8Valve.TurnValve(false, out _);
  714. _Mfc9Valve.TurnValve(false, out _);
  715. _Mfc10Valve.TurnValve(false, out _);
  716. _Mfc11Valve.TurnValve(false, out _);
  717. _Mfc12Valve.TurnValve(false, out _);
  718. _PV51Valve.TurnValve(false, out _);
  719. _PV52Valve.TurnValve(false, out _);
  720. _PV61Valve.TurnValve(false, out _);
  721. _PV62Valve.TurnValve(false, out _);
  722. _PV71Valve.TurnValve(false, out _);
  723. _PV72Valve.TurnValve(false, out _);
  724. _PV81Valve.TurnValve(false, out _);
  725. _PV82Valve.TurnValve(false, out _);
  726. _PV91Valve.TurnValve(false, out _);
  727. _PV92Valve.TurnValve(false, out _);
  728. _PVA1Valve.TurnValve(false, out _);
  729. _PVA2Valve.TurnValve(false, out _);
  730. _PVB1Valve.TurnValve(false, out _);
  731. _PVB2Valve.TurnValve(false, out _);
  732. _PVC1Valve.TurnValve(false, out _);
  733. _PVC2Valve.TurnValve(false, out _);
  734. _PVN22Valve.TurnValve(false, out _);
  735. foreach (var stick in _gasLines)
  736. {
  737. stick.Stop();
  738. }
  739. }
  740. public override bool ExtendWafer()
  741. {
  742. throw new NotImplementedException();
  743. }
  744. public override bool FlowGas(int gasNum, double val)
  745. {
  746. if (_gasLines.Length <= gasNum)
  747. return false;
  748. _gasLines[gasNum].Flow(val);
  749. return true;
  750. }
  751. public override bool FlowN2(double val)
  752. {
  753. _gasLineN2.Flow(val);
  754. return true;
  755. }
  756. public override void RTCloseEvent()
  757. {
  758. if (_Generator.IsPowerOn)
  759. {
  760. GeneratorPowerOn(false);
  761. }
  762. if (_GeneratorBias.IsPowerOn)
  763. {
  764. GeneratorBiasPowerOn(false);
  765. }
  766. if (PendulumValveIsOpen())
  767. {
  768. TurnPendulumValve(false);
  769. }
  770. }
  771. public override bool GeneratorBiasPowerOn(bool on)
  772. {
  773. if (_GeneratorBias == null) return false;
  774. if (on && !IsRFGInterlockOn)
  775. {
  776. LOG.Write(eEvent.ERR_RF, Module, "Bias射频电源 Interlock条件不满足");
  777. return false;
  778. }
  779. return _GeneratorBias.SetPowerOnOff(on, out _);
  780. }
  781. public override bool GeneratorBiasSetMatchMode(bool val)
  782. {
  783. if (_GeneratorBias == null) return false;
  784. string reason = string.Empty;
  785. _GeneratorBias.SetMatchingAutoMode(val, out reason);
  786. return true;
  787. }
  788. public override bool SetMatchWorkMode(MatchWorkMode matchWorkMode)
  789. {
  790. if (_Match == null) return false;
  791. if (matchWorkMode == MatchWorkMode.Auto)
  792. {
  793. return _Match.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  794. }
  795. else
  796. {
  797. return _Match.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  798. }
  799. }
  800. public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
  801. {
  802. if (_BiasMatch == null) return false;
  803. if (matchWorkMode == MatchWorkMode.Auto)
  804. {
  805. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
  806. }
  807. else if (matchWorkMode == MatchWorkMode.Manual)
  808. {
  809. return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
  810. }
  811. return false;
  812. }
  813. public override bool GeneratorBiasSetpower(float val)
  814. {
  815. if (_GeneratorBias == null) return false;
  816. if (Math.Abs(val) > 0.01)
  817. _GeneratorBias.SetPower((ushort)val);
  818. return true;
  819. }
  820. public override bool GeneratorPowerOn(bool on)
  821. {
  822. if (_Generator == null) return false;
  823. if (on && !IsRFGInterlockOn)
  824. {
  825. LOG.Write(eEvent.ERR_RF, Module, "射频电源 Interlock条件不满足");
  826. return false;
  827. }
  828. return _Generator.SetPowerOnOff(on, out _);
  829. }
  830. public override bool GeneratorSetpower(float val)
  831. {
  832. if (_Generator == null) return false;
  833. if (Math.Abs(val) > 0.01)
  834. _Generator.SetPower((ushort)val);
  835. return true;
  836. }
  837. public override float GetPVPosition()
  838. {
  839. return _pendulumValve.Position;
  840. }
  841. public override async void HeatChiller(ChillerType chillerType, double value, double offset)
  842. {
  843. _Chiller?.SetChillerTemp((float)value, (float)offset);
  844. await Task.Delay(1000);
  845. _Chiller?.SetChillerOnOff(true);
  846. }
  847. public override void Home()
  848. {
  849. SetLiftPin(MovementPosition.Down, out _);
  850. //转交TM
  851. if (!IsSlitDoorClosed)
  852. {
  853. SetSlitDoor(true, out _);
  854. }
  855. else
  856. {
  857. SetSlitDoor(false, out _);
  858. }
  859. //SetSlitDoor(false, out _);
  860. OpenValve(ValveType.PVN22, false);
  861. _Generator?.ReConnect();
  862. _ESCHV.ReConnect();
  863. _GeneratorBias?.ReConnect();
  864. _BiasMatch?.ReConnect();
  865. _Match?.ReConnect();
  866. _MainPump?.ReConnect();
  867. _TurboPump?.ReConnect();
  868. _pendulumValve?.ReConnect();
  869. }
  870. public override void OnOffChiller(ChillerType chillerType, bool onoff)
  871. => _Chiller?.SetChillerOnOff(onoff);
  872. public override bool OnOffSetESCHV(bool on)
  873. => _ESCHV.SetPowerOnOff(on);
  874. public override void OpenValve(ValveType vlvType, bool on)
  875. {
  876. if (Valve2IO.ContainsKey(vlvType))
  877. {
  878. if (vlvType == ValveType.TurboPumpPurge && on)
  879. {
  880. if (!IsISOOpen)
  881. {
  882. LOG.Write(eEvent.WARN_DEFAULT_WARN, Module, $"Chamber TurboPumpPumping valve is not open, can not turn on TurboPumpPurge valve.");
  883. return;
  884. }
  885. }
  886. else if (vlvType == ValveType.TurboPumpPumping && !on)
  887. {
  888. if (IsTurboPumpRunning)
  889. {
  890. if (IsPenVOpen)
  891. {
  892. LOG.Write(eEvent.WARN_DEFAULT_WARN, Module, $"Chamber TurboPump is open but Pendulum Valve is open, can not turn off TurboPumpPumping valve.");
  893. return;
  894. }
  895. }
  896. }
  897. if (vlvType == ValveType.TurboPumpPurge && !_TurboPumpPumpingValve.Status && on)
  898. {
  899. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Purge, cause Turbo Pump Valve not open");
  900. return;
  901. }
  902. if (vlvType == ValveType.TurboPumpPumping && on)
  903. {
  904. if (!_MainPump.IsRunning)
  905. {
  906. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Pump, cause Dry Pump Valve is not open");
  907. return;
  908. }
  909. if (ForelinePressure > SC.GetValue<int>($"{Module}.TurboPumpPumpingValveMinForelinePressure"))
  910. {
  911. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot open Turbo Pump Pump, cause forelinePressure:{ForelinePressure}");
  912. return;
  913. }
  914. }
  915. Valve2IO[vlvType].TurnValve(on, out _);
  916. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"{(on ? "打开" : "关闭")} 阀 {vlvType.ToString()}");
  917. }
  918. else
  919. {
  920. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  921. }
  922. }
  923. public async override void AbortControlPressure()
  924. {
  925. OpenValve(ValveType.PVN22, false);
  926. OpenValve(ValveType.N2, false);
  927. await Task.Delay(2000);
  928. OpenValve(ValveType.GasFinal, false);
  929. OpenValve(ValveType.PV14, false);
  930. TurnPendulumValve(false);
  931. //return true;
  932. }
  933. public override bool PendulumValveIsOpen()
  934. {
  935. return _pendulumValve.IsOpen;
  936. }
  937. public override bool RetractWafer()
  938. {
  939. throw new NotImplementedException();
  940. }
  941. public override void SetBacksideHeFlow(double flow)
  942. {
  943. if (_backsideHe == null) return;
  944. _backsideHe.Flow(flow);
  945. }
  946. public override bool SetBacksideHePressure(float mTorr)
  947. {
  948. if (_backsideHe == null) return false;
  949. return _backsideHe.SetBacksideHelium(mTorr);
  950. }
  951. public override bool SetBacksideHeThreshold(float nMin, float nMax)
  952. {
  953. if (_backsideHe == null) return false;
  954. return _backsideHe.SetFlowThreshold(nMin, nMax);
  955. }
  956. public override bool SetBiasMatchPosition(float c1, float c2)
  957. {
  958. if (_BiasMatch == null) return false;
  959. string reason = string.Empty;
  960. _BiasMatch.SetMatchPosition(c1, c2, out reason);
  961. return true;
  962. }
  963. public override bool SetBiasPulseMode(bool on)
  964. {
  965. if (_GeneratorBias == null) return false;
  966. _GeneratorBias.SetPulseMode(on);
  967. return true;
  968. }
  969. public override bool SetBiasPulseRateFreq(int nFreq)
  970. {
  971. if (_GeneratorBias == null) return false;
  972. _GeneratorBias.SetPulseRateFreq(nFreq);
  973. return true;
  974. }
  975. public override bool SetDiasPulseDutyCycle(int percentage)
  976. {
  977. if (_GeneratorBias == null) return false;
  978. _GeneratorBias.SetPulseDutyCycle(percentage);
  979. return true;
  980. }
  981. public override bool SetESCClampVoltage(int nVoltage)
  982. {
  983. if (_ESCHV == null) return false;
  984. return _ESCHV.SetOutputVoltage(nVoltage);
  985. }
  986. public override void SetGeneratorCommunicationMode(int mode)
  987. => _Generator?.SetCommunicationMode(mode);
  988. public override bool SetLiftPin(MovementPosition dirt, out string reason)
  989. {
  990. reason = string.Empty;
  991. switch (dirt)
  992. {
  993. case MovementPosition.Down:
  994. return _LiftPin.SetCylinder(false, out reason);
  995. case MovementPosition.Up:
  996. return _LiftPin.SetCylinder(true, out reason);
  997. case MovementPosition.Left:
  998. case MovementPosition.Right:
  999. case MovementPosition.Middle:
  1000. throw new ArgumentException("Movement argument error");
  1001. }
  1002. return true;
  1003. }
  1004. public override bool SetMatchPosition(float c1, float c2)
  1005. {
  1006. if (_Match == null) return false;
  1007. string reason = string.Empty;
  1008. _Match.SetMatchPosition(c1, c2, out reason);
  1009. return true;
  1010. }
  1011. public override bool SetPVPostion(float position)
  1012. => _pendulumValve.SetPosition(position);
  1013. public override bool SetPVPressure(float pressure)
  1014. => _pendulumValve.SetPressure(pressure);
  1015. public override bool SetSlitDoor(bool open, out string reason)
  1016. {
  1017. reason = string.Empty;
  1018. // 泓浒TM将提供开关门的interlock
  1019. //OP.DoOperation($"{Singleton<RouteManager>.Instance.seTM.Module}.SetSlitDoor", Module, open);
  1020. return true;
  1021. }
  1022. public override bool SetWallTCTemperature(float value)
  1023. => _WallTC.RampTemp(value);
  1024. public override void StopAllGases()
  1025. {
  1026. foreach (var line in _gasLines)
  1027. {
  1028. line.Stop();
  1029. }
  1030. }
  1031. public override bool StopGas(int gasNum)
  1032. {
  1033. if (_gasLines.Length <= gasNum)
  1034. return false;
  1035. _gasLines[gasNum].Stop();
  1036. return true;
  1037. }
  1038. public override bool StopN2()
  1039. {
  1040. _gasLineN2.Stop();
  1041. return true;
  1042. }
  1043. public override void SwitchOnBuzzerAndRed()
  1044. {
  1045. throw new NotImplementedException();
  1046. }
  1047. public override void TurnDryPump(bool on)
  1048. => _MainPump?.SetPumpOnOff(on);
  1049. public override bool TurnPendulumValve(bool on)
  1050. => _pendulumValve.TurnValve(on);
  1051. public override void TurnTurboPump(bool on)
  1052. {
  1053. _TurboPump?.SetPumpOnOff(on);
  1054. }
  1055. public override bool PreparePlace()
  1056. {
  1057. if (!SetLiftPin(MovementPosition.Down, out string reason))
  1058. {
  1059. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin down failed:{reason}");
  1060. return false;
  1061. }
  1062. return true;
  1063. }
  1064. public override bool PreparePick()
  1065. {
  1066. if (!SetLiftPin(MovementPosition.Up, out string reason))
  1067. {
  1068. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Up failed:{reason}");
  1069. return false;
  1070. }
  1071. return true;
  1072. }
  1073. public override bool PreparePlaceIsOK()
  1074. {
  1075. return LiftPinIsDown;
  1076. }
  1077. public override bool PreparePickIsOK()
  1078. {
  1079. return LiftPinIsUp;
  1080. }
  1081. public override bool EndPlace()
  1082. {
  1083. if (!SetLiftPin(MovementPosition.Down, out string reason))
  1084. {
  1085. LOG.Write(eEvent.ERR_PM, Module, $"Set Lift Pin Down failed:{reason}");
  1086. return false;
  1087. }
  1088. return true;
  1089. }
  1090. public override bool EndPick()
  1091. {
  1092. return true;
  1093. }
  1094. public override bool EndPlaceIsOK()
  1095. {
  1096. return CheckSlitDoorClose() && LiftPinIsDown;
  1097. }
  1098. public override bool EndPickIsOK()
  1099. {
  1100. return CheckSlitDoorClose();
  1101. }
  1102. private Stopwatch _closedelay = new Stopwatch();
  1103. public override void Monitor()
  1104. {
  1105. bool _isAllGasOff = true;
  1106. foreach (var gas in _gasLines)
  1107. {
  1108. gas.Monitor();
  1109. if (gas._mfc.FeedBack > 0)
  1110. _isAllGasOff = false;
  1111. }
  1112. CheckPermanentInterlock();
  1113. //2024-02-20 17:11:16 朱永吉确认所有气不流后关闭rf 任意一管打开都不关闭
  1114. if (!_Generator.IsPowerOn && !_GeneratorBias.IsPowerOn && _closedelay.IsRunning)
  1115. {
  1116. LOG.Write(eEvent.EV_DEVICE_INFO, Module, $"Turn On RF use:{_closedelay.ElapsedMilliseconds} ms");
  1117. _closedelay.Stop();
  1118. }
  1119. if (_isAllGasOff && !_closedelay.IsRunning && (_Generator.IsPowerOn || _GeneratorBias.IsPowerOn))
  1120. {
  1121. _closedelay.Start();
  1122. GasRFInterlock();
  1123. }
  1124. }
  1125. #endregion
  1126. private void GasRFInterlock()
  1127. {
  1128. if (_Generator.IsPowerOn)
  1129. {
  1130. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"ALL Gas are not flowing. Source RF will Power Off");
  1131. GeneratorPowerOn(false);
  1132. }
  1133. if (_GeneratorBias.IsPowerOn)
  1134. {
  1135. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"ALL Gas are not flowing. Bias RF will Power Off");
  1136. GeneratorBiasPowerOn(false);
  1137. }
  1138. }
  1139. protected override void CheckPermanentInterlock()
  1140. {
  1141. if (ChamberPressure >= 98 && _GuageValve.SetPoint)
  1142. {
  1143. _GuageValve.TurnValve(false, out _);
  1144. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} exceed 98 mtorr, Guage Valve (DO-31) closed automaticlly.");
  1145. }
  1146. if (ChamberPressure < 98 && !_GuageValve.SetPoint)
  1147. {
  1148. _GuageValve.TurnValve(true, out _);
  1149. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"Process pressure:{ChamberPressure} less than 98 mtorr, Guage Valve (DO-31) open automaticlly.");
  1150. }
  1151. }
  1152. public override bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
  1153. {
  1154. OpenValve(ValveType.TurboPumpPumping, true);
  1155. if (_TurboPumpPumpingValve.Status)
  1156. {
  1157. TurnPendulumValve(true);
  1158. SetPVPressure(pressureSetpoint);
  1159. OpenValve(ValveType.PV14, true);
  1160. OpenValve(ValveType.GasFinal, false);
  1161. OpenValve(ValveType.PVN22, true);
  1162. return true;
  1163. }
  1164. else
  1165. {
  1166. LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot control pressure,cause Turbo Pump Pumping Valve is Close");
  1167. return true;
  1168. }
  1169. }
  1170. private void ALARM_Notify()
  1171. {
  1172. if (Singleton<RouteManager>.Instance.GetPM(Module).IsProcessing)
  1173. Singleton<RouteManager>.Instance.GetPM(Module).PostMsg(FSM_MSG.ALARM);
  1174. }
  1175. private void SensorWithAlarm()
  1176. {
  1177. _WLK_sw.WarningAction += ALARM_Notify;
  1178. //_PM_Lid_Closed.WarningAction += ALARM_Notify;
  1179. _RFG_Interlock.WarningAction += ALARM_Notify;
  1180. _TurboPumpInterlock.WarningAction += ALARM_Notify;
  1181. _GasBoxDoor.WarningAction += ALARM_Notify;
  1182. _GasBoxPressure.WarningAction += ALARM_Notify;
  1183. }
  1184. public override void PMInError()
  1185. {
  1186. CloseValves();
  1187. GeneratorPowerOn(false);
  1188. GeneratorBiasPowerOn(false);
  1189. OpenValve(ValveType.TurboPumpPumping, true);
  1190. OpenValve(ValveType.TurboPumpPurge, true);
  1191. if (IsTurboPumpAtSpeed)
  1192. {
  1193. OpenValve(ValveType.TurboPumpPumping, true);
  1194. _pendulumValve.SetPosition(1000);
  1195. }
  1196. OnOffSetESCHV(false);
  1197. }
  1198. }
  1199. }