SIASUNRobot.cs 25 KB

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