JetVenusDEPM.cs 58 KB

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