SIASUNRobot.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. using System;
  2. using System.Collections.Generic;
  3. using Venus_RT.Modules;
  4. using Venus_Core;
  5. using Aitex.Core.RT.SCCore;
  6. using Aitex.Core.Util;
  7. using Aitex.Sorter.Common;
  8. using MECF.Framework.Common.Equipment;
  9. using MECF.Framework.Common.SubstrateTrackings;
  10. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
  11. using Aitex.Core.RT.Log;
  12. using System.Text.RegularExpressions;
  13. using MECF.Framework.Common.CommonData;
  14. using System.Threading;
  15. namespace Venus_RT.Devices
  16. {
  17. class SIASUNRobot : ITransferRobot
  18. {
  19. enum OPStep
  20. {
  21. Idle,
  22. Home,
  23. Goto,
  24. MoveTo,
  25. CheckLoad_ArmA,
  26. CheckLoad_ArmB,
  27. Pick,
  28. Place,
  29. PickExtend,
  30. PickRetract,
  31. PlaceExtent,
  32. PlaceRetract,
  33. }
  34. private RState _status;
  35. private bool _IsHomed;
  36. public RState Status { get { return _status; } }
  37. public bool IsHomed { get { return _IsHomed; } }
  38. public RobotMoveInfo TMRobotMoveInfo { get { return _robotMoveInfo; } }
  39. private readonly AsyncSocket _socket;
  40. private OPStep _currentOP = OPStep.Idle;
  41. private Dictionary<ModuleName, int> _StationNumbers = new Dictionary<ModuleName, int>();
  42. private readonly int _checkLoadStation = 1;
  43. private RobotMoveInfo _robotMoveInfo = new RobotMoveInfo();
  44. private string Hand2Arm(Hand hand) => hand == Hand.Blade1 ? "B" : "A";
  45. private readonly Regex _rex_check_load = new Regex(@"LOAD\s+(A|B)\s+(\w+)\s*");
  46. private readonly Regex _rex_error_code = new Regex(@"_ERR\s+(\d+)\s*");
  47. private const string EOF = "\r\n";
  48. public SIASUNRobot()
  49. {
  50. _socket = new AsyncSocket("", EOF);
  51. _socket.Connect(SC.GetStringValue($"TM.IPAddress"));
  52. _socket.OnDataChanged += OnReceiveMessage;
  53. _socket.OnErrorHappened += OnErrorHappen;
  54. _status = RState.Init;
  55. _IsHomed = false;
  56. _StationNumbers[ModuleName.LLA] = SC.GetValue<int>("TM.LLAStationNumber");
  57. _StationNumbers[ModuleName.LLB] = SC.GetValue<int>("TM.LLBStationNumber");
  58. _StationNumbers[ModuleName.PMA] = SC.GetValue<int>("TM.PMAStationNumber");
  59. _StationNumbers[ModuleName.PMB] = SC.GetValue<int>("TM.PMBStationNumber");
  60. _StationNumbers[ModuleName.PMC] = SC.GetValue<int>("TM.PMCStationNumber");
  61. _StationNumbers[ModuleName.PMD] = SC.GetValue<int>("TM.PMDStationNumber");
  62. _StationNumbers[ModuleName.PME] = SC.GetValue<int>("TM.PMEStationNumber");
  63. _StationNumbers[ModuleName.PMF] = SC.GetValue<int>("TM.PMFStationNumber");
  64. _checkLoadStation = SC.GetValue<int>("TM.CheckLoadStation");
  65. }
  66. public bool Home()
  67. {
  68. _status = RState.Running;
  69. _currentOP = OPStep.Home;
  70. return _SendCommand("HOME ALL");
  71. }
  72. public bool Halt()
  73. {
  74. return _SendCommand("HALT");
  75. }
  76. public bool CheckLoad(Hand hand = Hand.Blade1)
  77. {
  78. if (_currentOP != OPStep.Home && _currentOP != OPStep.CheckLoad_ArmA && CheckRobotStatus() == false)
  79. return false;
  80. _currentOP = hand == Hand.Blade2 ? OPStep.CheckLoad_ArmB : OPStep.CheckLoad_ArmA;
  81. _status = RState.Running;
  82. return _SendCommand($"CHECK LOAD {_checkLoadStation} ARM {Hand2Arm(hand)}");
  83. }
  84. public bool Goto(ModuleName station, int slot, Hand hand)
  85. {
  86. if (CheckRobotStatus() == false)
  87. return false;
  88. _currentOP = OPStep.Goto;
  89. _status = RState.Running;
  90. return _SendCommand($"GOTO N {_StationNumbers[station]} SLOT {slot + 1} ARM {Hand2Arm(hand)}");
  91. }
  92. public bool MoveTo(ModuleName stnFrom, ModuleName stnTo, Hand hand)
  93. {
  94. if (CheckRobotStatus() == false)
  95. return false;
  96. _currentOP = OPStep.MoveTo;
  97. _status = RState.Running;
  98. return _SendCommand($"XFER ARM {Hand2Arm(hand)} {_StationNumbers[stnFrom]} {_StationNumbers[stnTo]}");
  99. }
  100. public bool PickExtend(ModuleName chamber, int slot, Hand hand)
  101. {
  102. if (CheckRobotStatus() == false)
  103. return false;
  104. _currentOP = OPStep.PickExtend;
  105. _status = RState.Running;
  106. SetRobotMovingInfo(RobotAction.Extending, hand, chamber);
  107. return _SendCommand($"PICK {_StationNumbers[chamber]} SLOT {slot + 1} ARM {Hand2Arm(hand)} ENRT NR");
  108. }
  109. public bool PickRetract(ModuleName chamber, int slot, Hand hand)
  110. {
  111. if (CheckRobotStatus() == false)
  112. return false;
  113. _currentOP = OPStep.PickRetract;
  114. _status = RState.Running;
  115. SetRobotMovingInfo(RobotAction.Retracting, hand, chamber);
  116. return _SendCommand($"PICK {_StationNumbers[chamber]} SLOT {slot + 1} ARM {Hand2Arm(hand)} STRT NR");
  117. }
  118. public bool PlaceExtend(ModuleName chamber, int slot, Hand hand)
  119. {
  120. if (CheckRobotStatus() == false)
  121. return false;
  122. _currentOP = OPStep.PlaceExtent;
  123. _status = RState.Running;
  124. SetRobotMovingInfo(RobotAction.Extending, hand, chamber);
  125. return _SendCommand($"PLACE {_StationNumbers[chamber]} SLOT {slot + 1} ARM {Hand2Arm(hand)} ENRT NR");
  126. }
  127. public bool PlaceRetract(ModuleName chamber, int slot, Hand hand)
  128. {
  129. if (CheckRobotStatus() == false)
  130. return false;
  131. _currentOP = OPStep.PlaceExtent;
  132. _status = RState.Running;
  133. SetRobotMovingInfo(RobotAction.Retracting, hand, chamber);
  134. return _SendCommand($"PLACE {_StationNumbers[chamber]} SLOT {slot + 1} ARM {Hand2Arm(hand)} STRT NR");
  135. }
  136. public bool Pick(ModuleName station, int slot, Hand hand)
  137. {
  138. if (CheckRobotStatus() == false)
  139. return false;
  140. _currentOP = OPStep.Pick;
  141. _status = RState.Running;
  142. SetRobotMovingInfo(RobotAction.Picking, hand, station);
  143. return _SendCommand($"PICK {_StationNumbers[station]} SLOT {slot + 1} ARM {Hand2Arm(hand)}");
  144. }
  145. public bool Place(ModuleName station, int slot, Hand hand)
  146. {
  147. if (CheckRobotStatus() == false)
  148. return false;
  149. _currentOP = OPStep.Place;
  150. _status = RState.Running;
  151. SetRobotMovingInfo(RobotAction.Placing, hand, station);
  152. return _SendCommand($"PLACE {_StationNumbers[station]} SLOT {slot + 1} ARM {Hand2Arm(hand)}");
  153. }
  154. private bool _SendCommand(string cmd)
  155. {
  156. LOG.WriteSingeLine(eEvent.INFO_TM_ROBOT, ModuleName.TMRobot, $"Send Command to SIASUN TM Robot: {cmd}");
  157. return _socket.Write(cmd + EOF);
  158. }
  159. private bool CheckRobotStatus()
  160. {
  161. if(Status == RState.Init)
  162. {
  163. LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TMRobot, "TM Robot is not homed, please home first.");
  164. return false;
  165. }
  166. else if(Status == RState.Running)
  167. {
  168. LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TMRobot, "TM Robot is busy, please wait a minute");
  169. return false;
  170. }
  171. else if(Status == RState.Failed || Status == RState.Timeout)
  172. {
  173. LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TMRobot, "TM Robot has a error, please check and fix the hardware issue and home it");
  174. return false;
  175. }
  176. return true;
  177. }
  178. private void OnReceiveMessage(string RevMsg)
  179. {
  180. LOG.WriteSingeLine(eEvent.INFO_TM_ROBOT, ModuleName.TMRobot, $"Receive message from SIASUN TM Robot: {RevMsg}, while {_currentOP}");
  181. if (_rex_error_code.IsMatch(RevMsg))
  182. {
  183. _IsHomed = false;
  184. _status = RState.Failed;
  185. var results = _rex_error_code.Match(RevMsg);
  186. ErrorMessageHandler(results.Groups[1].Value);
  187. return;
  188. }
  189. switch (_currentOP)
  190. {
  191. case OPStep.Goto:
  192. case OPStep.MoveTo:
  193. case OPStep.Pick:
  194. case OPStep.PickExtend:
  195. case OPStep.PickRetract:
  196. case OPStep.Place:
  197. case OPStep.PlaceExtent:
  198. case OPStep.PlaceRetract:
  199. {
  200. if (RevMsg.Trim() == "_RDY" || ( RevMsg.Contains("_RDY") && !RevMsg.Contains("_ERR")))
  201. {
  202. _currentOP = OPStep.Idle;
  203. _status = RState.End;
  204. }
  205. else
  206. {
  207. ReportWrongMsg(RevMsg);
  208. }
  209. if (_currentOP != OPStep.PickExtend && _currentOP != OPStep.PlaceExtent)
  210. SetRobotMovingInfo(RobotAction.None, Hand.Both, ModuleName.TMRobot);
  211. }
  212. break;
  213. case OPStep.Home:
  214. {
  215. if (RevMsg.Trim() == "_RDY")
  216. {
  217. //CheckLoad(Hand.Blade1);
  218. _currentOP = OPStep.Idle;
  219. _status = RState.End;
  220. _IsHomed = true;
  221. }
  222. else
  223. ReportWrongMsg(RevMsg);
  224. }
  225. break;
  226. case OPStep.CheckLoad_ArmA:
  227. {
  228. if(_rex_check_load.IsMatch(RevMsg))
  229. {
  230. GetCheckLoadResult(RevMsg);
  231. CheckLoad(Hand.Blade2);
  232. }
  233. else
  234. ReportWrongMsg(RevMsg);
  235. }
  236. break;
  237. case OPStep.CheckLoad_ArmB:
  238. {
  239. if (_rex_check_load.IsMatch(RevMsg))
  240. {
  241. GetCheckLoadResult(RevMsg);
  242. _currentOP = OPStep.Idle;
  243. _status = RState.End;
  244. _IsHomed = true;
  245. }
  246. }
  247. break;
  248. default:
  249. if (!RevMsg.Contains("_EVENT"))
  250. ReportWrongMsg(RevMsg);
  251. break;
  252. }
  253. }
  254. private void GetCheckLoadResult(string strRev)
  255. {
  256. Match result = _rex_check_load.Match(strRev);
  257. string Arm = result.Groups[1].Value;
  258. string WaferStatus = result.Groups[2].Value;
  259. if(WaferStatus == "ON")
  260. {
  261. WaferManager.Instance.CreateWafer(ModuleName.TMRobot, Arm == "A" ? 0 : 1, Aitex.Core.Common.WaferStatus.Unknown);
  262. }
  263. }
  264. private void OnErrorHappen(ErrorEventArgs args)
  265. {
  266. Singleton<RouteManager>.Instance.TM.PostMsg(TMEntity.MSG.Error);
  267. LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TMRobot, $"SIASUN TM Robot Error: {args.Reason} while {_currentOP}");
  268. }
  269. private void ReportWrongMsg(string revMsg)
  270. {
  271. LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TMRobot, $"Receive wrong message:{revMsg} while {_currentOP}");
  272. }
  273. private void ErrorMessageHandler(string errCode)
  274. {
  275. int ErrCode;
  276. string ErrorInfo;
  277. if(int.TryParse(errCode, out ErrCode))
  278. {
  279. switch (ErrCode)
  280. {
  281. // 系统及硬件错误信息
  282. case 901:
  283. ErrorInfo = $"_Err {errCode}: 主电柜急停启动";
  284. break;
  285. case 902:
  286. ErrorInfo = $"_Err {errCode}: 示教盒急停启动";
  287. break;
  288. case 862:
  289. ErrorInfo = $"_Err {errCode}: 驱动器 RDY 信号断开";
  290. break;
  291. // 执行错误信息
  292. case 3001:
  293. ErrorInfo = $"_Err {errCode}: 系统发生碰撞,按取消恢复";
  294. break;
  295. case 7300:
  296. ErrorInfo = $"_Err {errCode}: 旋转信号不允许";
  297. break;
  298. case 7301:
  299. ErrorInfo = $"_Err {errCode}: 伸缩信号不允许";
  300. break;
  301. case 2200:
  302. ErrorInfo = $"_Err {errCode}: 输出端口 NO.不存在";
  303. break;
  304. case 3100:
  305. ErrorInfo = $"_Err {errCode}: 关节 N 位置超界";
  306. break;
  307. case 3120:
  308. ErrorInfo = $"_Err {errCode}: 关节 N 速度超界";
  309. break;
  310. case 100:
  311. ErrorInfo = $"_Err {errCode}: 手臂电源上电失败(手臂电源未打开)";
  312. break;
  313. // 通信错误信息
  314. case 7307:
  315. ErrorInfo = $"_Err {errCode}: GOTO 工位号超范围";
  316. break;
  317. case 7308:
  318. ErrorInfo = $"_Err {errCode}: 不支持的传感器类型";
  319. break;
  320. case 7312:
  321. ErrorInfo = $"_Err {errCode}: PICK工位号超范围";
  322. break;
  323. case 7313:
  324. ErrorInfo = $"_Err {errCode}: PLACE工位号超范围";
  325. break;
  326. case 7314:
  327. ErrorInfo = $"_Err {errCode}: XFER工位号超范围";
  328. break;
  329. case 7315:
  330. ErrorInfo = $"_Err {errCode}: REMOVE不支持的IO类型";
  331. break;
  332. case 7316:
  333. ErrorInfo = $"_Err {errCode}: RQ INTLCK不识别的参数";
  334. break;
  335. case 7317:
  336. ErrorInfo = $"_Err {errCode}: RQ IO不识别的参数";
  337. break;
  338. case 7319:
  339. ErrorInfo = $"_Err {errCode}: RQ STN工位号超范围";
  340. break;
  341. case 7320:
  342. ErrorInfo = $"_Err {errCode}: wafre(WAF_SEN)参数未设置";
  343. break;
  344. case 7321:
  345. ErrorInfo = $"_Err {errCode}: wafex(RETRACT_PIN)参数未设置";
  346. break;
  347. case 7322:
  348. ErrorInfo = $"_Err {errCode}: svlv(SBIT_SVLV_SEN)参数未设置";
  349. break;
  350. case 7323:
  351. ErrorInfo = $"_Err {errCode}: ens(EX_ENABLE)参数未设置";
  352. break;
  353. case 7324:
  354. ErrorInfo = $"_Err {errCode}: RQ命令不支持的参数";
  355. break;
  356. case 7325:
  357. ErrorInfo = $"_Err {errCode}: SET INTLOCK WAF_SEN参数错";
  358. break;
  359. case 7326:
  360. ErrorInfo = $"_Err {errCode}: SET INTLOCK RZ参数错";
  361. break;
  362. case 7327:
  363. ErrorInfo = $"_Err {errCode}: SET INTLOCK参数错";
  364. break;
  365. case 7328:
  366. ErrorInfo = $"_Err {errCode}: SET IO ECHO参数错";
  367. break;
  368. case 7329:
  369. ErrorInfo = $"_Err {errCode}: SET IO STATE不支持";
  370. break;
  371. case 7330:
  372. ErrorInfo = $"_Err {errCode}: SET IO不支持的参数";
  373. break;
  374. case 7331:
  375. ErrorInfo = $"_Err {errCode}: SET STN工位号超范围";
  376. break;
  377. case 7332:
  378. ErrorInfo = $"_Err {errCode}: 手臂参数读取错误";
  379. break;
  380. case 7333:
  381. ErrorInfo = $"_Err {errCode}: WAF_SEN不识别的参数";
  382. break;
  383. case 7334:
  384. ErrorInfo = $"_Err {errCode}: SET不支持的传感器类型";
  385. break;
  386. case 7335:
  387. ErrorInfo = $"_Err {errCode}: SET 指令输入不完整";
  388. break;
  389. case 7336:
  390. ErrorInfo = $"_Err {errCode}: STORE IO命令不支持该参数";
  391. break;
  392. case 7337:
  393. ErrorInfo = $"_Err {errCode}: STORE LOAD命令不支持该参数";
  394. break;
  395. case 7338:
  396. ErrorInfo = $"_Err {errCode}: STORE STN指令工位号大于20";
  397. break;
  398. case 7339:
  399. ErrorInfo = $"_Err {errCode}: STORE STN命令手臂参数错误";
  400. break;
  401. case 7340:
  402. ErrorInfo = $"_Err {errCode}: STORE不支持的传感器类型";
  403. break;
  404. case 7341:
  405. ErrorInfo = $"_Err {errCode}: STORE指令输入不完整";
  406. break;
  407. case 7342:
  408. ErrorInfo = $"_Err {errCode}: 无法识别的命令";
  409. break;
  410. case 7343:
  411. ErrorInfo = $"_Err {errCode}: HOME参数未指定";
  412. break;
  413. case 7344:
  414. ErrorInfo = $"_Err {errCode}: GOTO指令R轴参数未指定";
  415. break;
  416. case 7345:
  417. ErrorInfo = $"_Err {errCode}: GOTO指令Z轴参数未指定";
  418. break;
  419. case 7346:
  420. ErrorInfo = $"_Err {errCode}: ARM参数错误";
  421. break;
  422. case 7347:
  423. ErrorInfo = $"_Err {errCode}: GOTO指令未指定参数";
  424. break;
  425. case 7349:
  426. ErrorInfo = $"_Err {errCode}: MOVE指令未指定模式或轴";
  427. break;
  428. case 7350:
  429. ErrorInfo = $"_Err {errCode}: MOVE 指令中字段名字错";
  430. break;
  431. case 7351:
  432. ErrorInfo = $"_Err {errCode}: PICK未指定参数";
  433. break;
  434. case 7352:
  435. ErrorInfo = $"_Err {errCode}: PLACE未指定参数";
  436. break;
  437. case 7353:
  438. ErrorInfo = $"_Err {errCode}: REMOVE未指定参数";
  439. break;
  440. case 7354:
  441. ErrorInfo = $"_Err {errCode}: 指令执行未结束";
  442. break;
  443. case 7355:
  444. ErrorInfo = $"_Err {errCode}: GOTO指令未指定工位号";
  445. break;
  446. case 7356:
  447. ErrorInfo = $"_Err {errCode}: PICK指令未指定工位号";
  448. break;
  449. case 7357:
  450. ErrorInfo = $"_Err {errCode}: PLACE指令未指定工位号";
  451. break;
  452. case 7358:
  453. ErrorInfo = $"_Err {errCode}: ABS未指定数值";
  454. break;
  455. case 7359:
  456. ErrorInfo = $"_Err {errCode}: REL未指定数值";
  457. break;
  458. case 7360:
  459. ErrorInfo = $"_Err {errCode}: 没有指定主程序";
  460. break;
  461. case 7361:
  462. ErrorInfo = $"_Err {errCode}: 当前没有打开作业";
  463. break;
  464. case 7362:
  465. ErrorInfo = $"_Err {errCode}: 当前作业不是主作业";
  466. break;
  467. case 7363:
  468. ErrorInfo = $"_Err {errCode}: ex_ena(EX_ENABLE_SEN)参数未设置";
  469. break;
  470. case 7364:
  471. ErrorInfo = $"_Err {errCode}: stable(STABLE_ SIGNAL)参数未设置";
  472. break;
  473. case 7365:
  474. ErrorInfo = $"_Err {errCode}: VIA参数设置有误";
  475. break;
  476. case 7366:
  477. ErrorInfo = $"_Err {errCode}: 系统处于非启动状态";
  478. break;
  479. case 7367:
  480. ErrorInfo = $"_Err {errCode}: extend(EX_SIGNAL)参数未设置";
  481. break;
  482. case 7368:
  483. ErrorInfo = $"_Err {errCode}: retract(RE_ SIGNAL)参数未设置";
  484. break;
  485. case 7371:
  486. ErrorInfo = $"_Err {errCode}: place动作前:未检测到晶圆";
  487. break;
  488. case 7372:
  489. ErrorInfo = $"_Err {errCode}: pick动作前:检测到晶圆";
  490. break;
  491. case 7373:
  492. ErrorInfo = $"_Err {errCode}: place动作后:检测到晶圆";
  493. break;
  494. case 7374:
  495. ErrorInfo = $"_Err {errCode}: pick动作后:未检测到晶圆";
  496. break;
  497. case 7375:
  498. ErrorInfo = $"_Err {errCode}: 系统未上电或当前不是执行模式";
  499. break;
  500. case 7376:
  501. ErrorInfo = $"_Err {errCode}: 参数中存在非数字";
  502. break;
  503. case 7385:
  504. ErrorInfo = $"_Err {errCode}: 驱动器异常停止";
  505. break;
  506. case 7387:
  507. ErrorInfo = $"_Err {errCode}: 驱动器ID1报警";
  508. break;
  509. case 7388:
  510. ErrorInfo = $"_Err {errCode}: 驱动器ID2报警";
  511. break;
  512. case 7389:
  513. ErrorInfo = $"_Err {errCode}: 驱动器ID3报警";
  514. break;
  515. case 7391:
  516. ErrorInfo = $"_Err {errCode}: AWC工位号超范围";
  517. break;
  518. case 7392:
  519. ErrorInfo = $"_Err {errCode}: 偏差过大AWC报警";
  520. break;
  521. case 7393:
  522. ErrorInfo = $"_Err {errCode}: 标定失败,请重新标定";
  523. break;
  524. case 7398:
  525. ErrorInfo = $"_Err {errCode}: 触发点计算半径有误";
  526. break;
  527. case 7399:
  528. ErrorInfo = $"_Err {errCode}: 驱动器锁存AWC数据个数有误";
  529. break;
  530. case 7401:
  531. ErrorInfo = $"_Err {errCode}: 手指上可能有晶圆";
  532. break;
  533. case 7402:
  534. ErrorInfo = $"_Err {errCode}: 手指上可能无晶圆";
  535. break;
  536. case 7403:
  537. ErrorInfo = $"_Err {errCode}: load当前状态为ON,不正确";
  538. break;
  539. case 7404:
  540. ErrorInfo = $"_Err {errCode}: load当前状态为OFF,不正确";
  541. break;
  542. case 7405:
  543. ErrorInfo = $"_Err {errCode}: 当前slot不存在!";
  544. break;
  545. case 7495:
  546. ErrorInfo = $"_Err {errCode}: ID1码盘反馈错误";
  547. break;
  548. case 7496:
  549. ErrorInfo = $"_Err {errCode}: ID2码盘反馈错误";
  550. break;
  551. case 7497:
  552. ErrorInfo = $"_Err {errCode}: ID3码盘反馈错误";
  553. break;
  554. default:
  555. ErrorInfo = $"_Err {errCode}: 不能识别的错误码";
  556. break;
  557. }
  558. LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TMRobot, ErrorInfo);
  559. }
  560. else
  561. {
  562. LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TMRobot, $"Try Parse the receive error code faild:{errCode}");
  563. }
  564. }
  565. public void SetRobotMovingInfo(RobotAction action, Hand hand, ModuleName target)
  566. {
  567. _robotMoveInfo.Action = action;
  568. _robotMoveInfo.ArmTarget = hand == Hand.Blade1 ? RobotArm.ArmA : (hand == Hand.Both ? RobotArm.Both : RobotArm.ArmB);
  569. _robotMoveInfo.BladeTarget = $"{_robotMoveInfo.ArmTarget}.{target}";
  570. }
  571. }
  572. }