JetVenusDEPM.cs 55 KB

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