GM201LVPRobot.cs 137 KB

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