JelC5000RobotFlippeV1.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO.Ports;
  4. using System.Linq;
  5. using System.Text;
  6. using Aitex.Core.Common.DeviceData;
  7. using Aitex.Core.RT.Device;
  8. using Aitex.Core.RT.Device.Unit;
  9. using Aitex.Core.RT.Event;
  10. using Aitex.Core.RT.Log;
  11. using Aitex.Core.RT.OperationCenter;
  12. using Aitex.Core.RT.SCCore;
  13. using Aitex.Core.Util;
  14. using MECF.Framework.Common.Communications;
  15. using MECF.Framework.Common.Device.Bases;
  16. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Common;
  17. using Newtonsoft.Json;
  18. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
  19. using MECF.Framework.Common.Equipment;
  20. using MECF.Framework.Common.SubstrateTrackings;
  21. using System.Threading;
  22. using Aitex.Core.Common;
  23. using Aitex.Core.RT.DataCenter;
  24. using System.Text.RegularExpressions;
  25. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  26. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
  27. using MECF.Framework.Common.CommonData;
  28. using Aitex.Core.RT.IOCore;
  29. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Flipper.FlipperBase;
  30. namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.JEL
  31. {
  32. public class JelC5000RobotFlippeV1 : JelC5000RobotFlippe
  33. {
  34. public JelC5000RobotFlippeV1(string module, string name, string scRoot, AOAccessor aoBladeRegulator, string robotModel = "")
  35. : base(module, name, scRoot, aoBladeRegulator, robotModel = "")
  36. {
  37. }
  38. private int _defaultRegulatorRatio
  39. {
  40. get
  41. {
  42. if (SC.ContainsItem($"Robot.{Name}.DefaultRegulatorRatio"))
  43. return SC.GetValue<int>($"Robot.{Name}.DefaultRegulatorRatio");
  44. return 0;
  45. }
  46. }
  47. protected override bool fStartInit(object[] param)
  48. {
  49. //string speedtype = string.Empty;
  50. //if (param != null && param.Length >0)
  51. // speedtype = Regex.Replace(param[0].ToString().Replace("(", "(").Replace(")", ")"), @"\([^\(]*\)", "");
  52. //if (speedtype != "" && speedtype != "M" && speedtype != "L") return false;
  53. _dtActionStart = DateTime.Now;
  54. int compaundcmdNO = SC.GetValue<int>($"Robot.{Name}.InitCmdNO");
  55. int Robotspeed = SC.GetValue<int>($"Robot.{Name}.RobotSpeed");
  56. if (Robotspeed < 0)
  57. Robotspeed = 0;
  58. if (Robotspeed > 99)
  59. Robotspeed = 99;
  60. lock (_locker)
  61. {
  62. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeCompaundCommandHandler(this, compaundcmdNO.ToString()));
  63. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, ""));
  64. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "G"));
  65. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "BC")); // Read bank number
  66. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "WCP")); // Read Cassette Number
  67. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "6", "1"));
  68. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "6", "2"));
  69. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "6", "3"));
  70. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "6", "4"));
  71. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "6", "X"));
  72. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "6", "Y"));
  73. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "6", "U"));
  74. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "6", "Z"));
  75. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeSetHandler(this, "SPA", Robotspeed.ToString()));
  76. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "SPA"));
  77. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, $"C5", null, 2));
  78. }
  79. _aoBladeRegulator.Value = (short)(_defaultRegulatorRatio*100);
  80. return true;
  81. }
  82. protected override bool fStartUnGrip(object[] param)
  83. {
  84. if (param == null || param.Length < 1) return false;
  85. RobotArmEnum arm = (RobotArmEnum)((int)param[0]);
  86. lock (_locker)
  87. {
  88. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeSetHandler(this, "DS", "10"));
  89. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeSetHandler(this, "WS", "0"));
  90. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, ""));
  91. }
  92. return true;
  93. }
  94. protected override bool fMonitorUnGrip(object[] param)
  95. {
  96. IsBusy = false;
  97. if (_lstMonitorHandler.Count == 0 && !_connection.IsBusy)
  98. {
  99. if (JelC5000RobotStatus != JelAxisStatus.NormalEnd
  100. || AxisStatus != JelAxisStatus.NormalEnd)
  101. {
  102. lock (_locker)
  103. {
  104. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, ""));
  105. //_lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, $"CS{_lowerArmWaferSensorIndex}"));
  106. }
  107. return false;
  108. }
  109. RobotArmEnum arm = (RobotArmEnum)((int)CurrentParamter[0]);
  110. //if(IsVacuumSensorON)
  111. // HandlerError("UnGrip wafer failed!");
  112. IsBusy = false;
  113. return true;
  114. }
  115. return false;
  116. }
  117. protected override bool fStartGrip(object[] param)
  118. {
  119. if (param == null || param.Length < 1) return false;
  120. RobotArmEnum arm = (RobotArmEnum)((int)param[0]);
  121. lock (_locker)
  122. {
  123. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeSetHandler(this, "DS", "11"));
  124. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeSetHandler(this, "WS", "1"));
  125. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, ""));
  126. }
  127. return true;
  128. }
  129. protected override bool fMonitorGrip(object[] param)
  130. {
  131. IsBusy = false;
  132. if (_lstMonitorHandler.Count == 0 && !_connection.IsBusy)
  133. {
  134. if (JelC5000RobotStatus != JelAxisStatus.NormalEnd
  135. || AxisStatus != JelAxisStatus.NormalEnd)
  136. {
  137. lock (_locker)
  138. {
  139. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, ""));
  140. }
  141. return false;
  142. }
  143. //if (!IsVacuumSensorON)
  144. // HandlerError("UnGrip wafer failed!");
  145. IsBusy = false;
  146. return true;
  147. }
  148. return false;
  149. }
  150. protected override bool fStartPickWafer(object[] param)
  151. {
  152. _dtActionStart = DateTime.Now;
  153. try
  154. {
  155. //RobotArmEnum arm = (RobotArmEnum)param[0];
  156. ModuleName tempmodule = (ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString());
  157. int slotindex = int.Parse(param[2].ToString());
  158. //JelC5000RobotArm jelarm = (JelC5000RobotArm)(int)arm;
  159. var wz = WaferManager.Instance.GetWaferSize(tempmodule, slotindex);
  160. if (!GetBankAndCassetteNumber(tempmodule, wz, false, out int bankno, out int cassetteNO))
  161. {
  162. EV.PostAlarmLog("Robot", $"{RobotModuleName} can't find the bankno or cassette no for {tempmodule}");
  163. OnError("ParseStationError");
  164. return false;
  165. }
  166. int compaundcmdNO = SC.GetValue<int>($"Robot.{Name}.PickCmdNO");
  167. int compaundcmdNOforSafe = SC.GetValue<int>($"Robot.{Name}.SafeCmdNO");
  168. if (!ModuleHelper.IsLoadPort(tempmodule) && Blade1ActionPosture == BladePostureEnum.Degree180)
  169. {
  170. if (!GetBankAndCassetteNumber(tempmodule, wz, true, out bankno, out cassetteNO))
  171. {
  172. EV.PostAlarmLog("Robot", $"{RobotModuleName} can't find the bankno or cassette no for {tempmodule}");
  173. OnError("ParseStationError");
  174. return false;
  175. }
  176. compaundcmdNO = SC.GetValue<int>($"Robot.{Name}.OverPickCmdNO");
  177. compaundcmdNOforSafe = SC.GetValue<int>($"Robot.{Name}.SafeCmdNO");
  178. }
  179. if (ModuleHelper.IsLoadPort(tempmodule))
  180. {
  181. var lp = DEVICE.GetDevice<LoadPortBaseDevice>(tempmodule.ToString());
  182. if (lp != null)
  183. lp.NoteTransferStart();
  184. }
  185. lock (_locker)
  186. {
  187. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "BC"));
  188. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "WCP"));
  189. }
  190. DateTime readstarttime = DateTime.Now;
  191. while (_lstMonitorHandler.Count != 0 || _connection.IsBusy)
  192. {
  193. if (DateTime.Now - readstarttime > TimeSpan.FromSeconds(20))
  194. {
  195. OnError("Read bankno and cassette no for pick Timeout.");
  196. return false;
  197. }
  198. }
  199. lock (_locker)
  200. {
  201. if (LastTargeModule != tempmodule)//(ReadBankNumber != bankno.ToString("X") || cassetteNO != ReadCassetNumber)
  202. {
  203. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeCompaundCommandHandler(this, compaundcmdNOforSafe.ToString()));
  204. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "G"));
  205. }
  206. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeSetHandler(this, "BC", bankno.ToString("X")));
  207. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeSetHandler(this, "WCP", cassetteNO.ToString()));
  208. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeSetHandler(this, "WCD", (slotindex + 1).ToString()));
  209. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "BC"));
  210. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "WCP"));
  211. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeCompaundCommandHandler(this, compaundcmdNO.ToString()));
  212. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "G"));
  213. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, $"C5",null,2));
  214. }
  215. Blade1Target = tempmodule;
  216. Blade2Target = tempmodule;
  217. CmdTarget = tempmodule;
  218. LastTargeModule = tempmodule;
  219. MoveInfo = new RobotMoveInfo()
  220. {
  221. Action = RobotAction.Picking,
  222. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  223. BladeTarget = BuildBladeTarget(),
  224. };
  225. }
  226. catch (Exception ex)
  227. {
  228. string reason = "";
  229. if (param != null)
  230. {
  231. foreach (var strpara in param)
  232. reason += strpara.ToString();
  233. }
  234. LOG.Write(ex);
  235. OnError($"{Name} Pick command valid:" + reason);
  236. return false;
  237. }
  238. return true;
  239. }
  240. protected override bool fStartPlaceWafer(object[] param)
  241. {
  242. _dtActionStart = DateTime.Now;
  243. try
  244. {
  245. RobotArmEnum arm = (RobotArmEnum)param[0];
  246. ModuleName tempmodule = (ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString());
  247. int slotindex = int.Parse(param[2].ToString());
  248. //JelC5000RobotArm jelarm = (JelC5000RobotArm)(int)arm;
  249. var wz = WaferManager.Instance.GetWaferSize(RobotModuleName, arm == RobotArmEnum.Both ? 0 : (int)arm);
  250. int wzindex = 0;
  251. if (!GetBankAndCassetteNumber(tempmodule, wz, false, out int bankno, out int cassetteNO))
  252. {
  253. EV.PostAlarmLog("Robot", $"{RobotModuleName} can't find the bankno or cassette no for {tempmodule}");
  254. OnError("ParseStationError");
  255. return false;
  256. }
  257. int compaundcmdNO = SC.GetValue<int>($"Robot.{Name}.PlaceCmdNO");
  258. int compaundcmdNOforSafe = SC.GetValue<int>($"Robot.{Name}.SafeCmdNO");
  259. if (!ModuleHelper.IsLoadPort(tempmodule) && Blade1ActionPosture == BladePostureEnum.Degree180)
  260. {
  261. if (!GetBankAndCassetteNumber(tempmodule, wz, true, out bankno, out cassetteNO))
  262. {
  263. EV.PostAlarmLog("Robot", $"{RobotModuleName} can't find the bankno or cassette no for {tempmodule}");
  264. OnError("ParseStationError");
  265. return false;
  266. }
  267. compaundcmdNO = SC.GetValue<int>($"Robot.{Name}.OverPlaceCmdNO");
  268. compaundcmdNOforSafe = SC.GetValue<int>($"Robot.{Name}.SafeCmdNO");
  269. }
  270. lock (_locker)
  271. {
  272. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "BC"));
  273. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "WCP"));
  274. }
  275. DateTime readstarttime = DateTime.Now;
  276. while (_lstMonitorHandler.Count != 0 || _connection.IsBusy)
  277. {
  278. if (DateTime.Now - readstarttime > TimeSpan.FromSeconds(10))
  279. {
  280. OnError("Read bankno and cassette no for place Timeout.");
  281. return false;
  282. }
  283. }
  284. if (ModuleHelper.IsLoadPort(tempmodule))
  285. {
  286. var lp = DEVICE.GetDevice<LoadPortBaseDevice>(tempmodule.ToString());
  287. if (lp != null)
  288. lp.NoteTransferStart();
  289. }
  290. lock (_locker)
  291. {
  292. if (LastTargeModule != tempmodule) //(ReadBankNumber != bankno.ToString("X") || cassetteNO != ReadCassetNumber)
  293. {
  294. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeCompaundCommandHandler(this, compaundcmdNOforSafe.ToString()));
  295. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "G"));
  296. }
  297. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeSetHandler(this, "BC", bankno.ToString("X")));
  298. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeSetHandler(this, "WCP", cassetteNO.ToString()));
  299. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeSetHandler(this, "WCD", (slotindex + 1).ToString()));
  300. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "BC"));
  301. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "WCP"));
  302. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeCompaundCommandHandler(this, compaundcmdNO.ToString()));
  303. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "G"));
  304. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, $"C5", null, 2));
  305. }
  306. Blade1Target = tempmodule;
  307. Blade2Target = tempmodule;
  308. CmdTarget = tempmodule;
  309. LastTargeModule = tempmodule;
  310. MoveInfo = new RobotMoveInfo()
  311. {
  312. Action = RobotAction.Placing,
  313. ArmTarget = RobotArm.Both, // CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  314. BladeTarget = BuildBladeTarget(),
  315. };
  316. }
  317. catch (Exception ex)
  318. {
  319. string reason = "";
  320. if (param != null)
  321. foreach (var strpara in param)
  322. reason += strpara.ToString();
  323. OnError($"{Name} place command valid:" + reason);
  324. LOG.Write(ex);
  325. return false;
  326. }
  327. return true;
  328. }
  329. protected override bool fMonitorPlace(object[] param)
  330. {
  331. IsBusy = false;
  332. if (DateTime.Now - _dtActionStart > TimeSpan.FromSeconds(RobotCommandTimeout))
  333. {
  334. OnError("Place wafer timeout");
  335. return true;
  336. }
  337. if (_lstMonitorHandler.Count == 0 && !_connection.IsBusy)
  338. {
  339. if (CurrentCompoundCommandStatus == JelCommandStatus.NormalEnd)
  340. {
  341. RobotArmEnum arm = (RobotArmEnum)CurrentParamter[0];
  342. ModuleName sourcemodule;
  343. if (!Enum.TryParse(CurrentParamter[1].ToString(), out sourcemodule)) return false;
  344. int Sourceslotindex;
  345. if (!int.TryParse(CurrentParamter[2].ToString(), out Sourceslotindex)) return false;
  346. if (IsVacuumSensorON)
  347. {
  348. OnError("Vacuum sensor on blade is ON");
  349. return false;
  350. }
  351. WaferManager.Instance.WaferMoved(RobotModuleName, 0, sourcemodule, Sourceslotindex);
  352. if(Blade1ActionPosture == BladePostureEnum.Degree180)
  353. WaferManager.Instance.UpdateWaferTurnOver(sourcemodule, Sourceslotindex);
  354. Blade1Target = ModuleName.System;
  355. Blade2Target = ModuleName.System;
  356. if (ModuleHelper.IsLoadPort(sourcemodule))
  357. {
  358. var lp = DEVICE.GetDevice<LoadPortBaseDevice>(sourcemodule.ToString());
  359. if (lp != null)
  360. lp.NoteTransferStop();
  361. }
  362. IsBusy = false;
  363. CmdTarget = ModuleName.System;
  364. MoveInfo = new RobotMoveInfo()
  365. {
  366. Action = RobotAction.Picking,
  367. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  368. BladeTarget = BuildBladeTarget(),
  369. };
  370. return true;
  371. }
  372. if (CurrentCompoundCommandStatus == JelCommandStatus.InError)
  373. {
  374. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "GER"));
  375. HandlerError("PlaceFailed");
  376. }
  377. }
  378. return false;
  379. }
  380. protected override bool fMonitorPick(object[] param)
  381. {
  382. IsBusy = false;
  383. if (DateTime.Now - _dtActionStart > TimeSpan.FromSeconds(RobotCommandTimeout))
  384. {
  385. OnError("Pick wafer timeout");
  386. return true;
  387. }
  388. if (_lstMonitorHandler.Count == 0 && !_connection.IsBusy)
  389. {
  390. if (CurrentCompoundCommandStatus == JelCommandStatus.NormalEnd)
  391. {
  392. RobotArmEnum arm = (RobotArmEnum)CurrentParamter[0];
  393. ModuleName sourcemodule;
  394. if (!Enum.TryParse(CurrentParamter[1].ToString(), out sourcemodule)) return false;
  395. int SourceslotIndex;
  396. if (!int.TryParse(CurrentParamter[2].ToString(), out SourceslotIndex)) return false;
  397. if (!IsVacuumSensorON)
  398. {
  399. OnError("Vacuum sensor is not ON");
  400. return false;
  401. }
  402. WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 0);
  403. if(Blade1ActionPosture == BladePostureEnum.Degree180)
  404. WaferManager.Instance.UpdateWaferTurnOver(RobotModuleName, 0);
  405. //if (arm == RobotArmEnum.Lower)
  406. //WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 0);
  407. //if (arm == RobotArmEnum.Upper)
  408. // WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 1);
  409. //if (arm == RobotArmEnum.Both)
  410. //{
  411. // WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 0);
  412. // WaferManager.Instance.WaferMoved(sourcemodule, SourceslotIndex, RobotModuleName, 1);
  413. //}
  414. Blade1Target = ModuleName.System;
  415. Blade2Target = ModuleName.System;
  416. if (ModuleHelper.IsLoadPort(sourcemodule))
  417. {
  418. var lp = DEVICE.GetDevice<LoadPortBaseDevice>(sourcemodule.ToString());
  419. if (lp != null)
  420. lp.NoteTransferStop();
  421. }
  422. IsBusy = false;
  423. CmdTarget = ModuleName.System;
  424. MoveInfo = new RobotMoveInfo()
  425. {
  426. Action = RobotAction.Picking,
  427. ArmTarget = CmdRobotArm == RobotArmEnum.Lower ? RobotArm.ArmA : RobotArm.ArmB,
  428. BladeTarget = BuildBladeTarget(),
  429. };
  430. return true;
  431. }
  432. if (CurrentCompoundCommandStatus == JelCommandStatus.InError)
  433. {
  434. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "GER"));
  435. OnError("Compaund Comand execution failed");
  436. }
  437. else
  438. {
  439. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, "G"));
  440. _lstMonitorHandler.AddLast(new JelC5000RobotFlippeReadHandler(this, $"CS{_lowerArmWaferSensorIndex}"));
  441. }
  442. }
  443. return false;
  444. }
  445. public override void ParseData(string command, string parameter, string data)
  446. {
  447. try
  448. {
  449. string datavalue = data.Replace($"${BodyNumber}", "").Replace("\r", "").Replace($"$2", "");
  450. if (command.Contains($"C5"))
  451. {
  452. IsVacuumSensorON = datavalue == "1";
  453. }
  454. base.ParseData(command, parameter, data);
  455. }
  456. catch (Exception ex)
  457. {
  458. LOG.Write($"Parse {command}.{parameter ?? parameter} data {data} error:" + ex.ToString());
  459. OnError($"Parse data error:{command}.{parameter ?? parameter} data {data}");
  460. }
  461. }
  462. public override WaferSize GetCurrentWaferSize()
  463. {
  464. if (WaferManager.Instance.CheckHasWafer(RobotModuleName, 0))
  465. return WaferManager.Instance.GetWaferSize(RobotModuleName, 0);
  466. return WaferSize.WS8;
  467. }
  468. }
  469. }