JetVenusDEPM.cs 57 KB

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