GM201LVPRobot.cs 138 KB

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