SIASUNRobot.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  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 ? "A" : "B";
  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");
  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");
  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");
  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");
  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")
  201. {
  202. _currentOP = OPStep.Idle;
  203. _status = RState.End;
  204. }
  205. else
  206. ReportWrongMsg(RevMsg);
  207. if (_currentOP != OPStep.PickExtend && _currentOP != OPStep.PlaceExtent)
  208. SetRobotMovingInfo(RobotAction.None, Hand.Both, ModuleName.TMRobot);
  209. }
  210. break;
  211. case OPStep.Home:
  212. {
  213. if (RevMsg.Trim() == "_RDY")
  214. {
  215. //CheckLoad(Hand.Blade1);
  216. _currentOP = OPStep.Idle;
  217. _status = RState.End;
  218. _IsHomed = true;
  219. }
  220. else
  221. ReportWrongMsg(RevMsg);
  222. }
  223. break;
  224. case OPStep.CheckLoad_ArmA:
  225. {
  226. if(_rex_check_load.IsMatch(RevMsg))
  227. {
  228. GetCheckLoadResult(RevMsg);
  229. CheckLoad(Hand.Blade2);
  230. }
  231. else
  232. ReportWrongMsg(RevMsg);
  233. }
  234. break;
  235. case OPStep.CheckLoad_ArmB:
  236. {
  237. if (_rex_check_load.IsMatch(RevMsg))
  238. {
  239. GetCheckLoadResult(RevMsg);
  240. _currentOP = OPStep.Idle;
  241. _status = RState.End;
  242. _IsHomed = true;
  243. }
  244. }
  245. break;
  246. default:
  247. ReportWrongMsg(RevMsg);
  248. break;
  249. }
  250. }
  251. private void GetCheckLoadResult(string strRev)
  252. {
  253. Match result = _rex_check_load.Match(strRev);
  254. string Arm = result.Groups[1].Value;
  255. string WaferStatus = result.Groups[2].Value;
  256. if(WaferStatus == "ON")
  257. {
  258. WaferManager.Instance.CreateWafer(ModuleName.TMRobot, Arm == "A" ? 0 : 1, Aitex.Core.Common.WaferStatus.Unknown);
  259. }
  260. }
  261. private void OnErrorHappen(ErrorEventArgs args)
  262. {
  263. Singleton<RouteManager>.Instance.TM.PostMsg(TMEntity.MSG.Error);
  264. LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TMRobot, $"SIASUN TM Robot Error: {args.Reason} while {_currentOP}");
  265. }
  266. private void ReportWrongMsg(string revMsg)
  267. {
  268. LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TMRobot, $"Receive wrong message:{revMsg} while {_currentOP}");
  269. }
  270. private void ErrorMessageHandler(string errCode)
  271. {
  272. int ErrCode;
  273. string ErrorInfo;
  274. if(int.TryParse(errCode, out ErrCode))
  275. {
  276. switch (ErrCode)
  277. {
  278. // 系统及硬件错误信息
  279. case 901:
  280. ErrorInfo = $"_Err {errCode}: 主电柜急停启动";
  281. break;
  282. case 902:
  283. ErrorInfo = $"_Err {errCode}: 示教盒急停启动";
  284. break;
  285. case 862:
  286. ErrorInfo = $"_Err {errCode}: 驱动器 RDY 信号断开";
  287. break;
  288. // 执行错误信息
  289. case 3001:
  290. ErrorInfo = $"_Err {errCode}: 系统发生碰撞,按取消恢复";
  291. break;
  292. case 7300:
  293. ErrorInfo = $"_Err {errCode}: 旋转信号不允许";
  294. break;
  295. case 7301:
  296. ErrorInfo = $"_Err {errCode}: 伸缩信号不允许";
  297. break;
  298. case 2200:
  299. ErrorInfo = $"_Err {errCode}: 输出端口 NO.不存在";
  300. break;
  301. case 3100:
  302. ErrorInfo = $"_Err {errCode}: 关节 N 位置超界";
  303. break;
  304. case 3120:
  305. ErrorInfo = $"_Err {errCode}: 关节 N 速度超界";
  306. break;
  307. case 100:
  308. ErrorInfo = $"_Err {errCode}: 手臂电源上电失败(手臂电源未打开)";
  309. break;
  310. // 通信错误信息
  311. case 7307:
  312. ErrorInfo = $"_Err {errCode}: GOTO 工位号超范围";
  313. break;
  314. case 7308:
  315. ErrorInfo = $"_Err {errCode}: 不支持的传感器类型";
  316. break;
  317. case 7312:
  318. ErrorInfo = $"_Err {errCode}: PICK工位号超范围";
  319. break;
  320. case 7313:
  321. ErrorInfo = $"_Err {errCode}: PLACE工位号超范围";
  322. break;
  323. case 7314:
  324. ErrorInfo = $"_Err {errCode}: XFER工位号超范围";
  325. break;
  326. case 7315:
  327. ErrorInfo = $"_Err {errCode}: REMOVE不支持的IO类型";
  328. break;
  329. case 7316:
  330. ErrorInfo = $"_Err {errCode}: RQ INTLCK不识别的参数";
  331. break;
  332. case 7317:
  333. ErrorInfo = $"_Err {errCode}: RQ IO不识别的参数";
  334. break;
  335. case 7319:
  336. ErrorInfo = $"_Err {errCode}: RQ STN工位号超范围";
  337. break;
  338. case 7320:
  339. ErrorInfo = $"_Err {errCode}: wafre(WAF_SEN)参数未设置";
  340. break;
  341. case 7321:
  342. ErrorInfo = $"_Err {errCode}: wafex(RETRACT_PIN)参数未设置";
  343. break;
  344. case 7322:
  345. ErrorInfo = $"_Err {errCode}: svlv(SBIT_SVLV_SEN)参数未设置";
  346. break;
  347. case 7323:
  348. ErrorInfo = $"_Err {errCode}: ens(EX_ENABLE)参数未设置";
  349. break;
  350. case 7324:
  351. ErrorInfo = $"_Err {errCode}: RQ命令不支持的参数";
  352. break;
  353. case 7325:
  354. ErrorInfo = $"_Err {errCode}: SET INTLOCK WAF_SEN参数错";
  355. break;
  356. case 7326:
  357. ErrorInfo = $"_Err {errCode}: SET INTLOCK RZ参数错";
  358. break;
  359. case 7327:
  360. ErrorInfo = $"_Err {errCode}: SET INTLOCK参数错";
  361. break;
  362. case 7328:
  363. ErrorInfo = $"_Err {errCode}: SET IO ECHO参数错";
  364. break;
  365. case 7329:
  366. ErrorInfo = $"_Err {errCode}: SET IO STATE不支持";
  367. break;
  368. case 7330:
  369. ErrorInfo = $"_Err {errCode}: SET IO不支持的参数";
  370. break;
  371. case 7331:
  372. ErrorInfo = $"_Err {errCode}: SET STN工位号超范围";
  373. break;
  374. case 7332:
  375. ErrorInfo = $"_Err {errCode}: 手臂参数读取错误";
  376. break;
  377. case 7333:
  378. ErrorInfo = $"_Err {errCode}: WAF_SEN不识别的参数";
  379. break;
  380. case 7334:
  381. ErrorInfo = $"_Err {errCode}: SET不支持的传感器类型";
  382. break;
  383. case 7335:
  384. ErrorInfo = $"_Err {errCode}: SET 指令输入不完整";
  385. break;
  386. case 7336:
  387. ErrorInfo = $"_Err {errCode}: STORE IO命令不支持该参数";
  388. break;
  389. case 7337:
  390. ErrorInfo = $"_Err {errCode}: STORE LOAD命令不支持该参数";
  391. break;
  392. case 7338:
  393. ErrorInfo = $"_Err {errCode}: STORE STN指令工位号大于20";
  394. break;
  395. case 7339:
  396. ErrorInfo = $"_Err {errCode}: STORE STN命令手臂参数错误";
  397. break;
  398. case 7340:
  399. ErrorInfo = $"_Err {errCode}: STORE不支持的传感器类型";
  400. break;
  401. case 7341:
  402. ErrorInfo = $"_Err {errCode}: STORE指令输入不完整";
  403. break;
  404. case 7342:
  405. ErrorInfo = $"_Err {errCode}: 无法识别的命令";
  406. break;
  407. case 7343:
  408. ErrorInfo = $"_Err {errCode}: HOME参数未指定";
  409. break;
  410. case 7344:
  411. ErrorInfo = $"_Err {errCode}: GOTO指令R轴参数未指定";
  412. break;
  413. case 7345:
  414. ErrorInfo = $"_Err {errCode}: GOTO指令Z轴参数未指定";
  415. break;
  416. case 7346:
  417. ErrorInfo = $"_Err {errCode}: ARM参数错误";
  418. break;
  419. case 7347:
  420. ErrorInfo = $"_Err {errCode}: GOTO指令未指定参数";
  421. break;
  422. case 7349:
  423. ErrorInfo = $"_Err {errCode}: MOVE指令未指定模式或轴";
  424. break;
  425. case 7350:
  426. ErrorInfo = $"_Err {errCode}: MOVE 指令中字段名字错";
  427. break;
  428. case 7351:
  429. ErrorInfo = $"_Err {errCode}: PICK未指定参数";
  430. break;
  431. case 7352:
  432. ErrorInfo = $"_Err {errCode}: PLACE未指定参数";
  433. break;
  434. case 7353:
  435. ErrorInfo = $"_Err {errCode}: REMOVE未指定参数";
  436. break;
  437. case 7354:
  438. ErrorInfo = $"_Err {errCode}: 指令执行未结束";
  439. break;
  440. case 7355:
  441. ErrorInfo = $"_Err {errCode}: GOTO指令未指定工位号";
  442. break;
  443. case 7356:
  444. ErrorInfo = $"_Err {errCode}: PICK指令未指定工位号";
  445. break;
  446. case 7357:
  447. ErrorInfo = $"_Err {errCode}: PLACE指令未指定工位号";
  448. break;
  449. case 7358:
  450. ErrorInfo = $"_Err {errCode}: ABS未指定数值";
  451. break;
  452. case 7359:
  453. ErrorInfo = $"_Err {errCode}: REL未指定数值";
  454. break;
  455. case 7360:
  456. ErrorInfo = $"_Err {errCode}: 没有指定主程序";
  457. break;
  458. case 7361:
  459. ErrorInfo = $"_Err {errCode}: 当前没有打开作业";
  460. break;
  461. case 7362:
  462. ErrorInfo = $"_Err {errCode}: 当前作业不是主作业";
  463. break;
  464. case 7363:
  465. ErrorInfo = $"_Err {errCode}: ex_ena(EX_ENABLE_SEN)参数未设置";
  466. break;
  467. case 7364:
  468. ErrorInfo = $"_Err {errCode}: stable(STABLE_ SIGNAL)参数未设置";
  469. break;
  470. case 7365:
  471. ErrorInfo = $"_Err {errCode}: VIA参数设置有误";
  472. break;
  473. case 7366:
  474. ErrorInfo = $"_Err {errCode}: 系统处于非启动状态";
  475. break;
  476. case 7367:
  477. ErrorInfo = $"_Err {errCode}: extend(EX_SIGNAL)参数未设置";
  478. break;
  479. case 7368:
  480. ErrorInfo = $"_Err {errCode}: retract(RE_ SIGNAL)参数未设置";
  481. break;
  482. case 7371:
  483. ErrorInfo = $"_Err {errCode}: place动作前:未检测到晶圆";
  484. break;
  485. case 7372:
  486. ErrorInfo = $"_Err {errCode}: pick动作前:检测到晶圆";
  487. break;
  488. case 7373:
  489. ErrorInfo = $"_Err {errCode}: place动作后:检测到晶圆";
  490. break;
  491. case 7374:
  492. ErrorInfo = $"_Err {errCode}: pick动作后:未检测到晶圆";
  493. break;
  494. case 7375:
  495. ErrorInfo = $"_Err {errCode}: 系统未上电或当前不是执行模式";
  496. break;
  497. case 7376:
  498. ErrorInfo = $"_Err {errCode}: 参数中存在非数字";
  499. break;
  500. case 7385:
  501. ErrorInfo = $"_Err {errCode}: 驱动器异常停止";
  502. break;
  503. case 7387:
  504. ErrorInfo = $"_Err {errCode}: 驱动器ID1报警";
  505. break;
  506. case 7388:
  507. ErrorInfo = $"_Err {errCode}: 驱动器ID2报警";
  508. break;
  509. case 7389:
  510. ErrorInfo = $"_Err {errCode}: 驱动器ID3报警";
  511. break;
  512. case 7391:
  513. ErrorInfo = $"_Err {errCode}: AWC工位号超范围";
  514. break;
  515. case 7392:
  516. ErrorInfo = $"_Err {errCode}: 偏差过大AWC报警";
  517. break;
  518. case 7393:
  519. ErrorInfo = $"_Err {errCode}: 标定失败,请重新标定";
  520. break;
  521. case 7398:
  522. ErrorInfo = $"_Err {errCode}: 触发点计算半径有误";
  523. break;
  524. case 7399:
  525. ErrorInfo = $"_Err {errCode}: 驱动器锁存AWC数据个数有误";
  526. break;
  527. case 7401:
  528. ErrorInfo = $"_Err {errCode}: 手指上可能有晶圆";
  529. break;
  530. case 7402:
  531. ErrorInfo = $"_Err {errCode}: 手指上可能无晶圆";
  532. break;
  533. case 7403:
  534. ErrorInfo = $"_Err {errCode}: load当前状态为ON,不正确";
  535. break;
  536. case 7404:
  537. ErrorInfo = $"_Err {errCode}: load当前状态为OFF,不正确";
  538. break;
  539. case 7405:
  540. ErrorInfo = $"_Err {errCode}: 当前slot不存在!";
  541. break;
  542. case 7495:
  543. ErrorInfo = $"_Err {errCode}: ID1码盘反馈错误";
  544. break;
  545. case 7496:
  546. ErrorInfo = $"_Err {errCode}: ID2码盘反馈错误";
  547. break;
  548. case 7497:
  549. ErrorInfo = $"_Err {errCode}: ID3码盘反馈错误";
  550. break;
  551. default:
  552. ErrorInfo = $"_Err {errCode}: 不能识别的错误码";
  553. break;
  554. }
  555. LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TMRobot, ErrorInfo);
  556. }
  557. else
  558. {
  559. LOG.Write(eEvent.ERR_TM_ROBOT, ModuleName.TMRobot, $"Try Parse the receive error code faild:{errCode}");
  560. }
  561. }
  562. public void SetRobotMovingInfo(RobotAction action, Hand hand, ModuleName target)
  563. {
  564. _robotMoveInfo.Action = action;
  565. _robotMoveInfo.ArmTarget = hand == Hand.Blade1 ? RobotArm.ArmA : (hand == Hand.Both ? RobotArm.Both : RobotArm.ArmB);
  566. _robotMoveInfo.BladeTarget = $"{_robotMoveInfo.ArmTarget}.{target}";
  567. }
  568. }
  569. }