JetVenusSEPM.cs 49 KB

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