YaskawaRobot.cs 149 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.DataCenter;
  3. using Aitex.Core.RT.Device;
  4. using Aitex.Core.RT.Device.Unit;
  5. using Aitex.Core.RT.Event;
  6. using Aitex.Core.RT.Log;
  7. using Aitex.Core.RT.OperationCenter;
  8. using Aitex.Core.RT.SCCore;
  9. using Aitex.Core.Util;
  10. using MECF.Framework.Common.Communications;
  11. using MECF.Framework.Common.Equipment;
  12. using MECF.Framework.Common.SubstrateTrackings;
  13. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
  14. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
  15. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
  16. using System;
  17. using System.Collections.Generic;
  18. using System.Diagnostics;
  19. using System.Text;
  20. using System.Threading;
  21. using EventType = Aitex.Core.RT.Event.EventType;
  22. namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.YaskawaRobots
  23. {
  24. public class YaskawaSR100Robot : RobotBaseDevice, IConnection
  25. {
  26. public int UnitNumber
  27. {
  28. get; private set;
  29. }
  30. protected bool isSimulatorMode;
  31. private string _scRoot;
  32. //private string _ipaddress;
  33. public YaskawaTokenGenerator SeqnoGenerator { get; private set; }
  34. public bool IsEnableSeqNo { get; private set; }
  35. public bool IsEnableCheckSum { get; private set; }
  36. public int CurrentSeqNo { get; set; }
  37. public string PortName;
  38. private string _address;
  39. private bool _enableLog;
  40. protected YaskawaRobotConnection _connection;
  41. private R_TRIG _trigError = new R_TRIG();
  42. private R_TRIG _trigCommunicationError = new R_TRIG();
  43. private R_TRIG _trigRetryConnect = new R_TRIG();
  44. public string Address => _address;
  45. private PeriodicJob _thread;
  46. protected object _locker = new object();
  47. protected LinkedList<HandlerBase> _lstHandlers = new LinkedList<HandlerBase>();
  48. private IoSensor _diRobotReady = null; //Normal ON
  49. private IoSensor _diRobotBlade1WaferOn = null; //Off when wafer present
  50. private IoSensor _diRobotBlade2WaferOn = null;
  51. private IoSensor _diRobotError = null; //Normal ON
  52. private IoSensor _diTPinUse = null;
  53. private IoTrigger _doRobotHold = null; // Normal ON
  54. public ModuleName CurrentInteractiveModule { get; private set; }
  55. public bool IsConnected => _connection.IsConnected;
  56. public bool IsGrippedBlade1 { get; private set; }
  57. public bool IsGrippedBlade2 { get; private set; }
  58. public bool IsPermittedInterlock1 { get; private set; }
  59. public bool IsPermittedInterlock2 { get; private set; }
  60. public bool IsPermittedInterlock3 { get; private set; }
  61. public bool IsPermittedInterlock4 { get; private set; }
  62. public bool IsPermittedInterlock5 { get; private set; }
  63. public bool IsPermittedInterlock6 { get; private set; }
  64. public bool IsPermittedInterlock7 { get; private set; }
  65. public bool IsPermittedInterlock8 { get; private set; }
  66. public float CurrentThetaPosition { get; private set; }
  67. public float CurrentExtensionPosition { get; private set; }
  68. public float CurrentArm1Position { get; private set; }
  69. public float CurrentArm2Position { get; private set; }
  70. public float CurrentZPosition { get; private set; }
  71. public float CommandThetaPosition { get; private set; }
  72. public float CommandExtensionPosition { get; private set; }
  73. public float CommandArm1Position { get; private set; }
  74. public float CommandArm2Position { get; private set; }
  75. public float CommandZPosition { get; private set; }
  76. public int SpeedLevel { get; private set; }
  77. public int SpeedLevelSetting => SC.GetValue<int>($"{_scRoot}.{Name}.SpeedLevel");
  78. public string ReadMemorySpec { get; private set; }
  79. public string ReadTransferStation { get; private set; }
  80. public int ReadSlotNumber { get; private set; }
  81. public string ReadArmPosture { get; private set; }
  82. public RobotArmEnum ReadBladeNo { get; private set; }
  83. public YaskawaPositonEnum ReadPositionType { get; private set; }
  84. public float ReadThetaPosition { get; private set; }
  85. public float ReadExtensionPosition { get; private set; }
  86. public float ReadArm1Position { get; private set; }
  87. public float ReadArm2Position { get; private set; }
  88. internal void ResetError()
  89. {
  90. lock (_locker)
  91. _lstHandlers.AddFirst(new SR100RobotMotionHandler(this, "CCLR", "E"));
  92. }
  93. public float ReadZPosition { get; private set; }
  94. public Dictionary<string, string> ReadStationItemValues { get; private set; } = new Dictionary<string, string>();
  95. public Dictionary<string, string> ReadStationItemContents { get; private set; } = new Dictionary<string, string>();
  96. public string ReadParameterType { get; private set; }
  97. public string ReadParameterNo { get; private set; }
  98. public string ReadParameterValue { get; private set; }
  99. public bool IsManipulatorBatteryLow { get; private set; }
  100. public bool IsCommandExecutionReady { get; private set; }
  101. public bool IsServoON { get; private set; }
  102. public bool IsErrorOccurred { get; private set; }
  103. public bool IsControllerBatteryLow { get; private set; }
  104. public bool IsCheckInterlockWaferPresenceOnBlade1 { get; private set; }
  105. public bool IsCheckInterlockWaferPresenceOnBlade2 { get; private set; }
  106. public bool IsCheckInterlockPAOp { get; private set; }
  107. public bool IsCheckInterlockPAWaferStatus { get; private set; }
  108. public bool IsCheckInterlockPAWaferStatusByCCD { get; private set; }
  109. public override bool IsEnableAutoRun(out string reason)
  110. {
  111. reason = "";
  112. if (!IsCheckInterlockWaferPresenceOnBlade1)
  113. {
  114. reason = "Blade1WaferCheck is Disable";
  115. return false;
  116. }
  117. if (!IsCheckInterlockWaferPresenceOnBlade2)
  118. {
  119. reason = "Blade2WaferCheck is Disable";
  120. return false;
  121. }
  122. if(!_isWaferMatchRecord && _isCheckWaferBeforeAction)
  123. {
  124. reason = "WaferStateUnmatchRecord";
  125. return false;
  126. }
  127. return true;
  128. }
  129. public string RobotSystemVersion { get; private set; }
  130. public string RobotSoftwareVersion { get; private set; }
  131. public string ReadMappingTransferStation { get; private set; }
  132. public int ReadMappingSlotNumbers { get; private set; }
  133. public string ReadSlotMap { get; private set; }
  134. public bool IsCheckWaferForHHSmec { get; set; }
  135. public Dictionary<string, float> ReadMappingCalibrationResult { get; private set; }
  136. private bool _isDetectWaferByDI
  137. {
  138. get
  139. {
  140. if (SC.ContainsItem($"{_scRoot}.{Name}.DetectWaferByDI"))
  141. return SC.GetValue<bool>($"{_scRoot}.{Name}.DetectWaferByDI");
  142. return true;
  143. }
  144. }
  145. protected bool _isCheckWaferAfterAction
  146. {
  147. get
  148. {
  149. if (SC.ContainsItem($"{_scRoot}.{Name}.CheckWaferAfterAction"))
  150. return SC.GetValue<bool>($"{_scRoot}.{Name}.CheckWaferAfterAction");
  151. return true;
  152. }
  153. }
  154. protected bool _isCheckWaferBeforeAction
  155. {
  156. get
  157. {
  158. if (SC.ContainsItem($"{_scRoot}.{Name}.CheckWaferBeforeAction"))
  159. return SC.GetValue<bool>($"{_scRoot}.{Name}.CheckWaferBeforeAction");
  160. return false;
  161. }
  162. }
  163. public override bool IsEnableMapWafer
  164. {
  165. get
  166. {
  167. if (WaferManager.Instance.CheckHasWafer(RobotModuleName, 1))
  168. return false;
  169. //if (WaferManager.Instance.CheckHasWafer(RobotModuleName, 0))
  170. //return false;
  171. return true;
  172. }
  173. }
  174. public YaskawaSR100Robot(string module, string name, string scRoot, IoSensor[] dis, IoTrigger[] dos) : base(module, name)
  175. {
  176. Module = module;
  177. Name = name;
  178. isSimulatorMode = SC.ContainsItem("System.IsSimulatorMode") ? SC.GetValue<bool>("System.IsSimulatorMode") : false;
  179. _scRoot = scRoot;
  180. _address = SC.GetStringValue($"{_scRoot}.{Name}.Address");
  181. _enableLog = SC.GetValue<bool>($"{_scRoot}.{Name}.EnableLogMessage");
  182. UnitNumber = SC.GetValue<int>($"{_scRoot}.{Name}.UnitNumber");
  183. IsEnableCheckSum = SC.GetValue<bool>($"{_scRoot}.{Name}.EnableCheckSum");
  184. IsEnableSeqNo = SC.GetValue<bool>($"{_scRoot}.{Name}.EnableSeqNo");
  185. _connection = new YaskawaRobotConnection(this, _address);
  186. _connection.EnableLog(_enableLog);
  187. SeqnoGenerator = new YaskawaTokenGenerator($"{_scRoot}.{Name}.CommunicationToken");
  188. if (dis != null && dis.Length >= 5)
  189. {
  190. _diRobotReady = dis[0];
  191. _diRobotBlade1WaferOn = dis[1];
  192. _diRobotBlade2WaferOn = dis[2];
  193. _diRobotError = dis[3];
  194. _diTPinUse = dis[4];
  195. _diRobotError.OnSignalChanged += _diRobotError_OnSignalChanged;
  196. _diTPinUse.OnSignalChanged += _diTPinUse_OnSignalChanged;
  197. }
  198. if (dos != null && dos.Length >= 1)
  199. {
  200. _doRobotHold = dos[0];
  201. }
  202. ConnectionManager.Instance.Subscribe($"{Name}", _connection);
  203. _thread = new PeriodicJob(1, OnTimer, $"{_scRoot}.{Name} MonitorHandler", true);
  204. ReadStationItemContents.Add("00", "Upward offset");
  205. ReadStationItemContents.Add("01", "Downword offset");
  206. ReadStationItemContents.Add("02", "Grip position offset");
  207. ReadStationItemContents.Add("06", "G2/P3 offset in the extending direction");
  208. ReadStationItemContents.Add("08", "Put downward offset");
  209. ReadStationItemContents.Add("70", "Get operation Movet_grip function yes/no");
  210. ReadStationItemContents.Add("71", "Get operation rsing pattern");
  211. ReadStationItemContents.Add("80", "Put operation Move_grip function yes/no");
  212. ReadStationItemContents.Add("81", "Put operation dropping pattern");
  213. ReadStationItemContents.Add("50", "Slot Numbers");
  214. ReadStationItemContents.Add("30", "Slot pitch(Left elbow,Blade1)");
  215. ReadStationItemContents.Add("31", "Slot pitch(Left elbow,Blade2)");
  216. ReadStationItemContents.Add("32", "Slot pitch(Rigth elbow,Blade1)");
  217. ReadStationItemContents.Add("33", "Slot pitch(Right elbow,Blade2)");
  218. ResetPropertiesAndResponses();
  219. RegisterSpecialData();
  220. //RegisterAlarm();
  221. }
  222. public void HandlerMotion(string command, string[] pdata)
  223. {
  224. switch (command)
  225. {
  226. case "MMAP":
  227. try
  228. {
  229. StringBuilder sb = new StringBuilder();
  230. for (int i = 6; i < pdata.Length; i++)
  231. {
  232. string value = pdata[i].Substring(3);
  233. switch (value)
  234. {
  235. case "--":
  236. sb.Append("0");
  237. break;
  238. case "OK":
  239. sb.Append("1");
  240. break;
  241. case "CW":
  242. sb.Append("2");
  243. break;
  244. case "DW":
  245. sb.Append("W");
  246. break;
  247. }
  248. }
  249. ReadSlotMap = sb.ToString();
  250. if(!_isNeedMappignData)
  251. NotifySlotMapResult(CurrentInteractiveModule, ReadSlotMap);
  252. return;
  253. }
  254. catch (Exception ex)
  255. {
  256. LOG.Write(ex);
  257. }
  258. break;
  259. default:
  260. break;
  261. }
  262. }
  263. private void RegisterAlarm()
  264. {
  265. EV.Subscribe(new EventItem("Alarm", $"{Name}Error020", $"{Name} Robot Occurred Error:Secondary power off.", EventLevel.Alarm, EventType.EventUI_Notify));
  266. EV.Subscribe(new EventItem("Alarm", $"{Name}Error021", $"{Name} Robot Occurred Error:Secondary power on.", EventLevel.Alarm, EventType.EventUI_Notify));
  267. EV.Subscribe(new EventItem("Alarm", $"{Name}Error040", $"{Name} Robot Occurred Error:In TEACH Mode.", EventLevel.Alarm, EventType.EventUI_Notify));
  268. EV.Subscribe(new EventItem("Alarm", $"{Name}Error050", $"{Name} Robot Occurred Error:Unit is in motion.", EventLevel.Alarm, EventType.EventUI_Notify));
  269. EV.Subscribe(new EventItem("Alarm", $"{Name}Error051", $"{Name} Robot Occurred Error:Unable to set pitch between slots.", EventLevel.Alarm, EventType.EventUI_Notify));
  270. EV.Subscribe(new EventItem("Alarm", $"{Name}Error052", $"{Name} Robot Occurred Error:Unable to restart motion.", EventLevel.Alarm, EventType.EventUI_Notify));
  271. EV.Subscribe(new EventItem("Alarm", $"{Name}Error053", $"{Name} Robot Occurred Error:Ready position move incomplete.", EventLevel.Alarm, EventType.EventUI_Notify));
  272. EV.Subscribe(new EventItem("Alarm", $"{Name}Error054", $"{Name} Robot Occurred Error:Alignment Ready position move incomplete.", EventLevel.Alarm, EventType.EventUI_Notify));
  273. EV.Subscribe(new EventItem("Alarm", $"{Name}Error055", $"{Name} Robot Occurred Error:Improper station type.", EventLevel.Alarm, EventType.EventUI_Notify));
  274. EV.Subscribe(new EventItem("Alarm", $"{Name}Error058", $"{Name} Robot Occurred Error:Command not supported 1-1.", EventLevel.Alarm, EventType.EventUI_Notify));
  275. EV.Subscribe(new EventItem("Alarm", $"{Name}Error059", $"{Name} Robot Occurred Error:Invalid transfer point.", EventLevel.Alarm, EventType.EventUI_Notify));
  276. EV.Subscribe(new EventItem("Alarm", $"{Name}Error05A", $"{Name} Robot Occurred Error:Linear motion failed.", EventLevel.Alarm, EventType.EventUI_Notify));
  277. EV.Subscribe(new EventItem("Alarm", $"{Name}Error05C", $"{Name} Robot Occurred Error:Unable to reference wafer alignment result.", EventLevel.Alarm, EventType.EventUI_Notify));
  278. EV.Subscribe(new EventItem("Alarm", $"{Name}Error05D", $"{Name} Robot Occurred Error:Unable to perform arm calibration.", EventLevel.Alarm, EventType.EventUI_Notify));
  279. EV.Subscribe(new EventItem("Alarm", $"{Name}Error05E", $"{Name} Robot Occurred Error:Unable to read mapping data.", EventLevel.Alarm, EventType.EventUI_Notify));
  280. EV.Subscribe(new EventItem("Alarm", $"{Name}Error05F", $"{Name} Robot Occurred Error:Data Upload/Download in progress.", EventLevel.Alarm, EventType.EventUI_Notify));
  281. EV.Subscribe(new EventItem("Alarm", $"{Name}Error061", $"{Name} Robot Occurred Error:Unable to motion.", EventLevel.Alarm, EventType.EventUI_Notify));
  282. EV.Subscribe(new EventItem("Alarm", $"{Name}Error064", $"{Name} Robot Occurred Error:Lifter interference error.", EventLevel.Alarm, EventType.EventUI_Notify));
  283. EV.Subscribe(new EventItem("Alarm", $"{Name}Error070", $"{Name} Robot Occurred Error:Bottom slot position record incomplete.", EventLevel.Alarm, EventType.EventUI_Notify));
  284. EV.Subscribe(new EventItem("Alarm", $"{Name}Error071", $"{Name} Robot Occurred Error:Top slot position record incomplete.", EventLevel.Alarm, EventType.EventUI_Notify));
  285. EV.Subscribe(new EventItem("Alarm", $"{Name}Error088", $"{Name} Robot Occurred Error:Position generating error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  286. EV.Subscribe(new EventItem("Alarm", $"{Name}Error089", $"{Name} Robot Occurred Error:Position generating error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  287. EV.Subscribe(new EventItem("Alarm", $"{Name}Error08A", $"{Name} Robot Occurred Error:Position generating error 3.", EventLevel.Alarm, EventType.EventUI_Notify));
  288. EV.Subscribe(new EventItem("Alarm", $"{Name}Error08B", $"{Name} Robot Occurred Error:Position generating error 4.", EventLevel.Alarm, EventType.EventUI_Notify));
  289. EV.Subscribe(new EventItem("Alarm", $"{Name}Error08C", $"{Name} Robot Occurred Error:Position generating error 5.", EventLevel.Alarm, EventType.EventUI_Notify));
  290. EV.Subscribe(new EventItem("Alarm", $"{Name}Error08D", $"{Name} Robot Occurred Error:Position generating error 6.", EventLevel.Alarm, EventType.EventUI_Notify));
  291. EV.Subscribe(new EventItem("Alarm", $"{Name}Error090", $"{Name} Robot Occurred Error:Host parameter out of range.", EventLevel.Alarm, EventType.EventUI_Notify));
  292. EV.Subscribe(new EventItem("Alarm", $"{Name}Error0A0", $"{Name} Robot Occurred Error:Alignment motion error.", EventLevel.Alarm, EventType.EventUI_Notify));
  293. EV.Subscribe(new EventItem("Alarm", $"{Name}Error0E0", $"{Name} Robot Occurred Error:Teach position adjustmentoffset amount limit error.", EventLevel.Alarm, EventType.EventUI_Notify));
  294. EV.Subscribe(new EventItem("Alarm", $"{Name}Error0F0", $"{Name} Robot Occurred Error:Voltage drop warning.", EventLevel.Alarm, EventType.EventUI_Notify));
  295. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*06", $"{Name} Robot Occurred Error:Amplifier Type Mismatch.", EventLevel.Alarm, EventType.EventUI_Notify));
  296. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*07", $"{Name} Robot Occurred Error:Encoder Type Mismatch.", EventLevel.Alarm, EventType.EventUI_Notify));
  297. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*10", $"{Name} Robot Occurred Error:Overflow Current.", EventLevel.Alarm, EventType.EventUI_Notify));
  298. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*30", $"{Name} Robot Occurred Error:Regeneration Error Detected.", EventLevel.Alarm, EventType.EventUI_Notify));
  299. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*40", $"{Name} Robot Occurred Error:Excess Voltage (converter).", EventLevel.Alarm, EventType.EventUI_Notify));
  300. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*41", $"{Name} Robot Occurred Error:Insufficient Voltage.", EventLevel.Alarm, EventType.EventUI_Notify));
  301. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*45", $"{Name} Robot Occurred Error:Brake circuit error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  302. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*46", $"{Name} Robot Occurred Error:Converter ready signal error.", EventLevel.Alarm, EventType.EventUI_Notify));
  303. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*47", $"{Name} Robot Occurred Error:Input power error.", EventLevel.Alarm, EventType.EventUI_Notify));
  304. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*48", $"{Name} Robot Occurred Error:Converter main circuit chargeerror.", EventLevel.Alarm, EventType.EventUI_Notify));
  305. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*49", $"{Name} Robot Occurred Error:Amplifier ready signal error.", EventLevel.Alarm, EventType.EventUI_Notify));
  306. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*51", $"{Name} Robot Occurred Error:Excessive Speed.", EventLevel.Alarm, EventType.EventUI_Notify));
  307. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*71", $"{Name} Robot Occurred Error:Momentary Overload (Motor).", EventLevel.Alarm, EventType.EventUI_Notify));
  308. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*72", $"{Name} Robot Occurred Error:Continuous Overload (Motor).", EventLevel.Alarm, EventType.EventUI_Notify));
  309. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*78", $"{Name} Robot Occurred Error:Overload (Converter).", EventLevel.Alarm, EventType.EventUI_Notify));
  310. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*7B", $"{Name} Robot Occurred Error:Amplifier overheat.", EventLevel.Alarm, EventType.EventUI_Notify));
  311. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*7C", $"{Name} Robot Occurred Error:Continuous Overload(Amplifier).", EventLevel.Alarm, EventType.EventUI_Notify));
  312. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*7D", $"{Name} Robot Occurred Error:Momentary Overload.", EventLevel.Alarm, EventType.EventUI_Notify));
  313. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*81", $"{Name} Robot Occurred Error:Absolute Encoder Back-upError.", EventLevel.Alarm, EventType.EventUI_Notify));
  314. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*83", $"{Name} Robot Occurred Error:Absolute Encoder Battery.", EventLevel.Alarm, EventType.EventUI_Notify));
  315. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*84", $"{Name} Robot Occurred Error:Encoder Data Error 2-1.", EventLevel.Alarm, EventType.EventUI_Notify));
  316. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*85", $"{Name} Robot Occurred Error:Encoder Excessive Speed.", EventLevel.Alarm, EventType.EventUI_Notify));
  317. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*86", $"{Name} Robot Occurred Error:Encoder Overheat.", EventLevel.Alarm, EventType.EventUI_Notify));
  318. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*88", $"{Name} Robot Occurred Error:Encoder error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  319. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*89", $"{Name} Robot Occurred Error:Encoder Command failed.", EventLevel.Alarm, EventType.EventUI_Notify));
  320. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*8A", $"{Name} Robot Occurred Error:Encoder multi-turn range.", EventLevel.Alarm, EventType.EventUI_Notify));
  321. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*8C", $"{Name} Robot Occurred Error:Encoder Reset not completed.", EventLevel.Alarm, EventType.EventUI_Notify));
  322. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*98", $"{Name} Robot Occurred Error:Servo parameter error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  323. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*9A", $"{Name} Robot Occurred Error:Feedback Over Flow.", EventLevel.Alarm, EventType.EventUI_Notify));
  324. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*B4", $"{Name} Robot Occurred Error:Servo Control Board Failure.", EventLevel.Alarm, EventType.EventUI_Notify));
  325. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*BC", $"{Name} Robot Occurred Error:Encoder error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  326. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*C1", $"{Name} Robot Occurred Error:Motor runaway detection.", EventLevel.Alarm, EventType.EventUI_Notify));
  327. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*C9", $"{Name} Robot Occurred Error:Encoder Communication.", EventLevel.Alarm, EventType.EventUI_Notify));
  328. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*CE", $"{Name} Robot Occurred Error:Encoder error 3.", EventLevel.Alarm, EventType.EventUI_Notify));
  329. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*CF", $"{Name} Robot Occurred Error:Encoder error 4.", EventLevel.Alarm, EventType.EventUI_Notify));
  330. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*D0", $"{Name} Robot Occurred Error:Position deviation error.", EventLevel.Alarm, EventType.EventUI_Notify));
  331. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*D1", $"{Name} Robot Occurred Error:Position deviation saturation.", EventLevel.Alarm, EventType.EventUI_Notify));
  332. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*D2", $"{Name} Robot Occurred Error:Motor directive position error.", EventLevel.Alarm, EventType.EventUI_Notify));
  333. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*D4", $"{Name} Robot Occurred Error:Servo Tracking Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  334. EV.Subscribe(new EventItem("Alarm", $"{Name}Error*F1", $"{Name} Robot Occurred Error:Phase loss.", EventLevel.Alarm, EventType.EventUI_Notify));
  335. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorE*1", $"{Name} Robot Occurred Error:Positioning Timeout.", EventLevel.Alarm, EventType.EventUI_Notify));
  336. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorE*D", $"{Name} Robot Occurred Error:Command not supported 1-2.", EventLevel.Alarm, EventType.EventUI_Notify));
  337. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorE*E", $"{Name} Robot Occurred Error:Communication Error(internal controller) 1-1.", EventLevel.Alarm, EventType.EventUI_Notify));
  338. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorE*F", $"{Name} Robot Occurred Error:Servo control board responsetimeout 1..", EventLevel.Alarm, EventType.EventUI_Notify));
  339. EV.Subscribe(new EventItem("Alarm", $"{Name}Error701", $"{Name} Robot Occurred Error:ROM Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  340. EV.Subscribe(new EventItem("Alarm", $"{Name}Error703", $"{Name} Robot Occurred Error:Communication Error(internal controller) 2-1.", EventLevel.Alarm, EventType.EventUI_Notify));
  341. EV.Subscribe(new EventItem("Alarm", $"{Name}Error704", $"{Name} Robot Occurred Error:Communication Error (internal controller) 2-2.", EventLevel.Alarm, EventType.EventUI_Notify));
  342. EV.Subscribe(new EventItem("Alarm", $"{Name}Error705", $"{Name} Robot Occurred Error:Communication Error(internal controller) 2-3.", EventLevel.Alarm, EventType.EventUI_Notify));
  343. EV.Subscribe(new EventItem("Alarm", $"{Name}Error706", $"{Name} Robot Occurred Error:Servo system error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  344. EV.Subscribe(new EventItem("Alarm", $"{Name}Error707", $"{Name} Robot Occurred Error:Servo system error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  345. EV.Subscribe(new EventItem("Alarm", $"{Name}Error709", $"{Name} Robot Occurred Error:Current feedback error.", EventLevel.Alarm, EventType.EventUI_Notify));
  346. EV.Subscribe(new EventItem("Alarm", $"{Name}Error70A", $"{Name} Robot Occurred Error:Power Lost.", EventLevel.Alarm, EventType.EventUI_Notify));
  347. EV.Subscribe(new EventItem("Alarm", $"{Name}Error70B", $"{Name} Robot Occurred Error:Rush Current PreventionRelay Abnormal.", EventLevel.Alarm, EventType.EventUI_Notify));
  348. EV.Subscribe(new EventItem("Alarm", $"{Name}Error70C", $"{Name} Robot Occurred Error:Converter mismatch.", EventLevel.Alarm, EventType.EventUI_Notify));
  349. EV.Subscribe(new EventItem("Alarm", $"{Name}Error70F", $"{Name} Robot Occurred Error:Servo control board response timeout 2..", EventLevel.Alarm, EventType.EventUI_Notify));
  350. EV.Subscribe(new EventItem("Alarm", $"{Name}Error713", $"{Name} Robot Occurred Error:DB error.", EventLevel.Alarm, EventType.EventUI_Notify));
  351. EV.Subscribe(new EventItem("Alarm", $"{Name}Error714", $"{Name} Robot Occurred Error:Converter charge Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  352. EV.Subscribe(new EventItem("Alarm", $"{Name}Error715", $"{Name} Robot Occurred Error:Servo OFF Status Error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  353. EV.Subscribe(new EventItem("Alarm", $"{Name}Error716", $"{Name} Robot Occurred Error:Servo ON Status Error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  354. EV.Subscribe(new EventItem("Alarm", $"{Name}Error717", $"{Name} Robot Occurred Error:Servo OFF Status Error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  355. EV.Subscribe(new EventItem("Alarm", $"{Name}Error718", $"{Name} Robot Occurred Error:Servo ON Status Error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  356. EV.Subscribe(new EventItem("Alarm", $"{Name}Error719", $"{Name} Robot Occurred Error:Servo On Abnormal.", EventLevel.Alarm, EventType.EventUI_Notify));
  357. EV.Subscribe(new EventItem("Alarm", $"{Name}Error71A", $"{Name} Robot Occurred Error:Brake circuit error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  358. EV.Subscribe(new EventItem("Alarm", $"{Name}Error71B", $"{Name} Robot Occurred Error:Brake circuit error 3.", EventLevel.Alarm, EventType.EventUI_Notify));
  359. EV.Subscribe(new EventItem("Alarm", $"{Name}Error71C", $"{Name} Robot Occurred Error:Power relay error.", EventLevel.Alarm, EventType.EventUI_Notify));
  360. EV.Subscribe(new EventItem("Alarm", $"{Name}Error721", $"{Name} Robot Occurred Error:Servo parameter error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  361. EV.Subscribe(new EventItem("Alarm", $"{Name}Error722", $"{Name} Robot Occurred Error:Servo parameter error 3.", EventLevel.Alarm, EventType.EventUI_Notify));
  362. EV.Subscribe(new EventItem("Alarm", $"{Name}Error725", $"{Name} Robot Occurred Error:Converter Overheat.", EventLevel.Alarm, EventType.EventUI_Notify));
  363. EV.Subscribe(new EventItem("Alarm", $"{Name}Error726", $"{Name} Robot Occurred Error:Communication Error(internal controller) 2-4.", EventLevel.Alarm, EventType.EventUI_Notify));
  364. EV.Subscribe(new EventItem("Alarm", $"{Name}Error727", $"{Name} Robot Occurred Error:Command not supported 1-2.", EventLevel.Alarm, EventType.EventUI_Notify));
  365. EV.Subscribe(new EventItem("Alarm", $"{Name}Error728", $"{Name} Robot Occurred Error:Communication Error(internal controller) 2-5.", EventLevel.Alarm, EventType.EventUI_Notify));
  366. EV.Subscribe(new EventItem("Alarm", $"{Name}Error729", $"{Name} Robot Occurred Error:Servo system error 3.", EventLevel.Alarm, EventType.EventUI_Notify));
  367. EV.Subscribe(new EventItem("Alarm", $"{Name}Error72A", $"{Name} Robot Occurred Error:Servo system error 4.", EventLevel.Alarm, EventType.EventUI_Notify));
  368. EV.Subscribe(new EventItem("Alarm", $"{Name}Error72B", $"{Name} Robot Occurred Error:Servo parameter error 4.", EventLevel.Alarm, EventType.EventUI_Notify));
  369. EV.Subscribe(new EventItem("Alarm", $"{Name}Error730", $"{Name} Robot Occurred Error:Amp module disconnected..", EventLevel.Alarm, EventType.EventUI_Notify));
  370. EV.Subscribe(new EventItem("Alarm", $"{Name}Error732", $"{Name} Robot Occurred Error:Servo parameter error 5.", EventLevel.Alarm, EventType.EventUI_Notify));
  371. EV.Subscribe(new EventItem("Alarm", $"{Name}Error733", $"{Name} Robot Occurred Error:Servo parameter error 6.", EventLevel.Alarm, EventType.EventUI_Notify));
  372. EV.Subscribe(new EventItem("Alarm", $"{Name}Error734", $"{Name} Robot Occurred Error:Servo parameter error 7.", EventLevel.Alarm, EventType.EventUI_Notify));
  373. EV.Subscribe(new EventItem("Alarm", $"{Name}Error735", $"{Name} Robot Occurred Error:Servo parameter error 8.", EventLevel.Alarm, EventType.EventUI_Notify));
  374. EV.Subscribe(new EventItem("Alarm", $"{Name}Error73F", $"{Name} Robot Occurred Error:Undefined Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  375. EV.Subscribe(new EventItem("Alarm", $"{Name}Error740", $"{Name} Robot Occurred Error:Encoder Status Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  376. EV.Subscribe(new EventItem("Alarm", $"{Name}Error741", $"{Name} Robot Occurred Error:Servo system error 5.", EventLevel.Alarm, EventType.EventUI_Notify));
  377. EV.Subscribe(new EventItem("Alarm", $"{Name}Error742", $"{Name} Robot Occurred Error:Servo system error 6.", EventLevel.Alarm, EventType.EventUI_Notify));
  378. EV.Subscribe(new EventItem("Alarm", $"{Name}Error743", $"{Name} Robot Occurred Error:Servo system error 7.", EventLevel.Alarm, EventType.EventUI_Notify));
  379. EV.Subscribe(new EventItem("Alarm", $"{Name}Error744", $"{Name} Robot Occurred Error:Servo system error 8.", EventLevel.Alarm, EventType.EventUI_Notify));
  380. EV.Subscribe(new EventItem("Alarm", $"{Name}Error745", $"{Name} Robot Occurred Error:Servo system error 9.", EventLevel.Alarm, EventType.EventUI_Notify));
  381. EV.Subscribe(new EventItem("Alarm", $"{Name}Error746", $"{Name} Robot Occurred Error:Servo system error 10.", EventLevel.Alarm, EventType.EventUI_Notify));
  382. EV.Subscribe(new EventItem("Alarm", $"{Name}Error74A", $"{Name} Robot Occurred Error:Servo system error 11.", EventLevel.Alarm, EventType.EventUI_Notify));
  383. EV.Subscribe(new EventItem("Alarm", $"{Name}Error74B", $"{Name} Robot Occurred Error:Servo system error 12.", EventLevel.Alarm, EventType.EventUI_Notify));
  384. EV.Subscribe(new EventItem("Alarm", $"{Name}Error74C", $"{Name} Robot Occurred Error:Servo system error 13.", EventLevel.Alarm, EventType.EventUI_Notify));
  385. EV.Subscribe(new EventItem("Alarm", $"{Name}Error74D", $"{Name} Robot Occurred Error:Servo system error 14.", EventLevel.Alarm, EventType.EventUI_Notify));
  386. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7A0", $"{Name} Robot Occurred Error:Communication Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  387. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7A1", $"{Name} Robot Occurred Error:Communication Error(internal controller) 3-2.", EventLevel.Alarm, EventType.EventUI_Notify));
  388. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7A2", $"{Name} Robot Occurred Error:Command not supported 3-1.", EventLevel.Alarm, EventType.EventUI_Notify));
  389. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7A3", $"{Name} Robot Occurred Error:Data buffer full.", EventLevel.Alarm, EventType.EventUI_Notify));
  390. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7A4", $"{Name} Robot Occurred Error:Command not supported 3-2.", EventLevel.Alarm, EventType.EventUI_Notify));
  391. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7A5", $"{Name} Robot Occurred Error:Encoder data error 3-1.", EventLevel.Alarm, EventType.EventUI_Notify));
  392. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7A6", $"{Name} Robot Occurred Error:Command not supported 3-3.", EventLevel.Alarm, EventType.EventUI_Notify));
  393. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7AE", $"{Name} Robot Occurred Error:Communication Error(internal controller) 1-2.", EventLevel.Alarm, EventType.EventUI_Notify));
  394. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7AF", $"{Name} Robot Occurred Error:Communication Error(internal controller) 1-3.", EventLevel.Alarm, EventType.EventUI_Notify));
  395. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7B0", $"{Name} Robot Occurred Error:CCD sensor abnormal 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  396. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7B4", $"{Name} Robot Occurred Error:CCD sensor abnormal 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  397. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7B5", $"{Name} Robot Occurred Error:CCD sensor abnormal 3.", EventLevel.Alarm, EventType.EventUI_Notify));
  398. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7C0", $"{Name} Robot Occurred Error:PAIF board Failure 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  399. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7C1", $"{Name} Robot Occurred Error:PAIF board Failure 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  400. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7C2", $"{Name} Robot Occurred Error:PAIF board Failure 3.", EventLevel.Alarm, EventType.EventUI_Notify));
  401. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7C3", $"{Name} Robot Occurred Error:CCD sensor abnormal 4.", EventLevel.Alarm, EventType.EventUI_Notify));
  402. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7CF", $"{Name} Robot Occurred Error:PAIF board disconnected.", EventLevel.Alarm, EventType.EventUI_Notify));
  403. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7D0", $"{Name} Robot Occurred Error:PAIF board Failure 4.", EventLevel.Alarm, EventType.EventUI_Notify));
  404. EV.Subscribe(new EventItem("Alarm", $"{Name}Error7D1", $"{Name} Robot Occurred Error:PAIF board Failure 5.", EventLevel.Alarm, EventType.EventUI_Notify));
  405. EV.Subscribe(new EventItem("Alarm", $"{Name}Error900", $"{Name} Robot Occurred Error:Character Interval Timeout.", EventLevel.Alarm, EventType.EventUI_Notify));
  406. EV.Subscribe(new EventItem("Alarm", $"{Name}Error910", $"{Name} Robot Occurred Error:Received Data ChecksumError.", EventLevel.Alarm, EventType.EventUI_Notify));
  407. EV.Subscribe(new EventItem("Alarm", $"{Name}Error920", $"{Name} Robot Occurred Error:Unit Number Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  408. EV.Subscribe(new EventItem("Alarm", $"{Name}Error930", $"{Name} Robot Occurred Error:Undefined CommandReceived.", EventLevel.Alarm, EventType.EventUI_Notify));
  409. EV.Subscribe(new EventItem("Alarm", $"{Name}Error940", $"{Name} Robot Occurred Error:Message Parameter Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  410. EV.Subscribe(new EventItem("Alarm", $"{Name}Error950", $"{Name} Robot Occurred Error:Receiving Time-out Error for Confirmation of Execution Completion.", EventLevel.Alarm, EventType.EventUI_Notify));
  411. EV.Subscribe(new EventItem("Alarm", $"{Name}Error960", $"{Name} Robot Occurred Error:Incorrect sequence number.", EventLevel.Alarm, EventType.EventUI_Notify));
  412. EV.Subscribe(new EventItem("Alarm", $"{Name}Error961", $"{Name} Robot Occurred Error:Duplicated message.", EventLevel.Alarm, EventType.EventUI_Notify));
  413. EV.Subscribe(new EventItem("Alarm", $"{Name}Error970", $"{Name} Robot Occurred Error:Delimiter error.", EventLevel.Alarm, EventType.EventUI_Notify));
  414. EV.Subscribe(new EventItem("Alarm", $"{Name}Error9A1", $"{Name} Robot Occurred Error:Message buffer overflow.", EventLevel.Alarm, EventType.EventUI_Notify));
  415. EV.Subscribe(new EventItem("Alarm", $"{Name}Error9C0", $"{Name} Robot Occurred Error:LAN device setting error.", EventLevel.Alarm, EventType.EventUI_Notify));
  416. EV.Subscribe(new EventItem("Alarm", $"{Name}Error9C1", $"{Name} Robot Occurred Error:IP address error.", EventLevel.Alarm, EventType.EventUI_Notify));
  417. EV.Subscribe(new EventItem("Alarm", $"{Name}Error9C2", $"{Name} Robot Occurred Error:Subnet mask error.", EventLevel.Alarm, EventType.EventUI_Notify));
  418. EV.Subscribe(new EventItem("Alarm", $"{Name}Error9C3", $"{Name} Robot Occurred Error:Default gateway error.", EventLevel.Alarm, EventType.EventUI_Notify));
  419. EV.Subscribe(new EventItem("Alarm", $"{Name}Error9D0", $"{Name} Robot Occurred Error:Ethernet receive error.", EventLevel.Alarm, EventType.EventUI_Notify));
  420. EV.Subscribe(new EventItem("Alarm", $"{Name}Error9E0", $"{Name} Robot Occurred Error:During operation themaintenance tool.", EventLevel.Alarm, EventType.EventUI_Notify));
  421. EV.Subscribe(new EventItem("Alarm", $"{Name}Error9E1", $"{Name} Robot Occurred Error:The data abnormal.", EventLevel.Alarm, EventType.EventUI_Notify));
  422. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorA01", $"{Name} Robot Occurred Error:Re-detection of a powerSupply voltage fall.", EventLevel.Alarm, EventType.EventUI_Notify));
  423. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorA10", $"{Name} Robot Occurred Error:External emergency stop.", EventLevel.Alarm, EventType.EventUI_Notify));
  424. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorA20", $"{Name} Robot Occurred Error:T.P emergency stop.", EventLevel.Alarm, EventType.EventUI_Notify));
  425. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorA21", $"{Name} Robot Occurred Error:Interlock board failure 0.", EventLevel.Alarm, EventType.EventUI_Notify));
  426. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorA30", $"{Name} Robot Occurred Error:Emergency stop.", EventLevel.Alarm, EventType.EventUI_Notify));
  427. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorA40", $"{Name} Robot Occurred Error:Controller Fan 1 Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  428. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorA41", $"{Name} Robot Occurred Error:Controller Fan 2 Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  429. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorA42", $"{Name} Robot Occurred Error:Controller Fan 3 Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  430. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorA45", $"{Name} Robot Occurred Error:Unit fan 1 error.", EventLevel.Alarm, EventType.EventUI_Notify));
  431. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorA46", $"{Name} Robot Occurred Error:Unit fan 2 error.", EventLevel.Alarm, EventType.EventUI_Notify));
  432. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorA4F", $"{Name} Robot Occurred Error:Controller Battery Alarm.", EventLevel.Alarm, EventType.EventUI_Notify));
  433. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAC0", $"{Name} Robot Occurred Error:Safety fence signal detection.", EventLevel.Alarm, EventType.EventUI_Notify));
  434. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAC9", $"{Name} Robot Occurred Error:Protection stop signal.", EventLevel.Alarm, EventType.EventUI_Notify));
  435. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAE0", $"{Name} Robot Occurred Error:HOST Mode Switching error.", EventLevel.Alarm, EventType.EventUI_Notify));
  436. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAE1", $"{Name} Robot Occurred Error:TEACH Mode Switching Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  437. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAE8", $"{Name} Robot Occurred Error:Deadman switch error.", EventLevel.Alarm, EventType.EventUI_Notify));
  438. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAF0", $"{Name} Robot Occurred Error:Interlock board failure 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  439. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAF1", $"{Name} Robot Occurred Error:Interlock board failure 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  440. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAF2", $"{Name} Robot Occurred Error:Interlock board failure 3.", EventLevel.Alarm, EventType.EventUI_Notify));
  441. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAF3", $"{Name} Robot Occurred Error:Interlock board failure 4.", EventLevel.Alarm, EventType.EventUI_Notify));
  442. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAF4", $"{Name} Robot Occurred Error:Interlock board failure 5.", EventLevel.Alarm, EventType.EventUI_Notify));
  443. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAF5", $"{Name} Robot Occurred Error:Interlock board failure 6.", EventLevel.Alarm, EventType.EventUI_Notify));
  444. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAF6", $"{Name} Robot Occurred Error:Interlock board failure 7.", EventLevel.Alarm, EventType.EventUI_Notify));
  445. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAF8", $"{Name} Robot Occurred Error:Input compare error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  446. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAF9", $"{Name} Robot Occurred Error:Input compare error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  447. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAFA", $"{Name} Robot Occurred Error:Input compare error 3.", EventLevel.Alarm, EventType.EventUI_Notify));
  448. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAFB", $"{Name} Robot Occurred Error:Input compare error 4.", EventLevel.Alarm, EventType.EventUI_Notify));
  449. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAFC", $"{Name} Robot Occurred Error:Input compare error 5.", EventLevel.Alarm, EventType.EventUI_Notify));
  450. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAFD", $"{Name} Robot Occurred Error:Input compare error 6.", EventLevel.Alarm, EventType.EventUI_Notify));
  451. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAFE", $"{Name} Robot Occurred Error:Input compare error 7.", EventLevel.Alarm, EventType.EventUI_Notify));
  452. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorAFF", $"{Name} Robot Occurred Error:Input compare error 8.", EventLevel.Alarm, EventType.EventUI_Notify));
  453. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB10", $"{Name} Robot Occurred Error:Axis-1 Speed Limit Detection.", EventLevel.Alarm, EventType.EventUI_Notify));
  454. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB11", $"{Name} Robot Occurred Error:Axis-2 Speed Limit Detection.", EventLevel.Alarm, EventType.EventUI_Notify));
  455. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB12", $"{Name} Robot Occurred Error:Axis-3 Speed Limit Detection.", EventLevel.Alarm, EventType.EventUI_Notify));
  456. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB13", $"{Name} Robot Occurred Error:Axis-4 Speed Limit Detection.", EventLevel.Alarm, EventType.EventUI_Notify));
  457. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB14", $"{Name} Robot Occurred Error:Axis-5 Speed Limit Detection.", EventLevel.Alarm, EventType.EventUI_Notify));
  458. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB20", $"{Name} Robot Occurred Error:Axis-1 Positive (+) DirectionSoftware-limit Detection 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  459. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB21", $"{Name} Robot Occurred Error:Axis-2 Positive (+) DirectionSoftware-limit Detection 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  460. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB22", $"{Name} Robot Occurred Error:Axis-3 Positive (+) DirectionSoftware-limit Detection 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  461. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB23", $"{Name} Robot Occurred Error:Axis-4 Positive (+) DirectionSoftware-limit Detection 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  462. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB24", $"{Name} Robot Occurred Error:Axis-5 Positive (+) DirectionSoftware-limit Detection 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  463. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB28", $"{Name} Robot Occurred Error:Axis-1 Positive (+) Direction Software-limit Detection 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  464. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB29", $"{Name} Robot Occurred Error:Axis-2 Positive (+) DirectionSoftware-limit Detection 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  465. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB2A", $"{Name} Robot Occurred Error:Axis-3 Positive (+) DirectionSoftware-limit Detection 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  466. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB2B", $"{Name} Robot Occurred Error:Axis-4 Positive (+) DirectionSoftware-limit Detection 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  467. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB2C", $"{Name} Robot Occurred Error:Axis-5 Positive (+) DirectionSoftware-limit Detection 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  468. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB30", $"{Name} Robot Occurred Error:Axis-1 Negative (-) DirectionSoftware-limit Detection 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  469. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB31", $"{Name} Robot Occurred Error:Axis-2 Negative (-) DirectionSoftware-limit Detection 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  470. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB32", $"{Name} Robot Occurred Error:Axis-3 Negative (-) Direction Software-limit Detection 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  471. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB33", $"{Name} Robot Occurred Error:Axis-4 Negative (-) DirectionSoftware-limit Detection 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  472. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB34", $"{Name} Robot Occurred Error:Axis-5 Negative (-) DirectionSoftware-limit Detection 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  473. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB38", $"{Name} Robot Occurred Error:Axis-1 Negative (-) DirectionSoftware-limit Detection 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  474. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB39", $"{Name} Robot Occurred Error:Axis-2 Negative (-) DirectionSoftware-limit Detection 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  475. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB3A", $"{Name} Robot Occurred Error:Axis-3 Negative (-) Direction Software-limit Detection 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  476. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB3B", $"{Name} Robot Occurred Error:Axis-4 Negative (-) DirectionSoftware-limit Detection 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  477. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB3C", $"{Name} Robot Occurred Error:Axis-5 Negative (-) DirectionSoftware-limit Detection 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  478. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB40", $"{Name} Robot Occurred Error:Access Permission Signal 1Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  479. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB41", $"{Name} Robot Occurred Error:Access Permission Signal 2Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  480. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB42", $"{Name} Robot Occurred Error:Access Permission Signal 3Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  481. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB43", $"{Name} Robot Occurred Error:Access Permission Signal 4Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  482. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB44", $"{Name} Robot Occurred Error:Access Permission Signal 5 Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  483. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB45", $"{Name} Robot Occurred Error:Access Permission Signal 6Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  484. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB46", $"{Name} Robot Occurred Error:Access Permission Signal 7Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  485. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB47", $"{Name} Robot Occurred Error:Access Permission Signal 8Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  486. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB48", $"{Name} Robot Occurred Error:Access Permission Signal 9Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  487. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB49", $"{Name} Robot Occurred Error:Access Permission Signal 10 Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  488. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB4A", $"{Name} Robot Occurred Error:Access Permission Signal 11Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  489. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB4B", $"{Name} Robot Occurred Error:Access Permission Signal 12Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  490. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB4C", $"{Name} Robot Occurred Error:Access Permission Signal 13Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  491. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB4D", $"{Name} Robot Occurred Error:Access Permission Signal 14Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  492. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB4E", $"{Name} Robot Occurred Error:Access Permission Signal 15Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  493. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB4F", $"{Name} Robot Occurred Error:Access Permission Signal 16Time-out Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  494. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB60", $"{Name} Robot Occurred Error:Access Permission to P/A Stage Time-out Error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  495. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB61", $"{Name} Robot Occurred Error:Access Permission to P/AStage Time-out Error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  496. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB62", $"{Name} Robot Occurred Error:Access Permission to P/A Stage Time-out Error 3.", EventLevel.Alarm, EventType.EventUI_Notify));
  497. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB63", $"{Name} Robot Occurred Error:Access Permission to P/A Stage Time-out Error 4.", EventLevel.Alarm, EventType.EventUI_Notify));
  498. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB64", $"{Name} Robot Occurred Error:Access Permission to P/AStage Time-out Error 5.", EventLevel.Alarm, EventType.EventUI_Notify));
  499. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB65", $"{Name} Robot Occurred Error:Access Permission to P/AStage Time-out Error 6.", EventLevel.Alarm, EventType.EventUI_Notify));
  500. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB66", $"{Name} Robot Occurred Error:Access Permission to P/AStage Time-out Error 7.", EventLevel.Alarm, EventType.EventUI_Notify));
  501. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB68", $"{Name} Robot Occurred Error:P/A motion permission timeout error.", EventLevel.Alarm, EventType.EventUI_Notify));
  502. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB70", $"{Name} Robot Occurred Error:SS signal detection.", EventLevel.Alarm, EventType.EventUI_Notify));
  503. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB80", $"{Name} Robot Occurred Error:Fork 1/Pre-aligner: Wafer Presence Confirmation Time-out Error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  504. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB81", $"{Name} Robot Occurred Error:Fork 1/Pre-aligner: WaferAbsence Confirmation Time- out Error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  505. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB82", $"{Name} Robot Occurred Error:Fork 1/Pre-aligner: Wafer Presence Confirmation Time-out Error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  506. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB83", $"{Name} Robot Occurred Error:Fork 1/Pre-aligner: WaferAbsence Confirmation Time- out Error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  507. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB88", $"{Name} Robot Occurred Error:Grip sensor Time-out Error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  508. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB89", $"{Name} Robot Occurred Error:Grip sensor Time-out Error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  509. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB8A", $"{Name} Robot Occurred Error:UnGrip sensor Time-out Error1.", EventLevel.Alarm, EventType.EventUI_Notify));
  510. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB8B", $"{Name} Robot Occurred Error:UnGrip sensor Time-out Error2.", EventLevel.Alarm, EventType.EventUI_Notify));
  511. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB8F", $"{Name} Robot Occurred Error:Fork 1: Plunger non-operationerror.", EventLevel.Alarm, EventType.EventUI_Notify));
  512. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB90", $"{Name} Robot Occurred Error:Fork 2: Wafer Presence Confirmation Time-out Error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  513. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB91", $"{Name} Robot Occurred Error:Fork 2: Wafer AbsenceConfirmation Time-out Error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  514. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB92", $"{Name} Robot Occurred Error:Fork 2: Wafer PresenceConfirmation Time-out Error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  515. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB93", $"{Name} Robot Occurred Error:Fork 2: Wafer AbsenceConfirmation Time-out Error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  516. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB98", $"{Name} Robot Occurred Error:Lifter up sensor Time-outError 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  517. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB99", $"{Name} Robot Occurred Error:Lifter up sensor Time-out Error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  518. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB9A", $"{Name} Robot Occurred Error:Lifter down sensor Time-outError 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  519. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB9B", $"{Name} Robot Occurred Error:Lifter down sensor Time-outError 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  520. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorB9F", $"{Name} Robot Occurred Error:Fork 2: Plunger non-operationerror.", EventLevel.Alarm, EventType.EventUI_Notify));
  521. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorBA0", $"{Name} Robot Occurred Error:Fork 1/Pre-aligner: WaferAbsence Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  522. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorBA1", $"{Name} Robot Occurred Error:Fork 1: Sensor StatusMismatch.", EventLevel.Alarm, EventType.EventUI_Notify));
  523. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorBA8", $"{Name} Robot Occurred Error:Grip sensor status Error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  524. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorBA9", $"{Name} Robot Occurred Error:Grip sensor status Error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  525. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorBAA", $"{Name} Robot Occurred Error:Ungrip sensor status Error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  526. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorBAB", $"{Name} Robot Occurred Error:Ungrip sensor status Error 2.", EventLevel.Alarm, EventType.EventUI_Notify));
  527. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorBAC", $"{Name} Robot Occurred Error:Grip sensor status mismatch.", EventLevel.Alarm, EventType.EventUI_Notify));
  528. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorBAD", $"{Name} Robot Occurred Error:Lifter/Grip sensor statusmismatch.", EventLevel.Alarm, EventType.EventUI_Notify));
  529. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorBB0", $"{Name} Robot Occurred Error:Fork 2: Wafer Absence Error.", EventLevel.Alarm, EventType.EventUI_Notify));
  530. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorBB1", $"{Name} Robot Occurred Error:Fork 2: Sensor StatusMismatch.", EventLevel.Alarm, EventType.EventUI_Notify));
  531. EV.Subscribe(new EventItem("Alarm", $"{Name}ErrorBB8", $"{Name} Robot Occurred Error:Lifter up sensor status Error 1.", EventLevel.Alarm, EventType.EventUI_Notify));
  532. }
  533. public void NotifyAlarmByErrorCode(string errorcode)
  534. {
  535. EV.Notify($"{Name}Error{errorcode}");
  536. }
  537. private void _diTPinUse_OnSignalChanged(IoSensor arg1, bool arg2)
  538. {
  539. SetMaintenanceMode(!arg1.Value);
  540. }
  541. private void _diRobotError_OnSignalChanged(IoSensor arg1, bool arg2)
  542. {
  543. if (arg1.Value == false)
  544. {
  545. lock (_locker)
  546. {
  547. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RSTS"));
  548. }
  549. OnError("RobotError");
  550. }
  551. }
  552. private void ResetPropertiesAndResponses()
  553. {
  554. }
  555. private void RegisterSpecialData()
  556. {
  557. DATA.Subscribe($"{Module}.{Name}.CurrentArm1Position", () => CurrentArm1Position);
  558. DATA.Subscribe($"{Module}.{Name}.CurrentArm2Position", () => CurrentArm2Position);
  559. DATA.Subscribe($"{Module}.{Name}.CurrentExtensionPosition", () => CurrentExtensionPosition);
  560. DATA.Subscribe($"{Module}.{Name}.CurrentThetaPosition", () => CurrentThetaPosition);
  561. DATA.Subscribe($"{Module}.{Name}.CurrentZPosition", () => CurrentZPosition);
  562. DATA.Subscribe($"{Module}.{Name}.IsManipulatorBatteryLow", () => IsManipulatorBatteryLow);
  563. DATA.Subscribe($"{Module}.{Name}.IsCommandExecutionReady", () => IsCommandExecutionReady);
  564. DATA.Subscribe($"{Module}.{Name}.IsServoON", () => IsServoON);
  565. DATA.Subscribe($"{Module}.{Name}.IsErrorOccurred", () => IsErrorOccurred);
  566. DATA.Subscribe($"{Module}.{Name}.IsControllerBatteryLow", () => IsControllerBatteryLow);
  567. DATA.Subscribe($"{Module}.{Name}.IsWaferPresenceOnBlade1", () => IsWaferPresenceOnBlade1);
  568. DATA.Subscribe($"{Module}.{Name}.IsWaferPresenceOnBlade2", () => IsWaferPresenceOnBlade2);
  569. DATA.Subscribe($"{Module}.{Name}.ErrorCode", () => ErrorCode);
  570. DATA.Subscribe($"{Module}.{Name}.IsGrippedBlade1", () => IsGrippedBlade1);
  571. DATA.Subscribe($"{Module}.{Name}.IsGrippedBlade2", () => IsGrippedBlade2);
  572. DATA.Subscribe($"{Module}.{Name}.IsPermittedInterlock1", () => IsPermittedInterlock1);
  573. DATA.Subscribe($"{Module}.{Name}.IsPermittedInterlock2", () => IsPermittedInterlock2);
  574. DATA.Subscribe($"{Module}.{Name}.IsPermittedInterlock3", () => IsPermittedInterlock3);
  575. DATA.Subscribe($"{Module}.{Name}.IsPermittedInterlock4", () => IsPermittedInterlock4);
  576. DATA.Subscribe($"{Module}.{Name}.IsPermittedInterlock5", () => IsPermittedInterlock5);
  577. DATA.Subscribe($"{Module}.{Name}.IsPermittedInterlock6", () => IsPermittedInterlock6);
  578. DATA.Subscribe($"{Module}.{Name}.IsPermittedInterlock7", () => IsPermittedInterlock7);
  579. DATA.Subscribe($"{Module}.{Name}.IsPermittedInterlock8", () => IsPermittedInterlock8);
  580. DATA.Subscribe($"{Module}.{Name}.IsCheckInterlockWaferPresenceOnBlade1", () => IsCheckInterlockWaferPresenceOnBlade1);
  581. DATA.Subscribe($"{Module}.{Name}.IsCheckInterlockWaferPresenceOnBlade2", () => IsCheckInterlockWaferPresenceOnBlade2);
  582. DATA.Subscribe($"{Module}.{Name}.IsCheckInterlockPAOp", () => IsCheckInterlockPAOp);
  583. DATA.Subscribe($"{Module}.{Name}.IsCheckInterlockPAWaferStatus", () => IsCheckInterlockPAWaferStatus);
  584. DATA.Subscribe($"{Module}.{Name}.IsCheckInterlockPAWaferStatusByCCD", () => IsCheckInterlockPAWaferStatusByCCD);
  585. DATA.Subscribe($"{Module}.{Name}.RobotSpeed", () => SpeedLevelSetting.ToString());
  586. DATA.Subscribe($"{Name}.RobotSpeed", () =>
  587. {
  588. if (SpeedLevelSetting == 1) return "Fast";
  589. if (SpeedLevelSetting == 2) return "Medium";
  590. if (SpeedLevelSetting == 3) return "Slow";
  591. return SpeedLevelSetting.ToString();
  592. });
  593. OP.Subscribe("SetSpeed", InvokeSetSpeed);
  594. }
  595. private bool OnTimer()
  596. {
  597. try
  598. {
  599. if (!_connection.IsConnected || _connection.IsCommunicationError)
  600. {
  601. lock (_locker)
  602. {
  603. _lstHandlers.Clear();
  604. }
  605. _trigRetryConnect.CLK = !_connection.IsConnected;
  606. if (_trigRetryConnect.Q)
  607. {
  608. if (!_connection.Connect())
  609. {
  610. EV.PostAlarmLog(Module, $"Can not connect with {_connection.Address}, {Module}.{Name}");
  611. }
  612. else
  613. {
  614. //_lstHandler.AddLast(new RobotHirataR4QueryPinHandler(this, _deviceAddress));
  615. //_lstHandler.AddLast(new RobotHirataR4SetCommModeHandler(this, _deviceAddress, EnumRfPowerCommunicationMode.Host));
  616. }
  617. }
  618. return true;
  619. }
  620. HandlerBase handler = null;
  621. lock (_locker)
  622. {
  623. if (!_connection.IsBusy)
  624. {
  625. if (_lstHandlers.Count > 0)
  626. {
  627. handler = _lstHandlers.First.Value;
  628. ExecuteHandler(handler);
  629. _lstHandlers.RemoveFirst();
  630. }
  631. }
  632. else
  633. {
  634. _connection.MonitorTimeout();
  635. _trigCommunicationError.CLK = _connection.IsCommunicationError;
  636. if (_trigCommunicationError.Q)
  637. {
  638. _lstHandlers.Clear();
  639. //EV.PostAlarmLog(Module, $"{Module}.{Name} communication error, {_connection.LastCommunicationError}");
  640. OnError($"{Module}.{Name} communication error, {_connection.LastCommunicationError}");
  641. //_trigActionDone.CLK = true;
  642. }
  643. }
  644. }
  645. }
  646. catch (Exception ex)
  647. {
  648. LOG.Write(ex);
  649. }
  650. return true;
  651. }
  652. public bool Connect()
  653. {
  654. return _connection.Connect();
  655. }
  656. public bool Disconnect()
  657. {
  658. return _connection.Disconnect();
  659. }
  660. public override bool IsReady()
  661. {
  662. //if (_diRobotReady!=null && !_diRobotReady.Value)
  663. // return false;
  664. if (_diRobotError != null && !_diRobotError.Value)
  665. return false;
  666. if (_diTPinUse != null && !_diTPinUse.Value)
  667. return false;
  668. return RobotState == RobotStateEnum.Idle && !IsBusy;
  669. }
  670. public bool ParseReadData(string _command, string[] rdata)
  671. {
  672. try
  673. {
  674. if (_command == "RSTS")
  675. {
  676. return (rdata.Length == 2 && ParseRSTSStatus(rdata));
  677. }
  678. if (_command == "RSLV") //Read the speed level
  679. {
  680. return (rdata.Length == 1 && ParseSpeedLevel(rdata[0]));
  681. }
  682. if (_command == "RPOS") //Reference current postion
  683. {
  684. return (rdata.Length > 1 && ParsePositionData(rdata));
  685. }
  686. if (_command == "RSTP") //Reference registered position, read the save postion for station
  687. {
  688. return (rdata.Length > 6 && ParseRegisteredPositionData(rdata));
  689. }
  690. if (_command == "RSTR") //Reference station item value
  691. {
  692. return (rdata.Length == 4 && ParseStationData(rdata));
  693. }
  694. if (_command == "RPRM") //Reference the parameter values of the specified unit
  695. {
  696. return (rdata.Length == 3 && ParseParameterData(rdata));
  697. }
  698. if (_command == "RMSK") //Reference the interlock information
  699. {
  700. return (rdata.Length == 1 && ParseInterlockInfo(rdata));
  701. }
  702. if (_command == "RVER") //Reference the software version
  703. {
  704. return (rdata.Length == 2 && ParseSoftwareVersion(rdata));
  705. }
  706. if (_command == "RMAP") //Reference the slot map
  707. {
  708. return (rdata.Length > 2 && ParseSlotMap(rdata));
  709. }
  710. if (_command == "RMPD") //reference the mapping data
  711. {
  712. return (rdata.Length > 1 && ParseMappingData(rdata));
  713. }
  714. if (_command == "RMCA") // Reference the mapping calibration result
  715. {
  716. return (rdata.Length > 1 && ParseMappingCalibrationResult(rdata));
  717. }
  718. if (_command == "RALN") // Reference the alignment result
  719. {
  720. return true;
  721. }
  722. if (_command == "RACA") // Reference calibration result for alignment
  723. {
  724. return true;
  725. }
  726. return true;
  727. }
  728. catch (Exception ex)
  729. {
  730. LOG.Write(ex);
  731. return true;
  732. }
  733. }
  734. public bool ParseStatus(string status)
  735. {
  736. try
  737. {
  738. int intstatus = Convert.ToInt32(status, 16);
  739. IsManipulatorBatteryLow = ((intstatus & 0x10) == 0x10);
  740. IsCommandExecutionReady = ((intstatus & 0x20) == 0x20);
  741. IsServoON = ((intstatus & 0x40) == 0x40);
  742. IsErrorOccurred = ((intstatus & 0x80) == 0x80);
  743. IsControllerBatteryLow = ((intstatus & 0x1) == 0x1);
  744. IsWaferPresenceOnBlade1 = ((intstatus & 0x2) == 0x2);
  745. IsWaferPresenceOnBlade2 = ((intstatus & 0x4) == 0x4);
  746. return true;
  747. }
  748. catch (Exception ex)
  749. {
  750. LOG.Write(ex);
  751. return false;
  752. }
  753. }
  754. public bool ParseRSTSStatus(string[] status)
  755. {
  756. try
  757. {
  758. ErrorCode = status[0];
  759. int intstatus = Convert.ToInt32(status[1], 16);
  760. IsWaferPresenceOnBlade1 = ((intstatus & 0x1000) == 0x1000);
  761. IsWaferPresenceOnBlade2 = ((intstatus & 0x2000) == 0x2000);
  762. IsGrippedBlade1 = ((intstatus & 0x4000) == 0x4000);
  763. IsGrippedBlade2 = ((intstatus & 0x8000) == 0x8000);
  764. IsPermittedInterlock1 = ((intstatus & 0x100) == 0x100);
  765. IsPermittedInterlock2 = ((intstatus & 0x200) == 0x200);
  766. IsPermittedInterlock3 = ((intstatus & 0x400) == 0x400);
  767. IsPermittedInterlock4 = ((intstatus & 0x800) == 0x800);
  768. IsPermittedInterlock5 = ((intstatus & 0x10) == 0x10);
  769. IsPermittedInterlock6 = ((intstatus & 0x20) == 0x20);
  770. IsPermittedInterlock7 = ((intstatus & 0x40) == 0x40);
  771. IsPermittedInterlock8 = ((intstatus & 0x80) == 0x80);
  772. return true;
  773. }
  774. catch (Exception ex)
  775. {
  776. LOG.Write(ex);
  777. return true;
  778. }
  779. }
  780. public bool ParseSpeedLevel(string speedlevel)
  781. {
  782. try
  783. {
  784. int level = Convert.ToInt32(speedlevel);
  785. if (level < 1 || level > 3) return false;
  786. SpeedLevel = level;
  787. return true;
  788. }
  789. catch (Exception ex)
  790. {
  791. LOG.Write(ex);
  792. return false;
  793. }
  794. }
  795. public bool ParsePositionData(string[] pdata)
  796. {
  797. try
  798. {
  799. if (pdata[0] == "R")
  800. {
  801. CommandThetaPosition = Convert.ToSingle(pdata[1]) / 1000;
  802. CommandExtensionPosition = Convert.ToSingle(pdata[2]) / 1000;
  803. CommandArm1Position = Convert.ToSingle(pdata[3]) / 1000;
  804. CommandArm2Position = Convert.ToSingle(pdata[4]) / 1000;
  805. CommandZPosition = Convert.ToSingle(pdata[5]) / 1000;
  806. return true;
  807. }
  808. if (pdata[0] == "F")
  809. {
  810. CurrentThetaPosition = Convert.ToSingle(pdata[1]) / 1000;
  811. PositionAxis1 = CurrentThetaPosition;
  812. CurrentExtensionPosition = Convert.ToSingle(pdata[2]) / 1000;
  813. PositionAxis2 = CurrentExtensionPosition;
  814. CurrentArm1Position = Convert.ToSingle(pdata[3]) / 1000;
  815. PositionAxis3 = CurrentArm1Position;
  816. CurrentArm2Position = Convert.ToSingle(pdata[4]) / 1000;
  817. PositionAxis4 = CurrentArm2Position;
  818. CurrentZPosition = Convert.ToSingle(pdata[5]) / 1000;
  819. PositionAxis5 = CurrentZPosition;
  820. return true;
  821. }
  822. return false;
  823. }
  824. catch (Exception ex)
  825. {
  826. LOG.Write(ex);
  827. return false;
  828. }
  829. }
  830. public bool ParseRegisteredPositionData(string[] pdata)
  831. {
  832. try
  833. {
  834. ReadMemorySpec = pdata[0];
  835. ReadTransferStation = pdata[1];
  836. ReadSlotNumber = Convert.ToInt16(pdata[2]);
  837. ReadArmPosture = pdata[3];
  838. ReadBladeNo = (RobotArmEnum)(Convert.ToInt16(pdata[4]) - 1);
  839. if (pdata[5] == "S")
  840. ReadPositionType = YaskawaPositonEnum.RegisteredPosition;
  841. if (pdata[5] == "R")
  842. ReadPositionType = YaskawaPositonEnum.ReadyPosition;
  843. if (pdata[5] == "M")
  844. ReadPositionType = YaskawaPositonEnum.IntermediatePosition;
  845. if (pdata[5] == "B")
  846. ReadPositionType = YaskawaPositonEnum.MappingStartPosition;
  847. if (pdata[5] == "E")
  848. ReadPositionType = YaskawaPositonEnum.MappingFinishPosition;
  849. return true;
  850. }
  851. catch (Exception ex)
  852. {
  853. LOG.Write(ex);
  854. return false;
  855. }
  856. }
  857. public bool ParseStationData(string[] pdata)
  858. {
  859. try
  860. {
  861. ReadMemorySpec = pdata[0];
  862. ReadTransferStation = pdata[1];
  863. if (ReadStationItemValues.ContainsKey(pdata[2]))
  864. ReadStationItemValues.Remove(pdata[2]);
  865. ReadStationItemValues.Add(pdata[2], pdata[3]);
  866. return true;
  867. }
  868. catch (Exception ex)
  869. {
  870. LOG.Write(ex);
  871. return false;
  872. }
  873. }
  874. public bool ParseParameterData(string[] pdata)
  875. {
  876. try
  877. {
  878. ReadParameterType = pdata[0];
  879. ReadParameterNo = pdata[1];
  880. ReadParameterValue = pdata[2];
  881. return true;
  882. }
  883. catch (Exception ex)
  884. {
  885. LOG.Write(ex);
  886. return false;
  887. }
  888. }
  889. public bool ParseInterlockInfo(string[] pdata)
  890. {
  891. try
  892. {
  893. string vdata = pdata[0];
  894. int valid1 = Convert.ToInt16(vdata[0].ToString());
  895. int valid2 = Convert.ToInt16(vdata[1].ToString());
  896. int valid3 = Convert.ToInt16(vdata[2].ToString());
  897. int valid4 = Convert.ToInt16(vdata[3].ToString());
  898. IsCheckInterlockWaferPresenceOnBlade1 = (valid1 & 0x1) == 0x0;
  899. IsCheckInterlockWaferPresenceOnBlade2 = (valid1 & 0x2) == 0x0;
  900. IsCheckInterlockPAOp = (valid2 & 0x1) == 0x0;
  901. IsCheckInterlockPAWaferStatus = (valid2 & 0x2) == 0x0;
  902. IsCheckInterlockPAWaferStatusByCCD = (valid2 & 0x4) == 0x0;
  903. return true;
  904. }
  905. catch (Exception ex)
  906. {
  907. LOG.Write(ex);
  908. return false;
  909. }
  910. }
  911. public bool ParseSoftwareVersion(string[] pdata)
  912. {
  913. try
  914. {
  915. RobotSystemVersion = pdata[0];
  916. RobotSoftwareVersion = pdata[1];
  917. return true;
  918. }
  919. catch (Exception ex)
  920. {
  921. LOG.Write(ex);
  922. return false;
  923. }
  924. }
  925. public bool ParseSlotMap(string[] pdata)
  926. {
  927. //$,<UNo>(,<SeqNo>),<Sts>,<Ackcd>,RMAP,<TrsSt>,<Slot>,
  928. //01:<Result1>…,N:<ResultN>(,<Sum>)<CR>
  929. //• UNo : Unit number (1 byte)
  930. //• SeqNo : Sequence number (None / 2 bytes)
  931. //• Sts : Status (2 bytes)
  932. //• Ackcd : Response code (4 bytes)
  933. //• TrsSt : Transfer station (3 bytes)
  934. //• Slot : Slot number (2 bytes)
  935. //• Result* : Mapping result (2 bytes each)
  936. //• “--” : No wafer detected.
  937. //• “OK” : Wafer inserted correctly.
  938. //• “CW” : Wafer inserted incorrectly (inclined).
  939. //• “DW” : Wafer inserted incorrectly (duplicated).
  940. //Note) Responds with the number of slots of the specified transfer station.
  941. //$,1,00,0000,RMAP,C02,00,
  942. //01:OK,02:DW,03:OK,04:CW,05:CW,06:OK,07:OK,08:--,09:OK,10:OK
  943. // No wafer: "0", Wafer: "1", Crossed:"2", Undefined: "?", Overlapping wafers: "W"
  944. try
  945. {
  946. ReadMappingTransferStation = pdata[0];
  947. ReadMappingSlotNumbers = Convert.ToInt16(pdata[1]);
  948. StringBuilder sb = new StringBuilder();
  949. for (int i = 2; i < pdata.Length; i++)
  950. {
  951. string value = pdata[i].Substring(3);
  952. switch (value)
  953. {
  954. case "--":
  955. sb.Append("0");
  956. break;
  957. case "OK":
  958. sb.Append("1");
  959. break;
  960. case "CW":
  961. sb.Append("2");
  962. break;
  963. case "DW":
  964. sb.Append("W");
  965. break;
  966. }
  967. }
  968. ReadSlotMap = sb.ToString();
  969. NotifySlotMapResult(CurrentInteractiveModule, ReadSlotMap);
  970. return true;
  971. }
  972. catch (Exception ex)
  973. {
  974. LOG.Write(ex);
  975. return false;
  976. }
  977. }
  978. public bool ParseMappingData(string[] pdata)
  979. {
  980. try
  981. {
  982. ReadMappingTransferStation = pdata[0];
  983. List<string> lstupdata = new List<string>();
  984. List<string> lstdowndata = new List<string>();
  985. for (int i = 0; i < (pdata.Length - 1) / 2; i++)
  986. {
  987. lstupdata.Add(pdata[2 * i + 1].Remove(0, 3));
  988. lstdowndata.Add(pdata[2 * i + 2]);
  989. }
  990. ReadMappingDownData = lstdowndata.ToArray();
  991. ReadMappingUpData = lstupdata.ToArray();
  992. return true;
  993. }
  994. catch (Exception ex)
  995. {
  996. LOG.Write(ex);
  997. return false;
  998. }
  999. }
  1000. public bool ParseMappingCalibrationResult(string[] pdata)
  1001. {
  1002. try
  1003. {
  1004. ReadMappingTransferStation = pdata[0];
  1005. ReadMappingCalibrationResult.Clear();
  1006. ReadMappingCalibrationResult.Add("LowestLaySlotPosition", Convert.ToInt32(pdata[1]) / 1000);
  1007. ReadMappingCalibrationResult.Add("HighestLaySlotPosition", Convert.ToInt32(pdata[2]) / 1000);
  1008. ReadMappingCalibrationResult.Add("WaferWidth", Convert.ToInt32(pdata[3]) / 1000);
  1009. ReadMappingCalibrationResult.Add("ThreshhholdValueofDoubleInsertion", Convert.ToInt32(pdata[4]) / 1000);
  1010. ReadMappingCalibrationResult.Add("ThreshhholdValueofSlantingInsertion1", Convert.ToInt32(pdata[5]) / 1000);
  1011. ReadMappingCalibrationResult.Add("ThreshhholdValueofSlantingInsertion2", Convert.ToInt32(pdata[6]) / 1000);
  1012. return true;
  1013. }
  1014. catch (Exception ex)
  1015. {
  1016. LOG.Write(ex);
  1017. return false;
  1018. }
  1019. }
  1020. protected override bool fClear(object[] param)
  1021. {
  1022. lock (_locker)
  1023. {
  1024. _lstHandlers.Clear();
  1025. _connection.ForceClear();
  1026. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CCLR", "E"));
  1027. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RSTS"));
  1028. }
  1029. return true;
  1030. }
  1031. protected override bool fStartReadData(object[] param)
  1032. {
  1033. if (param.Length < 1) return false;
  1034. string readcommand = param[0].ToString();
  1035. switch (readcommand)
  1036. {
  1037. case "CurrentStatus":
  1038. lock (_locker)
  1039. {
  1040. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RSTS"));
  1041. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RPOS", "F"));
  1042. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RPOS", "R"));
  1043. }
  1044. break;
  1045. default:
  1046. break;
  1047. }
  1048. return true;
  1049. }
  1050. protected void ExecuteHandler(HandlerBase handler)
  1051. {
  1052. string commandstr = $",{UnitNumber}";
  1053. if (IsEnableSeqNo)
  1054. {
  1055. CurrentSeqNo = SeqnoGenerator.create();
  1056. commandstr += $",{CurrentSeqNo:D2}";
  1057. SeqnoGenerator.release(CurrentSeqNo);
  1058. }
  1059. commandstr += $",{handler.SendText}";
  1060. if (IsEnableCheckSum)
  1061. {
  1062. commandstr += ",";
  1063. commandstr += Checksum(Encoding.ASCII.GetBytes(commandstr));
  1064. }
  1065. handler.SendText = $"${commandstr}\r";
  1066. _connection.Execute(handler);
  1067. }
  1068. private string Checksum(byte[] bytes)
  1069. {
  1070. int sum = 0;
  1071. foreach (byte code in bytes)
  1072. {
  1073. sum += code;
  1074. }
  1075. string hex = String.Format("{0:X2}", sum % 256);
  1076. return hex;
  1077. }
  1078. protected override bool fStartSetParameters(object[] param)
  1079. {
  1080. try
  1081. {
  1082. string strParameter;
  1083. string setcommand = param[0].ToString();
  1084. _setParameter = setcommand;
  1085. switch (setcommand)
  1086. {
  1087. case "MotionSpeed": // SSPD Set the motion speed
  1088. string strlevel = param[1].ToString();
  1089. string strspeedtype = param[2].ToString();
  1090. string strAxis = param[3].ToString();
  1091. uint speeddata = Convert.ToUInt32(param[4]);
  1092. if (!"0123".Contains(strlevel))
  1093. {
  1094. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + strlevel);
  1095. return false;
  1096. }
  1097. if (!"HMLOB".Contains(strspeedtype))
  1098. {
  1099. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + strspeedtype);
  1100. return false;
  1101. }
  1102. if (!"SAHIZRG".Contains(strAxis))
  1103. {
  1104. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + strAxis);
  1105. return false;
  1106. }
  1107. strParameter = $"{strlevel},{strspeedtype},{strAxis}," + speeddata.ToString("D8");
  1108. lock (_locker)
  1109. {
  1110. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", strParameter));
  1111. }
  1112. break;
  1113. case "TransferSpeedLevel": //SSLV Select the transfer speed level
  1114. string sslvlevel = param[1].ToString();
  1115. if (!"123".Contains(sslvlevel))
  1116. {
  1117. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + sslvlevel);
  1118. return false;
  1119. }
  1120. lock (_locker)
  1121. {
  1122. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSLV", sslvlevel));
  1123. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,H,G,%{(_workSpeedRatio * 10).ToString("D7")}"));
  1124. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,M,G,%{(_workSpeedRatio * 10).ToString("D7")}"));
  1125. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,L,G,%{(_workSpeedRatio * 10).ToString("D7")}"));
  1126. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,O,G,%{(_workSpeedRatio * 10).ToString("D7")}"));
  1127. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,B,G,%{(_workSpeedRatio * 10).ToString("D7")}"));
  1128. }
  1129. if (SC.ContainsItem($"{_scRoot}.{Name}.SpeedLevel"))
  1130. {
  1131. SC.SetItemValue($"{_scRoot}.{Name}.SpeedLevel", Convert.ToInt32(sslvlevel));
  1132. }
  1133. break;
  1134. case "RegisterTheCurrentPositionAsTransferStation": // SPOS: Register the current position as the specified transfer station
  1135. string sposMem = param[1].ToString();
  1136. string sposRmode = param[2].ToString();
  1137. string sposTrsSt = param[3].ToString();
  1138. uint sposSlot = Convert.ToUInt16(param[4]);
  1139. string sposPosture = param[5].ToString();
  1140. string sposHand = param[6].ToString();
  1141. if (!"VN".Contains(sposMem))
  1142. {
  1143. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + sposMem);
  1144. return false;
  1145. }
  1146. if (!"AN".Contains(sposRmode))
  1147. {
  1148. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + sposRmode);
  1149. return false;
  1150. }
  1151. if (sposSlot < 1 || sposSlot > 30)
  1152. {
  1153. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + sposSlot.ToString());
  1154. return false;
  1155. }
  1156. if (!"LR".Contains(sposPosture))
  1157. {
  1158. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + sposPosture);
  1159. return false;
  1160. }
  1161. if (!"12".Contains(sposHand))
  1162. {
  1163. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + sposHand);
  1164. return false;
  1165. }
  1166. strParameter = $"{sposMem},{sposRmode},{sposTrsSt},{sposSlot},{sposPosture},{sposHand}";
  1167. lock (_locker)
  1168. {
  1169. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SPOS", strParameter));
  1170. }
  1171. break;
  1172. case "RegisterTheSpePostionAsTransferStation": //SABS
  1173. string sabsMem = param[1].ToString();
  1174. string sabsRmode = param[2].ToString();
  1175. string sabsTrsSt = param[3].ToString();
  1176. string sabsPosture = param[4].ToString();
  1177. string sabsHand = param[5].ToString();
  1178. Int32 sabsValue1 = Convert.ToInt32(param[6]);
  1179. Int32 sabsValue2 = Convert.ToInt32(param[7]);
  1180. Int32 sabsValue3 = Convert.ToInt32(param[8]);
  1181. Int32 sabsValue4 = Convert.ToInt32(param[9]);
  1182. Int32 sabsValue5 = Convert.ToInt32(param[10]);
  1183. if (!"VN".Contains(sabsMem))
  1184. {
  1185. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + sabsMem);
  1186. return false;
  1187. }
  1188. if (!"AN".Contains(sabsRmode))
  1189. {
  1190. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + sabsRmode);
  1191. return false;
  1192. }
  1193. if (!"LR".Contains(sabsPosture))
  1194. {
  1195. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + sabsPosture);
  1196. return false;
  1197. }
  1198. if (!"12".Contains(sabsHand))
  1199. {
  1200. EV.PostAlarmLog(Name, $"Set {setcommand} with invalid parameter:" + sabsHand);
  1201. return false;
  1202. }
  1203. strParameter = $"{sabsMem},{sabsRmode},{sabsTrsSt},{sabsPosture},{sabsHand},"
  1204. + sabsValue1.ToString("D8") + "," + sabsValue2.ToString("D8") + "," + sabsValue3.ToString("D8") +
  1205. "," + sabsValue4.ToString("D8") + "," + sabsValue5.ToString("D8");
  1206. lock (_locker)
  1207. {
  1208. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SABS", strParameter));
  1209. }
  1210. break;
  1211. case "ModifyTheSpecStationPostionByOffset": //SAPS
  1212. string sapsMem = param[1].ToString();
  1213. string sapsRmode = param[2].ToString();
  1214. string sapsTrsSt = param[3].ToString();
  1215. string sapsPosture = param[4].ToString();
  1216. string sapsHand = param[5].ToString();
  1217. Int32 sapsOffsetX = Convert.ToInt32(param[6]);
  1218. Int32 sapsOffsetY = Convert.ToInt32(param[7]);
  1219. Int32 sapsOffsetZ = Convert.ToInt32(param[8]);
  1220. strParameter = $"{sapsMem},{sapsRmode},{sapsTrsSt},{sapsPosture},{sapsHand},"
  1221. + sapsOffsetX.ToString("D8") + "," + sapsOffsetY.ToString("D8") + "," + sapsOffsetZ.ToString("D8");
  1222. lock (_locker)
  1223. {
  1224. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SAPS", strParameter));
  1225. }
  1226. break;
  1227. case "DeleteTheSpecStation": //SPDL
  1228. string spdlMem = param[1].ToString();
  1229. string spdlTrsSt = param[2].ToString();
  1230. string spdlPosture = param[3].ToString();
  1231. string spdlHand = param[4].ToString();
  1232. strParameter = $"{spdlMem},{spdlTrsSt},{spdlPosture},{spdlHand}";
  1233. lock (_locker)
  1234. {
  1235. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SPDL", strParameter));
  1236. }
  1237. break;
  1238. case "RegisterThePositionDataToVolatile": //SPSV
  1239. string spsvTrsSt = param[1].ToString();
  1240. string spsvPosture = param[2].ToString();
  1241. string spsvHand = param[3].ToString();
  1242. strParameter = $"{spsvTrsSt},{spsvPosture},{spsvHand}";
  1243. lock (_locker)
  1244. {
  1245. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SPSV", strParameter));
  1246. }
  1247. break;
  1248. case "ReadThePostionDataFromVolatile": //SPLD
  1249. string spldTrsSt = param[1].ToString();
  1250. string spldPosture = param[2].ToString();
  1251. string spldHand = param[3].ToString();
  1252. strParameter = $"{spldTrsSt},{spldPosture},{spldHand}";
  1253. lock (_locker)
  1254. {
  1255. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SPLD", strParameter));
  1256. }
  1257. break;
  1258. case "SetTheStationParameters": //SSTR
  1259. string sstrMem = param[1].ToString();
  1260. string sstrTrsSt = param[2].ToString();
  1261. string sstrItem = param[3].ToString();
  1262. Int32 sstrValue = Convert.ToInt32(param[4].ToString());
  1263. strParameter = $"{sstrMem},{sstrTrsSt},{sstrItem}," + sstrValue.ToString("D8");
  1264. lock (_locker)
  1265. {
  1266. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSTR", strParameter));
  1267. }
  1268. break;
  1269. case "ChangeParameterValue": // SPRM
  1270. string sprmParaType = param[1].ToString();
  1271. int sprmParaNO = Convert.ToInt32(param[2].ToString());
  1272. Int32 sprmValue = Convert.ToInt32(param[3].ToString());
  1273. strParameter = sprmParaType + "," + sprmParaNO.ToString("D4") + "," + sprmValue.ToString("D12");
  1274. lock (_locker)
  1275. {
  1276. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SPRM", strParameter));
  1277. }
  1278. break;
  1279. case "EnableInterlock": //SMSK
  1280. case "Interlock": //SMSK
  1281. int smskValid = Convert.ToInt16(param[1].ToString());
  1282. lock (_locker)
  1283. {
  1284. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SMSK", smskValid.ToString("D4")));
  1285. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RMSK"));
  1286. if (smskValid.ToString("D4").Substring(0,1) == "0")
  1287. {
  1288. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSLV", SpeedLevelSetting.ToString()));
  1289. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,H,G,%{(_workSpeedRatio * 10).ToString("D7")}"));
  1290. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,M,G,%{(_workSpeedRatio * 10).ToString("D7")}"));
  1291. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,L,G,%{(_workSpeedRatio * 10).ToString("D7")}"));
  1292. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,O,G,%{(_workSpeedRatio * 10).ToString("D7")}"));
  1293. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,B,G,%{(_workSpeedRatio * 10).ToString("D7")}"));
  1294. }
  1295. else
  1296. {
  1297. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSLV", "3"));
  1298. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,H,G,%{(_lowSpeedRatio*10).ToString("D7")}"));
  1299. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,M,G,%{(_lowSpeedRatio * 10).ToString("D7")}"));
  1300. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,L,G,%{(_lowSpeedRatio * 10).ToString("D7")}"));
  1301. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,O,G,%{(_lowSpeedRatio * 10).ToString("D7")}"));
  1302. //_lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSPD", $"0,B,G,%{(_lowSpeedRatio * 10).ToString("D7")}"));
  1303. }
  1304. }
  1305. break;
  1306. case "RegisterTheCurrentPositionAsCoordinate": //SSTD
  1307. string sstdAxis = param[1].ToString();
  1308. lock (_locker)
  1309. {
  1310. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSTD", sstdAxis));
  1311. }
  1312. break;
  1313. case "ResigterTheSpecNumberAsReferencePostion": //SSTN
  1314. Int32 sstnValue1 = Convert.ToInt32(param[1]);
  1315. Int32 sstnValue2 = Convert.ToInt32(param[2]);
  1316. Int32 sstnValue3 = Convert.ToInt32(param[3]);
  1317. Int32 sstnValue4 = Convert.ToInt32(param[4]);
  1318. Int32 sstnValue5 = Convert.ToInt32(param[5]);
  1319. strParameter = sstnValue1.ToString("D12") + "," + sstnValue2.ToString("D12") + ","
  1320. + sstnValue3.ToString("D12") + "," + sstnValue4.ToString("D12") + ","
  1321. + sstnValue5.ToString("D12");
  1322. lock (_locker)
  1323. {
  1324. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSTN", strParameter));
  1325. }
  1326. break;
  1327. case "WaferSize":
  1328. _setSizeArm = (RobotArmEnum)param[1];
  1329. _setSize = (WaferSize)param[2];
  1330. break;
  1331. }
  1332. }
  1333. catch (Exception)
  1334. {
  1335. string reason = "";
  1336. if (param != null)
  1337. {
  1338. foreach (var para in param)
  1339. {
  1340. reason += para.ToString() + ",";
  1341. }
  1342. }
  1343. EV.PostAlarmLog(Name, "Set command parameter invalid:" + reason);
  1344. return false;
  1345. }
  1346. return true;
  1347. }
  1348. private int _lowSpeedRatio
  1349. {
  1350. get
  1351. {
  1352. if (SC.ContainsItem($"{ _scRoot}.{ Name}.LowSpeedRatio"))
  1353. return SC.GetValue<int>($"{ _scRoot}.{ Name}.LowSpeedRatio");
  1354. return 10;
  1355. }
  1356. }
  1357. private int _workSpeedRatio
  1358. {
  1359. get
  1360. {
  1361. if (SC.ContainsItem($"{ _scRoot}.{ Name}.WorkSpeedRatio"))
  1362. return SC.GetValue<int>($"{ _scRoot}.{ Name}.WorkSpeedRatio");
  1363. return 100;
  1364. }
  1365. }
  1366. private string _setParameter;
  1367. private RobotArmEnum _setSizeArm;
  1368. private WaferSize _setSize;
  1369. protected override bool fMonitorSetParamter(object[] param)
  1370. {
  1371. IsBusy = false;
  1372. switch (_setParameter)
  1373. {
  1374. case "WaferSize":
  1375. if (_setSizeArm == RobotArmEnum.Lower || _setSizeArm == RobotArmEnum.Blade1)
  1376. WaferManager.Instance.UpdateWaferSize(RobotModuleName, 0, _setSize);
  1377. if (_setSizeArm == RobotArmEnum.Upper || _setSizeArm == RobotArmEnum.Upper)
  1378. WaferManager.Instance.UpdateWaferSize(RobotModuleName, 1, _setSize);
  1379. if (_setSizeArm == RobotArmEnum.Both)
  1380. {
  1381. WaferManager.Instance.UpdateWaferSize(RobotModuleName, 0, _setSize);
  1382. WaferManager.Instance.UpdateWaferSize(RobotModuleName, 1, _setSize);
  1383. }
  1384. Size = _setSize;
  1385. break;
  1386. }
  1387. return true;
  1388. }
  1389. protected override bool fStartTransferWafer(object[] param)
  1390. {
  1391. return false;
  1392. }
  1393. protected override bool fStartUnGrip(object[] param)
  1394. {
  1395. lock (_locker)
  1396. {
  1397. RobotArmEnum arm = (RobotArmEnum)param[0];
  1398. string strpara = (arm == RobotArmEnum.Both ? "F" : ((int)arm + 1).ToString()) + ",0,0";
  1399. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CSOL", strpara));
  1400. }
  1401. return true;
  1402. }
  1403. protected override bool fStartGrip(object[] param)
  1404. {
  1405. lock (_locker)
  1406. {
  1407. RobotArmEnum arm = (RobotArmEnum)param[0];
  1408. string strpara = (arm == RobotArmEnum.Both ? "F" : ((int)arm + 1).ToString()) + ",1,0";
  1409. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CSOL", strpara));
  1410. }
  1411. return true;
  1412. }
  1413. protected override bool fStartInit(object[] param)
  1414. {
  1415. IsOnReadyPosition = false;
  1416. if (_doRobotHold != null)
  1417. {
  1418. _doRobotHold.SetTrigger(true, out _);
  1419. Thread.Sleep(100);
  1420. }
  1421. //lock(_locker)
  1422. //{
  1423. // _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CCLR", "E"));
  1424. // _lstHandlers.AddLast(new SR100RobotGripAndCheckWaferMotionHandler(this));
  1425. // _lstHandlers.AddLast(new SR100RobotCheckWaferHandler(this));
  1426. //}
  1427. //Stopwatch timer = new Stopwatch();
  1428. //timer.Start();
  1429. //while (timer.IsRunning && (_lstHandlers.Count >0 || _connection.IsBusy))
  1430. //{
  1431. // if(timer.Elapsed > TimeSpan.FromSeconds(30))
  1432. // {
  1433. // OnError("CheckWaferStatusTimeout");
  1434. // timer.Stop();
  1435. // return false;
  1436. // }
  1437. //}
  1438. //timer.Stop();
  1439. //if(!_isCheckResultOK)
  1440. //{
  1441. // OnError($"WaferCheckError");
  1442. // return false;
  1443. //}
  1444. lock (_locker)
  1445. {
  1446. if (!isSimulatorMode && IsCheckWaferForHHSmec)
  1447. {
  1448. if (!_isWaferMatchRecord)
  1449. {
  1450. OnError("WaferStateUnmatchRecord");
  1451. return false;
  1452. }
  1453. }
  1454. string strpara = "1,1,G";
  1455. //_lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CSOL", "F,1,0"));
  1456. _lstHandlers.AddLast(new SR100RobotGripAndCheckWaferMotionHandler(this));
  1457. _lstHandlers.AddLast(new SR100RobotCheckWaferHandler(this));
  1458. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "INIT", strpara));
  1459. if(IsCheckInterlockWaferPresenceOnBlade1 && IsCheckInterlockWaferPresenceOnBlade2)
  1460. {
  1461. if (SpeedLevelSetting >= 1 && SpeedLevelSetting <= 3)
  1462. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSLV", SpeedLevelSetting.ToString()));
  1463. }
  1464. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RSTS"));
  1465. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RMSK"));
  1466. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RPOS", "F"));
  1467. }
  1468. return true;
  1469. }
  1470. protected override bool fStartHome(object[] param)
  1471. {
  1472. IsOnReadyPosition = false;
  1473. lock (_locker)
  1474. {
  1475. if (_doRobotHold != null)
  1476. {
  1477. _doRobotHold.SetTrigger(true, out _);
  1478. Thread.Sleep(100);
  1479. }
  1480. if (!isSimulatorMode && IsCheckWaferForHHSmec)
  1481. {
  1482. if (!_isWaferMatchRecord)
  1483. {
  1484. OnError("WaferStateUnmatchRecord");
  1485. return false;
  1486. }
  1487. }
  1488. //_lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CSOL", "F,1,0"));
  1489. string strpara = "1,1,G";
  1490. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "INIT", strpara));
  1491. if (IsCheckInterlockWaferPresenceOnBlade1 && IsCheckInterlockWaferPresenceOnBlade2)
  1492. {
  1493. if (SpeedLevelSetting >= 1 && SpeedLevelSetting <= 3)
  1494. _lstHandlers.AddLast(new SR100RobotSetHandler(this, "SSLV", SpeedLevelSetting.ToString()));
  1495. }
  1496. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RSTS"));
  1497. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RMSK"));
  1498. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RPOS", "F"));
  1499. }
  1500. return true;
  1501. }
  1502. protected override bool fStartGoTo(object[] param)
  1503. {
  1504. try
  1505. {
  1506. if (!isSimulatorMode && IsCheckWaferForHHSmec)
  1507. {
  1508. if (!_isWaferMatchRecord)
  1509. {
  1510. OnError("WaferStateUnmatchRecord");
  1511. return false;
  1512. }
  1513. }
  1514. RobotArmEnum arm = (RobotArmEnum)param[0];
  1515. ModuleName module = (ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString());
  1516. BladeTarget = module;
  1517. Blade1Target = module;
  1518. Blade2Target = module;
  1519. int slot = (int)param[2] + 1;
  1520. RobotPostionEnum postype = (RobotPostionEnum)param[3];
  1521. float x = (float)param[4];
  1522. float y = (float)param[5];
  1523. float z = (float)param[6];
  1524. float w = (float)param[7];
  1525. int intXvalue = (int)(x * 1000);
  1526. int intYvalue = (int)(y * 1000);
  1527. int intZvalue = (int)(z * 1000);
  1528. int intWvalue = (int)(w * 1000);
  1529. bool isFromOriginal = (bool)param[8];
  1530. bool isJumpToNextMotion = (bool)param[9];
  1531. string strpara = string.Empty;
  1532. if ((int)postype >= 0 && (int)postype < 10)
  1533. {
  1534. strpara = "G";
  1535. }
  1536. if ((int)postype >= 10 && (int)postype < 20)
  1537. {
  1538. strpara = "P";
  1539. }
  1540. if ((int)postype >= 20 && (int)postype < 30)
  1541. {
  1542. strpara = "E";
  1543. }
  1544. string trsSt = "";
  1545. string TrsPnt = string.Empty;
  1546. if (postype == RobotPostionEnum.PickReady)
  1547. {
  1548. IsOnReadyPosition = true;
  1549. trsSt = GetStationsName(module, true, arm);
  1550. TrsPnt = "G1";
  1551. }
  1552. if (postype == RobotPostionEnum.PickExtendLow)
  1553. {
  1554. trsSt = GetStationsName(module, true, arm);
  1555. TrsPnt = "G2";
  1556. }
  1557. if (postype == RobotPostionEnum.PickAtWafer)
  1558. {
  1559. trsSt = GetStationsName(module, true, arm);
  1560. TrsPnt = "Gb";
  1561. }
  1562. if (postype == RobotPostionEnum.PickExtendUp)
  1563. {
  1564. trsSt = GetStationsName(module, true, arm);
  1565. TrsPnt = "G3";
  1566. }
  1567. if (postype == RobotPostionEnum.PickRetracted)
  1568. {
  1569. trsSt = GetStationsName(module, true, arm);
  1570. TrsPnt = "G4";
  1571. }
  1572. if (postype == RobotPostionEnum.PlaceReady)
  1573. {
  1574. IsOnReadyPosition = true;
  1575. trsSt = GetStationsName(module, false, arm);
  1576. TrsPnt = "P1";
  1577. }
  1578. if (postype == RobotPostionEnum.PlaceExtendUp)
  1579. {
  1580. trsSt = GetStationsName(module, false, arm);
  1581. TrsPnt = "P2";
  1582. }
  1583. if (postype == RobotPostionEnum.PlaceExtendAtWafer)
  1584. {
  1585. trsSt = GetStationsName(module, false, arm);
  1586. TrsPnt = "Pb";
  1587. }
  1588. if (postype == RobotPostionEnum.PlaceExtendDown)
  1589. {
  1590. trsSt = GetStationsName(module, false, arm);
  1591. TrsPnt = "P3";
  1592. }
  1593. if (postype == RobotPostionEnum.PlaceRetract)
  1594. {
  1595. trsSt = GetStationsName(module, false, arm);
  1596. TrsPnt = "P4";
  1597. }
  1598. string strCmd = string.Empty;
  1599. if (isFromOriginal)
  1600. {
  1601. strCmd = "MTRS";
  1602. }
  1603. else if (isJumpToNextMotion)
  1604. {
  1605. strCmd = "MCTR";
  1606. }
  1607. else
  1608. {
  1609. strCmd = "MPNT";
  1610. }
  1611. if (string.IsNullOrEmpty(trsSt) || string.IsNullOrEmpty(strpara) || string.IsNullOrEmpty(TrsPnt))
  1612. {
  1613. EV.PostAlarmLog("Robot", "invalid transfer paramter");
  1614. return false;
  1615. }
  1616. strpara += $",{trsSt},{slot:D2},A,{(arm == RobotArmEnum.Both ? "F" : ((int)arm + 1).ToString())}," +
  1617. $"{TrsPnt}";
  1618. if (x != 0 || y != 0 || z != 0 || w != 0)
  1619. {
  1620. string strxoffset = intXvalue >= 0 ? $"{intXvalue:D8}" : $"{intXvalue:D7}";
  1621. string stryoffset = intYvalue >= 0 ? $"{intYvalue:D8}" : $"{intYvalue:D7}";
  1622. string strzoffset = intZvalue >= 0 ? $"{intZvalue:D8}" : $"{intZvalue:D7}";
  1623. string strwoffset = intWvalue >= 0 ? $"{intWvalue:D8}" : $"{intWvalue:D7}";
  1624. strpara += $",{strxoffset},{stryoffset},{strzoffset},{strwoffset}";
  1625. }
  1626. if (strCmd == "MPNT")
  1627. strpara = TrsPnt;
  1628. lock (_locker)
  1629. {
  1630. if (_lstHandlers.Count == 0 && !_connection.IsBusy)
  1631. {
  1632. ExecuteHandler(new SR100RobotMotionHandler(this, strCmd, strpara));
  1633. }
  1634. else
  1635. {
  1636. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, strCmd, strpara));
  1637. }
  1638. }
  1639. return true;
  1640. }
  1641. catch (Exception ex)
  1642. {
  1643. LOG.Write(ex);
  1644. return false;
  1645. }
  1646. }
  1647. protected override bool fGoToComplete(object[] param)
  1648. {
  1649. try
  1650. {
  1651. RobotArmEnum arm = (RobotArmEnum)CurrentParamter[0];
  1652. ModuleName sourcemodule = (ModuleName)Enum.Parse(typeof(ModuleName), CurrentParamter[1].ToString());
  1653. int SourceslotIndex = (int)CurrentParamter[2];
  1654. RobotPostionEnum postype = (RobotPostionEnum)CurrentParamter[3];
  1655. bool isFromOriginal = (bool)CurrentParamter[8];
  1656. bool isJumpToNextMotion = (bool)CurrentParamter[9];
  1657. switch (postype)
  1658. {
  1659. case RobotPostionEnum.PickExtendUp:
  1660. case RobotPostionEnum.PickRetracted:
  1661. if (arm == RobotArmEnum.Lower)
  1662. {
  1663. WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 0);
  1664. //if (isSimulatorMode || GetWaferState(arm) == RobotArmWaferStateEnum.Present)
  1665. // WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 0);
  1666. //else
  1667. // OnError("Wafer detect error");
  1668. }
  1669. if (arm == RobotArmEnum.Upper)
  1670. {
  1671. WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 1);
  1672. //if (isSimulatorMode || GetWaferState(arm) == RobotArmWaferStateEnum.Present)
  1673. // WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 1);
  1674. //else
  1675. // OnError("Wafer detect error");
  1676. }
  1677. if (arm == RobotArmEnum.Both)
  1678. {
  1679. WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 0);
  1680. WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 1);
  1681. //if (isSimulatorMode || GetWaferState(arm) == RobotArmWaferStateEnum.Present)
  1682. //{
  1683. // WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 0);
  1684. // WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 1);
  1685. //}
  1686. //else
  1687. // OnError("Wafer detect error");
  1688. }
  1689. break;
  1690. case RobotPostionEnum.PlaceExtendDown:
  1691. case RobotPostionEnum.PlaceRetract:
  1692. if (arm == RobotArmEnum.Lower)
  1693. {
  1694. WaferManager.Instance.WaferMoved(RobotModuleName, 0, sourcemodule, SourceslotIndex);
  1695. //if (isSimulatorMode || GetWaferState(arm) == RobotArmWaferStateEnum.Absent)
  1696. // WaferManager.Instance.WaferMoved(RobotModuleName, 0, sourcemodule, SourceslotIndex);
  1697. //else
  1698. // OnError("Wafer detect error");
  1699. }
  1700. if (arm == RobotArmEnum.Upper)
  1701. {
  1702. WaferManager.Instance.WaferMoved(RobotModuleName, 1, sourcemodule, SourceslotIndex);
  1703. //if (isSimulatorMode || GetWaferState(arm) == RobotArmWaferStateEnum.Absent)
  1704. // WaferManager.Instance.WaferMoved(RobotModuleName, 1, sourcemodule, SourceslotIndex);
  1705. //else
  1706. // OnError("Wafer detect error");
  1707. }
  1708. if (arm == RobotArmEnum.Both)
  1709. {
  1710. WaferManager.Instance.WaferMoved(RobotModuleName, 0, sourcemodule, SourceslotIndex);
  1711. WaferManager.Instance.WaferMoved(RobotModuleName, 1, sourcemodule, SourceslotIndex);
  1712. //if (isSimulatorMode || GetWaferState(arm) == RobotArmWaferStateEnum.Absent)
  1713. //{
  1714. // WaferManager.Instance.WaferMoved(RobotModuleName, 0, sourcemodule, SourceslotIndex);
  1715. // WaferManager.Instance.WaferMoved(RobotModuleName, 1, sourcemodule, SourceslotIndex);
  1716. //}
  1717. //else
  1718. // OnError("Wafer detect error");
  1719. }
  1720. break;
  1721. }
  1722. }
  1723. catch (Exception ex)
  1724. {
  1725. LOG.Write(ex);
  1726. }
  1727. return base.fGoToComplete(param);
  1728. }
  1729. protected override bool fStop(object[] param)
  1730. {
  1731. lock (_locker)
  1732. {
  1733. if (_doRobotHold != null)
  1734. _doRobotHold.SetTrigger(false, out _);
  1735. _lstHandlers.Clear();
  1736. _connection.ForceClear();
  1737. ExecuteHandler(new SR100RobotMotionHandler(this, "CSTP", "E"));
  1738. }
  1739. return true; ;
  1740. }
  1741. protected override bool fStartMove(object[] param)
  1742. {
  1743. try
  1744. {
  1745. string strCmd = param[0].ToString();
  1746. string strpara = string.Empty;
  1747. for (int i = 1; i < param.Length; i++)
  1748. {
  1749. if (i == 1)
  1750. strpara += param[i].ToString();
  1751. else
  1752. strpara += "," + param[i].ToString();
  1753. }
  1754. lock (_locker)
  1755. {
  1756. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, strCmd, strpara));
  1757. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RPOS", "F"));
  1758. }
  1759. return true;
  1760. }
  1761. catch (Exception ex)
  1762. {
  1763. LOG.Write(ex);
  1764. return false;
  1765. }
  1766. }
  1767. protected string GetStationsName(ModuleName module,bool isPick = true, RobotArmEnum placeArm = RobotArmEnum.Lower)
  1768. {
  1769. try
  1770. {
  1771. if (ModuleHelper.IsLoadPort(module))
  1772. {
  1773. int infopadindex = DEVICE.GetDevice<LoadPortBaseDevice>(module.ToString()).InfoPadCarrierIndex;
  1774. if(SC.ContainsItem($"CarrierInfo.{module}Station{infopadindex}"))
  1775. return SC.GetStringValue($"CarrierInfo.{module}Station{infopadindex}");
  1776. if (SC.ContainsItem($"CarrierInfo.Carrier{infopadindex}.{module}Station"))
  1777. return SC.GetStringValue($"CarrierInfo.Carrier{infopadindex}.{module}Station");
  1778. }
  1779. if(ModuleHelper.IsTurnOverStation(module))
  1780. {
  1781. if(isPick)
  1782. {
  1783. WaferSize ws = WaferManager.Instance.GetWaferSize(module, 0);
  1784. if (SC.ContainsItem($"CarrierInfo.{module}PickStation{ws.ToString().Replace("WS", "")}"))
  1785. {
  1786. string stname = SC.GetStringValue($"CarrierInfo.{module}PickStation{ws.ToString().Replace("WS", "")}");
  1787. LOG.Write($"{RobotModuleName} Get {module} pick stationName for wafersize:{ws} is {stname}");
  1788. return stname;
  1789. }
  1790. }
  1791. else
  1792. {
  1793. WaferSize ws = WaferManager.Instance.GetWaferSize(RobotModuleName, 0);
  1794. if(placeArm != RobotArmEnum.Lower)
  1795. ws = WaferManager.Instance.GetWaferSize(RobotModuleName, 1);
  1796. if (SC.ContainsItem($"CarrierInfo.{module}PlaceStation{ws.ToString().Replace("WS", "")}"))
  1797. {
  1798. string stname = SC.GetStringValue($"CarrierInfo.{module}PlaceStation{ws.ToString().Replace("WS", "")}");
  1799. LOG.Write($"{RobotModuleName} Get {module} place stationName for wafersize:{ws} is {stname}");
  1800. return stname;
  1801. }
  1802. }
  1803. }
  1804. LOG.Write($"{RobotModuleName} Get {module} stationName for is {$"CarrierInfo.{module}Station"}");
  1805. return SC.GetStringValue($"CarrierInfo.{module}Station");
  1806. }
  1807. catch (Exception ex)
  1808. {
  1809. LOG.Write(ex);
  1810. return null;
  1811. }
  1812. }
  1813. private int GetSlotsNumber(ModuleName module)
  1814. {
  1815. try
  1816. {
  1817. if (ModuleHelper.IsLoadPort(module))
  1818. {
  1819. return DEVICE.GetDevice<LoadPortBaseDevice>(module.ToString()).ValidSlotsNumber;
  1820. }
  1821. return 1;
  1822. }
  1823. catch (Exception ex)
  1824. {
  1825. LOG.Write(ex);
  1826. return -1;
  1827. }
  1828. }
  1829. private bool _isNeedMappignData
  1830. {
  1831. get
  1832. {
  1833. if (SC.ContainsItem($"Robot.{RobotModuleName}.NeedReadMapData"))
  1834. return SC.GetValue<bool>($"Robot.{RobotModuleName}.NeedReadMapData");
  1835. return true;
  1836. }
  1837. }
  1838. protected override bool fStartMapWafer(object[] param)
  1839. {
  1840. try
  1841. {
  1842. //RobotArmEnum pickarm = (RobotArmEnum)param[0];
  1843. ModuleName module = (ModuleName)Enum.Parse(typeof(ModuleName), param[0].ToString());
  1844. BladeTarget = module;
  1845. Blade1Target = module;
  1846. Blade2Target = module;
  1847. int slotsNumber = GetSlotsNumber(module);
  1848. if (slotsNumber == -1)
  1849. {
  1850. EV.PostAlarmLog("Robot", "Invalid mapping paramter slots number");
  1851. return false;
  1852. }
  1853. //int slot = 25;// (int)param[2];
  1854. string strpara = $"{GetStationsName(module)},00,1";
  1855. if(ModuleHelper.IsLoadPort(module))
  1856. {
  1857. var lp = DEVICE.GetDevice<LoadPortBaseDevice>(module.ToString());
  1858. lp.NoteTransferStart();
  1859. }
  1860. lock (_locker)
  1861. {
  1862. CurrentInteractiveModule = module;
  1863. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MMAP", strpara));
  1864. if (_isNeedMappignData)
  1865. {
  1866. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RMPD", $"{GetStationsName(module)}"));
  1867. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RMAP", $"{GetStationsName(module)},00"));
  1868. }
  1869. }
  1870. return true;
  1871. }
  1872. catch (Exception ex)
  1873. {
  1874. LOG.Write(ex);
  1875. return false;
  1876. }
  1877. }
  1878. protected override bool fStartSwapWafer(object[] param)
  1879. {
  1880. try
  1881. {
  1882. if (_isCheckWaferBeforeAction && IsCheckInterlockWaferPresenceOnBlade1 && IsCheckInterlockWaferPresenceOnBlade2)
  1883. {
  1884. if (!_isWaferMatchRecord)
  1885. {
  1886. OnError("WaferStateUnmatchRecord");
  1887. return false;
  1888. }
  1889. }
  1890. if (!isSimulatorMode && IsCheckWaferForHHSmec)
  1891. {
  1892. if (!_isWaferMatchRecord)
  1893. {
  1894. OnError("WaferStateUnmatchRecord");
  1895. return false;
  1896. }
  1897. }
  1898. IsOnReadyPosition = false;
  1899. RobotArmEnum arm = (RobotArmEnum)param[0];
  1900. ModuleName module = (ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString());
  1901. BladeTarget = module;
  1902. Blade1Target = module;
  1903. Blade2Target = module;
  1904. if (ModuleHelper.IsLoadPort(module))
  1905. {
  1906. var lp = DEVICE.GetDevice<LoadPortBaseDevice>(module.ToString());
  1907. if (lp != null)
  1908. lp.NoteTransferStart();
  1909. }
  1910. int slot = (int)param[2] + 1;
  1911. float x = 0, y = 0, z = 0, w = 0;
  1912. if (param.Length > 3)
  1913. {
  1914. x = (float)param[3];
  1915. y = (float)param[4];
  1916. z = (float)param[5];
  1917. w = (float)param[6];
  1918. }
  1919. int intXvalue = (int)(x * 1000);
  1920. int intYvalue = (int)(y * 1000);
  1921. int intZvalue = (int)(z * 1000);
  1922. int intWvalue = (int)(w * 1000);
  1923. string TrsSt = GetStationsName(module);
  1924. if (string.IsNullOrEmpty(TrsSt))
  1925. {
  1926. EV.PostAlarmLog("Robot", "Invalid Paramter.");
  1927. return false;
  1928. }
  1929. string strpara = $"E,{TrsSt},{slot:D2},A,{(arm == RobotArmEnum.Both ? "F" : ((int)arm + 1).ToString())},P4";
  1930. if (x != 0 || y != 0 || z != 0)
  1931. {
  1932. strpara += $",{intXvalue:D8},{intYvalue:D8},{intZvalue:D8}";
  1933. }
  1934. if (w != 0)
  1935. {
  1936. strpara += $",{intWvalue:D8}";
  1937. }
  1938. lock (_locker)
  1939. {
  1940. if (_lstHandlers.Count == 0 && !_connection.IsBusy)
  1941. {
  1942. ExecuteHandler(new SR100RobotMotionHandler(this, "MTRS", strpara));
  1943. }
  1944. else
  1945. {
  1946. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MTRS", strpara));
  1947. }
  1948. }
  1949. return true;
  1950. }
  1951. catch (Exception ex)
  1952. {
  1953. LOG.Write(ex);
  1954. return false;
  1955. }
  1956. }
  1957. protected override bool fSwapComplete(object[] param)
  1958. {
  1959. RobotArmEnum arm = (RobotArmEnum)CurrentParamter[0];
  1960. ModuleName sourcemodule;
  1961. if (!Enum.TryParse(CurrentParamter[1].ToString(), out sourcemodule)) return false;
  1962. int Sourceslotindex;
  1963. if (!int.TryParse(CurrentParamter[2].ToString(), out Sourceslotindex)) return false;
  1964. int delayCount = 0;
  1965. if (arm == RobotArmEnum.Lower)
  1966. {
  1967. //WaferManager.Instance.WaferMoved(sourcemodule, Sourceslotindex, RobotModuleName, 0);
  1968. //WaferManager.Instance.WaferMoved(RobotModuleName, 1, sourcemodule, Sourceslotindex);
  1969. while (_isCheckWaferAfterAction && !isSimulatorMode && !(GetWaferState(RobotArmEnum.Lower) == RobotArmWaferStateEnum.Present
  1970. && GetWaferState(RobotArmEnum.Upper) == RobotArmWaferStateEnum.Absent))
  1971. {
  1972. delayCount++;
  1973. Thread.Sleep(50);
  1974. LOG.Write($"{RobotModuleName} delay {delayCount} time to detect wafer");
  1975. if (delayCount > 100)
  1976. {
  1977. OnError("Wafer detect error");
  1978. return true;
  1979. }
  1980. }
  1981. WaferManager.Instance.WaferMoved(sourcemodule, Sourceslotindex, RobotModuleName, 0);
  1982. WaferManager.Instance.WaferMoved(RobotModuleName, 1, sourcemodule, Sourceslotindex);
  1983. }
  1984. if (arm == RobotArmEnum.Upper)
  1985. {
  1986. //WaferManager.Instance.WaferMoved(sourcemodule, Sourceslotindex, RobotModuleName, 1);
  1987. //WaferManager.Instance.WaferMoved(RobotModuleName, 0, sourcemodule, Sourceslotindex);
  1988. delayCount = 0;
  1989. while (_isCheckWaferAfterAction && !isSimulatorMode && !(GetWaferState(RobotArmEnum.Upper) == RobotArmWaferStateEnum.Present &&
  1990. GetWaferState(RobotArmEnum.Lower) == RobotArmWaferStateEnum.Absent))
  1991. {
  1992. delayCount++;
  1993. Thread.Sleep(50);
  1994. LOG.Write($"{RobotModuleName} delay {delayCount} time to detect wafer");
  1995. if (delayCount > 100)
  1996. {
  1997. OnError("Wafer detect error");
  1998. return true;
  1999. }
  2000. }
  2001. WaferManager.Instance.WaferMoved(sourcemodule, Sourceslotindex, RobotModuleName, 1);
  2002. WaferManager.Instance.WaferMoved(RobotModuleName, 0, sourcemodule, Sourceslotindex);
  2003. }
  2004. return base.fSwapComplete(param);
  2005. }
  2006. protected override bool fStartPlaceWafer(object[] param)
  2007. {
  2008. try
  2009. {
  2010. if (_isCheckWaferBeforeAction && IsCheckInterlockWaferPresenceOnBlade1 && IsCheckInterlockWaferPresenceOnBlade2)
  2011. {
  2012. if (!_isWaferMatchRecord)
  2013. {
  2014. OnError("WaferStateUnmatchRecord");
  2015. return false;
  2016. }
  2017. }
  2018. if (!isSimulatorMode && IsCheckWaferForHHSmec)
  2019. {
  2020. if (!_isWaferMatchRecord)
  2021. {
  2022. OnError("WaferStateUnmatchRecord");
  2023. return false;
  2024. }
  2025. }
  2026. IsOnReadyPosition = false;
  2027. RobotArmEnum arm = (RobotArmEnum)param[0];
  2028. ModuleName module = (ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString());
  2029. if (ModuleHelper.IsLoadPort(module))
  2030. {
  2031. var lp = DEVICE.GetDevice<LoadPortBaseDevice>(module.ToString());
  2032. if (lp != null)
  2033. lp.NoteTransferStart();
  2034. }
  2035. BladeTarget = module;
  2036. Blade1Target = module;
  2037. Blade2Target = module;
  2038. int slot = (int)param[2] + 1;
  2039. float x = 0, y = 0, z = 0, w = 0;
  2040. if (param.Length > 3)
  2041. {
  2042. x = (float)param[3];
  2043. y = (float)param[4];
  2044. z = (float)param[5];
  2045. w = (float)param[6];
  2046. }
  2047. int intXvalue = Convert.ToInt32(x * 1000);
  2048. int intYvalue = Convert.ToInt32(y * 1000);
  2049. int intZvalue = Convert.ToInt32(z * 1000);
  2050. int intWvalue = Convert.ToInt32(w * 1000);
  2051. string TrsSt = GetStationsName(module);
  2052. if (string.IsNullOrEmpty(TrsSt))
  2053. {
  2054. EV.PostAlarmLog("Robot", "Invalid Parameter.");
  2055. return false;
  2056. }
  2057. string strpara = $"P,{TrsSt},{slot:D2},A,{(arm == RobotArmEnum.Both ? "F" : ((int)arm + 1).ToString())},P4";
  2058. if (x != 0 || y != 0 || z != 0)
  2059. {
  2060. string strxoffset = intXvalue >= 0 ? $"{intXvalue:D8}" : $"{intXvalue:D7}";
  2061. string stryoffset = intYvalue >= 0 ? $"{intYvalue:D8}" : $"{intYvalue:D7}";
  2062. string strzoffset = intZvalue >= 0 ? $"{intZvalue:D8}" : $"{intZvalue:D7}";
  2063. string strwoffset = intWvalue >= 0 ? $"{intWvalue:D8}" : $"{intWvalue:D7}";
  2064. strpara += $",{strxoffset},{stryoffset},{strzoffset},{strwoffset}";
  2065. }
  2066. if (w != 0)
  2067. {
  2068. strpara += $",{intWvalue:D8}";
  2069. }
  2070. lock (_locker)
  2071. {
  2072. if (_lstHandlers.Count == 0 && !_connection.IsBusy)
  2073. {
  2074. ExecuteHandler(new SR100RobotMotionHandler(this, "MTRS", strpara));
  2075. }
  2076. else
  2077. {
  2078. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MTRS", strpara));
  2079. }
  2080. }
  2081. return true;
  2082. }
  2083. catch (Exception ex)
  2084. {
  2085. LOG.Write(ex);
  2086. return false;
  2087. }
  2088. }
  2089. protected override bool fPlaceComplete(object[] param)
  2090. {
  2091. RobotArmEnum arm = (RobotArmEnum)CurrentParamter[0];
  2092. ModuleName sourcemodule;
  2093. if (!Enum.TryParse(CurrentParamter[1].ToString(), out sourcemodule)) return false;
  2094. int Sourceslotindex;
  2095. if (!int.TryParse(CurrentParamter[2].ToString(), out Sourceslotindex)) return false;
  2096. int delayCount = 0;
  2097. if (arm == RobotArmEnum.Lower)
  2098. {
  2099. //WaferManager.Instance.WaferMoved(RobotModuleName, 0, sourcemodule, Sourceslotindex);
  2100. while (_isCheckWaferAfterAction && !isSimulatorMode && GetWaferState(arm) != RobotArmWaferStateEnum.Absent)
  2101. {
  2102. delayCount++;
  2103. Thread.Sleep(50);
  2104. LOG.Write($"{RobotModuleName} delay {delayCount} time to detect wafer");
  2105. if (delayCount > 100)
  2106. {
  2107. OnError("Wafer detect error");
  2108. return true;
  2109. }
  2110. }
  2111. WaferManager.Instance.WaferMoved(RobotModuleName, 0, sourcemodule, Sourceslotindex);
  2112. }
  2113. if (arm == RobotArmEnum.Upper)
  2114. {
  2115. //WaferManager.Instance.WaferMoved(RobotModuleName, 1, sourcemodule, Sourceslotindex);
  2116. delayCount = 0;
  2117. while (_isCheckWaferAfterAction && !isSimulatorMode && GetWaferState(arm) != RobotArmWaferStateEnum.Absent)
  2118. {
  2119. delayCount++;
  2120. Thread.Sleep(50);
  2121. LOG.Write($"{RobotModuleName} delay {delayCount} time to detect wafer");
  2122. if (delayCount > 100)
  2123. {
  2124. OnError("Wafer detect error");
  2125. return true;
  2126. }
  2127. }
  2128. WaferManager.Instance.WaferMoved(RobotModuleName, 1, sourcemodule, Sourceslotindex);
  2129. }
  2130. if (arm == RobotArmEnum.Both)
  2131. {
  2132. //WaferManager.Instance.WaferMoved(RobotModuleName, 0, sourcemodule, Sourceslotindex);
  2133. //WaferManager.Instance.WaferMoved(RobotModuleName, 1, sourcemodule, Sourceslotindex);
  2134. while (_isCheckWaferAfterAction && !isSimulatorMode && GetWaferState(arm) != RobotArmWaferStateEnum.Absent)
  2135. {
  2136. delayCount++;
  2137. Thread.Sleep(50);
  2138. LOG.Write($"{RobotModuleName} delay {delayCount} time to detect wafer");
  2139. if (delayCount > 100)
  2140. {
  2141. OnError("Wafer detect error");
  2142. return true;
  2143. }
  2144. }
  2145. WaferManager.Instance.WaferMoved(RobotModuleName, 0, sourcemodule, Sourceslotindex);
  2146. WaferManager.Instance.WaferMoved(RobotModuleName, 1, sourcemodule, Sourceslotindex + 1);
  2147. }
  2148. return base.fPlaceComplete(param);
  2149. }
  2150. protected override bool fStartPickWafer(object[] param)
  2151. {
  2152. try
  2153. {
  2154. if (_isCheckWaferBeforeAction && IsCheckInterlockWaferPresenceOnBlade1 && IsCheckInterlockWaferPresenceOnBlade2)
  2155. {
  2156. if (!_isWaferMatchRecord)
  2157. {
  2158. OnError("WaferStateUnmatchRecord");
  2159. return false;
  2160. }
  2161. }
  2162. if (!isSimulatorMode && IsCheckWaferForHHSmec)
  2163. {
  2164. if (!_isWaferMatchRecord)
  2165. {
  2166. OnError("WaferStateUnmatchRecord");
  2167. return false;
  2168. }
  2169. }
  2170. IsOnReadyPosition = false;
  2171. RobotArmEnum arm = (RobotArmEnum)param[0];
  2172. ModuleName module = (ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString());
  2173. if (ModuleHelper.IsLoadPort(module))
  2174. {
  2175. var lp = DEVICE.GetDevice<LoadPortBaseDevice>(module.ToString());
  2176. if (lp != null)
  2177. lp.NoteTransferStart();
  2178. }
  2179. BladeTarget = module;
  2180. Blade1Target = module;
  2181. Blade2Target = module;
  2182. int slot = (int)param[2] + 1;
  2183. float x = 0, y = 0, z = 0, w = 0;
  2184. if (param.Length > 3)
  2185. {
  2186. x = (float)param[3];
  2187. y = (float)param[4];
  2188. z = (float)param[5];
  2189. w = (float)param[6];
  2190. }
  2191. int intXvalue = Convert.ToInt32(x * 1000);
  2192. int intYvalue = Convert.ToInt32(y * 1000);
  2193. int intZvalue = Convert.ToInt32(z * 1000);
  2194. int intWvalue = Convert.ToInt32(w * 1000);
  2195. string TrsSt = GetStationsName(module,true);
  2196. if (string.IsNullOrEmpty(TrsSt))
  2197. {
  2198. EV.PostAlarmLog("Robot", "Invalid Paramter.");
  2199. return false;
  2200. }
  2201. string strpara = $"G,{TrsSt},{slot:D2},A,{(arm == RobotArmEnum.Both ? "F" : ((int)arm + 1).ToString())},G4";
  2202. if (x != 0 || y != 0 || z != 0)
  2203. {
  2204. string strxoffset = intXvalue >= 0 ? $"{intXvalue:D8}" : $"{intXvalue:D7}";
  2205. string stryoffset = intYvalue >= 0 ? $"{intYvalue:D8}" : $"{intYvalue:D7}";
  2206. string strzoffset = intZvalue >= 0 ? $"{intZvalue:D8}" : $"{intZvalue:D7}";
  2207. string strwoffset = intWvalue >= 0 ? $"{intWvalue:D8}" : $"{intWvalue:D7}";
  2208. strpara += $",{strxoffset},{stryoffset},{strzoffset},{strwoffset}";
  2209. }
  2210. if (w != 0)
  2211. {
  2212. strpara += $",{intWvalue:D8}";
  2213. }
  2214. lock (_locker)
  2215. {
  2216. if (_lstHandlers.Count == 0 && !_connection.IsBusy)
  2217. {
  2218. ExecuteHandler(new SR100RobotMotionHandler(this, "MTRS", strpara));
  2219. }
  2220. else
  2221. {
  2222. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MTRS", strpara));
  2223. }
  2224. }
  2225. return true;
  2226. }
  2227. catch (Exception ex)
  2228. {
  2229. LOG.Write(ex);
  2230. return false;
  2231. }
  2232. }
  2233. protected override bool fPickComplete(object[] param)
  2234. {
  2235. RobotArmEnum arm = (RobotArmEnum)CurrentParamter[0];
  2236. ModuleName module = (ModuleName)Enum.Parse(typeof(ModuleName), CurrentParamter[1].ToString());
  2237. ModuleName sourcemodule;
  2238. if (!Enum.TryParse(CurrentParamter[1].ToString(), out sourcemodule)) return false;
  2239. int SourceslotIndex;
  2240. if (!int.TryParse(CurrentParamter[2].ToString(), out SourceslotIndex)) return false;
  2241. int delayCount = 0;
  2242. if (arm == RobotArmEnum.Lower)
  2243. {
  2244. while (!isSimulatorMode && _isCheckWaferAfterAction && GetWaferState(arm) != RobotArmWaferStateEnum.Present)
  2245. {
  2246. delayCount++;
  2247. LOG.Write($"{RobotModuleName} delay {delayCount} time to detect wafer");
  2248. Thread.Sleep(50);
  2249. if (delayCount > 100)
  2250. {
  2251. OnError("Wafer detect error");
  2252. return true;
  2253. }
  2254. }
  2255. WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 0);
  2256. }
  2257. if (arm == RobotArmEnum.Upper)
  2258. {
  2259. //WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 1);
  2260. while (!isSimulatorMode && _isCheckWaferAfterAction && GetWaferState(arm) != RobotArmWaferStateEnum.Present)
  2261. {
  2262. delayCount++;
  2263. LOG.Write($"{RobotModuleName} delay {delayCount} time to detect wafer");
  2264. Thread.Sleep(50);
  2265. if (delayCount > 100)
  2266. {
  2267. OnError("Wafer detect error");
  2268. return true;
  2269. }
  2270. }
  2271. WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 1);
  2272. }
  2273. if (arm == RobotArmEnum.Both)
  2274. {
  2275. //WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 0);
  2276. //WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 1);
  2277. while (!isSimulatorMode && _isCheckWaferAfterAction && GetWaferState(arm) != RobotArmWaferStateEnum.Present)
  2278. {
  2279. delayCount++;
  2280. LOG.Write($"{RobotModuleName} delay {delayCount} time to detect wafer");
  2281. Thread.Sleep(50);
  2282. if (delayCount > 100)
  2283. {
  2284. OnError("Wafer detect error");
  2285. return true;
  2286. }
  2287. }
  2288. WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 0);
  2289. WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex + 1, RobotModuleName, 1);
  2290. }
  2291. return base.fPickComplete(param);
  2292. }
  2293. protected override bool fResetToReady(object[] param)
  2294. {
  2295. if (_doRobotHold != null)
  2296. _doRobotHold.SetTrigger(true, out _);
  2297. return true;
  2298. }
  2299. protected override bool fReset(object[] param)
  2300. {
  2301. if (!_connection.IsConnected)
  2302. {
  2303. _address = SC.GetStringValue($"{_scRoot}.{Name}.Address");
  2304. _enableLog = SC.GetValue<bool>($"{_scRoot}.{Name}.EnableLogMessage");
  2305. _connection = new YaskawaRobotConnection(this, _address);
  2306. _connection.EnableLog(_enableLog);
  2307. _connection.Connect();
  2308. }
  2309. lock (_locker)
  2310. {
  2311. if (_doRobotHold != null)
  2312. _doRobotHold.SetTrigger(true, out _);
  2313. _lstHandlers.Clear();
  2314. _connection.ForceClear();
  2315. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CCLR", "E"));
  2316. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RSTS"));
  2317. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RMSK"));
  2318. _lstHandlers.AddLast(new SR100RobotReadHandler(this, "RPOS", "F"));
  2319. }
  2320. return true;
  2321. }
  2322. protected override bool fMonitorReset(object[] param)
  2323. {
  2324. return _lstHandlers.Count ==0 && _connection.IsBusy;
  2325. }
  2326. protected override bool fError(object[] param)
  2327. {
  2328. return true;
  2329. }
  2330. protected override bool fStartExtendForPick(object[] param)
  2331. {
  2332. return false;
  2333. }
  2334. protected override bool fStartExtendForPlace(object[] param)
  2335. {
  2336. return false;
  2337. }
  2338. protected override bool fStartRetractFromPick(object[] param)
  2339. {
  2340. return false;
  2341. }
  2342. protected override bool fStartRetractFromPlace(object[] param)
  2343. {
  2344. return false;
  2345. }
  2346. public void CheckWaferPresentAndGrip()
  2347. {
  2348. if (GetWaferState(RobotArmEnum.Lower) == RobotArmWaferStateEnum.Present)
  2349. {
  2350. if (WaferManager.Instance.CheckNoWafer(RobotModuleName, 0))
  2351. {
  2352. EV.PostWarningLog($"{RobotModuleName}", $"System detect wafer on lower arm, will create wafer automatically.");
  2353. WaferManager.Instance.CreateWafer(RobotModuleName, 0, WaferStatus.Normal);
  2354. }
  2355. }
  2356. if (GetWaferState(RobotArmEnum.Lower) == RobotArmWaferStateEnum.Absent)
  2357. {
  2358. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CSOL", "1,0,0"));
  2359. if (WaferManager.Instance.CheckHasWafer(RobotModuleName, 0))
  2360. {
  2361. EV.PostWarningLog($"{RobotModuleName}", $"System didn't detect wafer on lower arm, but it has record.");
  2362. OnError($"WaferCheckError");
  2363. _lstHandlers.Clear();
  2364. }
  2365. }
  2366. if (GetWaferState(RobotArmEnum.Upper) == RobotArmWaferStateEnum.Present)
  2367. {
  2368. if (WaferManager.Instance.CheckNoWafer(RobotModuleName, 1))
  2369. {
  2370. EV.PostWarningLog($"{RobotModuleName}", $"System detect wafer on upper arm, will create wafer automatically.");
  2371. WaferManager.Instance.CreateWafer(RobotModuleName, 1, WaferStatus.Normal);
  2372. }
  2373. }
  2374. if (GetWaferState(RobotArmEnum.Upper) == RobotArmWaferStateEnum.Absent)
  2375. {
  2376. _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CSOL", "2,0,0"));
  2377. if (WaferManager.Instance.CheckHasWafer(RobotModuleName, 1))
  2378. {
  2379. EV.PostWarningLog($"{RobotModuleName}", $"System didn't detect wafer on upper arm, but it has record.");
  2380. OnError($"WaferCheckError");
  2381. _lstHandlers.Clear();
  2382. }
  2383. }
  2384. }
  2385. public override RobotArmWaferStateEnum GetWaferState(RobotArmEnum arm)
  2386. {
  2387. if (arm == RobotArmEnum.Lower)
  2388. {
  2389. if (_diRobotBlade1WaferOn != null && _isDetectWaferByDI)
  2390. {
  2391. if (_diRobotBlade1WaferOn.Value) return RobotArmWaferStateEnum.Absent;
  2392. else return RobotArmWaferStateEnum.Present;
  2393. }
  2394. return IsWaferPresenceOnBlade1 ? RobotArmWaferStateEnum.Present : RobotArmWaferStateEnum.Absent;
  2395. }
  2396. if (arm == RobotArmEnum.Upper)
  2397. {
  2398. if (_diRobotBlade2WaferOn != null && _isDetectWaferByDI)
  2399. {
  2400. if (_diRobotBlade2WaferOn.Value) return RobotArmWaferStateEnum.Absent;
  2401. else return RobotArmWaferStateEnum.Present;
  2402. }
  2403. return IsWaferPresenceOnBlade2 ? RobotArmWaferStateEnum.Present : RobotArmWaferStateEnum.Absent;
  2404. }
  2405. if (arm == RobotArmEnum.Both)
  2406. {
  2407. if (_diRobotBlade1WaferOn != null && _diRobotBlade2WaferOn != null && _isDetectWaferByDI)
  2408. {
  2409. if (_diRobotBlade2WaferOn.Value && _diRobotBlade1WaferOn.Value)
  2410. return RobotArmWaferStateEnum.Absent;
  2411. else if (!_diRobotBlade2WaferOn.Value && !_diRobotBlade1WaferOn.Value)
  2412. return RobotArmWaferStateEnum.Present;
  2413. else return RobotArmWaferStateEnum.Unknown;
  2414. }
  2415. if (IsWaferPresenceOnBlade1 && IsWaferPresenceOnBlade2)
  2416. {
  2417. return RobotArmWaferStateEnum.Present;
  2418. }
  2419. if ((!IsWaferPresenceOnBlade1) && !IsWaferPresenceOnBlade2)
  2420. {
  2421. return RobotArmWaferStateEnum.Absent;
  2422. }
  2423. }
  2424. return RobotArmWaferStateEnum.Unknown;
  2425. }
  2426. public void NoteError(string errortext)
  2427. {
  2428. OnError(errortext);
  2429. }
  2430. public void SenACK()
  2431. {
  2432. _connection.SendAck();
  2433. }
  2434. public override bool OnActionDone(object[] param)
  2435. {
  2436. BladeTarget = ModuleName.System;
  2437. Blade1Target = ModuleName.System;
  2438. Blade2Target = ModuleName.System;
  2439. IsBusy = false;
  2440. ModuleName sourcemodule;
  2441. if (CurrentParamter != null && CurrentParamter.Length > 2 && Enum.TryParse(CurrentParamter[1].ToString(), out sourcemodule))
  2442. {
  2443. if (ModuleHelper.IsLoadPort(sourcemodule))
  2444. {
  2445. var lp = DEVICE.GetDevice<LoadPortBaseDevice>(sourcemodule.ToString());
  2446. if (lp != null)
  2447. lp.NoteTransferStop();
  2448. }
  2449. }
  2450. if (_lstHandlers.Count == 0)
  2451. {
  2452. IsBusy = false;
  2453. return base.OnActionDone(param);
  2454. }
  2455. return true;
  2456. }
  2457. public override void Terminate()
  2458. {
  2459. _thread.Stop();
  2460. if (!SC.ContainsItem($"{_scRoot}.{Name}.CloseConnectionOnShutDown") || SC.GetValue<bool>($"{_scRoot}.{Name}.CloseConnectionOnShutDown"))
  2461. {
  2462. LOG.Write("Close connection for" + RobotModuleName.ToString());
  2463. _connection.Disconnect();
  2464. }
  2465. base.Terminate();
  2466. }
  2467. private bool _isWaferMatchRecord
  2468. {
  2469. get
  2470. {
  2471. if(GetWaferState(RobotArmEnum.Lower) == RobotArmWaferStateEnum.Present)
  2472. {
  2473. if (WaferManager.Instance.CheckNoWafer(RobotModuleName, 0))
  2474. return false;
  2475. }
  2476. if (GetWaferState(RobotArmEnum.Lower) == RobotArmWaferStateEnum.Absent)
  2477. {
  2478. if (WaferManager.Instance.CheckHasWafer(RobotModuleName, 0))
  2479. return false;
  2480. }
  2481. if (GetWaferState(RobotArmEnum.Upper) == RobotArmWaferStateEnum.Present)
  2482. {
  2483. if (WaferManager.Instance.CheckNoWafer(RobotModuleName, 1))
  2484. return false;
  2485. }
  2486. if (GetWaferState(RobotArmEnum.Upper) == RobotArmWaferStateEnum.Absent)
  2487. {
  2488. if (WaferManager.Instance.CheckHasWafer(RobotModuleName, 1))
  2489. return false;
  2490. }
  2491. return true;
  2492. }
  2493. }
  2494. }
  2495. public class YaskawaTokenGenerator
  2496. {
  2497. private int _last = 0;
  2498. List<int> _pool = new List<int>();
  2499. SCConfigItem scToken = null;
  2500. public int CurrentToken => _last;
  2501. public YaskawaTokenGenerator(string scName)
  2502. {
  2503. scToken = SC.GetConfigItem(scName);
  2504. if (scToken == null)
  2505. _last = scToken.IntValue;
  2506. Random r = new Random();
  2507. _last = r.Next() % 20;
  2508. }
  2509. public int create()
  2510. {
  2511. int first = _last;
  2512. int token = first;
  2513. do
  2514. {
  2515. token = (token + 1) % 100;
  2516. if (_pool.Contains(token))
  2517. continue;
  2518. _pool.Add(token);
  2519. _last = token;
  2520. scToken.IntValue = _last;
  2521. return _last;
  2522. } while (token != first);
  2523. throw (new ExcuteFailedException("Get token failed,pool is full"));
  2524. }
  2525. public void release(int token)
  2526. {
  2527. _pool.Remove(token);
  2528. }
  2529. public void release()
  2530. {
  2531. _last = 0;
  2532. _pool.Clear();
  2533. }
  2534. }
  2535. public enum YaskawaPositonEnum
  2536. {
  2537. RegisteredPosition,
  2538. ReadyPosition,
  2539. IntermediatePosition,
  2540. MappingStartPosition,
  2541. MappingFinishPosition,
  2542. }
  2543. }