LinMotErrorCodeManager.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. using Aitex.Core.Util;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace MECF.Framework.Common.Device.LinMot
  8. {
  9. public class LinMotErrorCodeManager : Singleton<LinMotErrorCodeManager>
  10. {
  11. private Dictionary<short, string> _errorCodeTextDic = new Dictionary<short, string>();
  12. public void Initialize()
  13. {
  14. _errorCodeTextDic[0x0001] = "Logic Supply Too Low";
  15. _errorCodeTextDic[0x0002] = "Logic Supply Too High";
  16. _errorCodeTextDic[0x0003] = "X1 Pwr Voltage Too Low";
  17. _errorCodeTextDic[0x0004] = "X1 Pwr Voltage Too High";
  18. _errorCodeTextDic[0x0005] = "X1 RR Not Connected";
  19. _errorCodeTextDic[0x0006] = "PTC 1 Sensor Too Hot";
  20. _errorCodeTextDic[0x0007] = "Min Pos Undershot";
  21. _errorCodeTextDic[0x0008] = "Max Pos Overshot";
  22. _errorCodeTextDic[0x0009] = "Ext-Int Sensor Diff Err";
  23. _errorCodeTextDic[0x000A] = "X13 Signals Missing";
  24. _errorCodeTextDic[0x000B] = "Pos Lag Always Too Big";
  25. _errorCodeTextDic[0x000C] = "Pos Lag Standing Too Big";
  26. _errorCodeTextDic[0x000D] = "X1 Pwr Over Current";
  27. _errorCodeTextDic[0x000E] = "Supply Dig Out Missing";
  28. _errorCodeTextDic[0x000F] = "PTC 2 Sensor Too Hot";
  29. _errorCodeTextDic[0x0010] = "Drive Ph1+ Too Hot";
  30. _errorCodeTextDic[0x0011] = "Drive Ph1- Too Hot";
  31. _errorCodeTextDic[0x0012] = "Drive Ph2+ Too Hot";
  32. _errorCodeTextDic[0x0013] = "Drive Ph2- Too Hot";
  33. _errorCodeTextDic[0x0014] = "Drive Pwr Too Hot";
  34. _errorCodeTextDic[0x0015] = "Drive RR switch hot";
  35. _errorCodeTextDic[0x0016] = "Drive X3 Too Hot";
  36. _errorCodeTextDic[0x0017] = "Drive Core Too Hot";
  37. _errorCodeTextDic[0x0018] = "Power Bridge Ph1+ Defective";
  38. _errorCodeTextDic[0x0019] = "Power Bridge Ph1- Defective";
  39. _errorCodeTextDic[0x001A] = "Power Bridge Ph2+ Defective";
  40. _errorCodeTextDic[0x001B] = "Power Bridge Ph2- Defective";
  41. _errorCodeTextDic[0x001C] = "Supply DigOut X6 Fuse Blown";
  42. _errorCodeTextDic[0x001D] = "X3.3 5V Fuse Blown";
  43. _errorCodeTextDic[0x001E] = "X3.8 AGND Fuse Blown";
  44. _errorCodeTextDic[0x001F] = "Power Stage defective";
  45. _errorCodeTextDic[0x0020] = "Motor Hot Sensor";
  46. _errorCodeTextDic[0x0021] = "X3 Hall Sig Missing";
  47. _errorCodeTextDic[0x0022] = "Motor Slider Missing";
  48. _errorCodeTextDic[0x0023] = "Motor Short Time Overload";
  49. _errorCodeTextDic[0x0024] = "RR Hot Calculated";
  50. _errorCodeTextDic[0x0025] = "Sensor Alarm On X13";
  51. _errorCodeTextDic[0x0026] = "Motor Sensor Cold";
  52. _errorCodeTextDic[0x0028] = "Ph1+ Short Circuit To GND";
  53. _errorCodeTextDic[0x0029] = "Ph1- Short Circuit To GND";
  54. _errorCodeTextDic[0x002A] = "Ph2+ Short Circuit To GND";
  55. _errorCodeTextDic[0x002B] = "Ph2- Short Circuit To GND";
  56. _errorCodeTextDic[0x002C] = "Ph1 Short Circuit To Ph2";
  57. _errorCodeTextDic[0x002F] = "X1 Motor Voltage Too High";
  58. _errorCodeTextDic[0x0030] = "Ph1+ Wired To Ph2+";
  59. _errorCodeTextDic[0x0031] = "Ph1+ Wired To Ph2-";
  60. _errorCodeTextDic[0x0032] = "Ph1+ Not Wired To Ph1-";
  61. _errorCodeTextDic[0x0033] = "Ph2+ Wired To Ph1+";
  62. _errorCodeTextDic[0x0034] = "Ph2+ Wired To Ph1-";
  63. _errorCodeTextDic[0x0035] = "Ph2+ Not Wired To Ph2-";
  64. _errorCodeTextDic[0x0036] = "Ph1 Short Circuit To Ph2+";
  65. _errorCodeTextDic[0x0037] = "Ph1 Short Circuit To Ph2-";
  66. _errorCodeTextDic[0x0038] = "Ph2 Short Circuit To Ph1+";
  67. _errorCodeTextDic[0x0039] = "Ph2 Short Circuit To Ph1-";
  68. _errorCodeTextDic[0x003A] = "Phase U broken";
  69. _errorCodeTextDic[0x003B] = "Phase V broken";
  70. _errorCodeTextDic[0x003C] = "Phase W broken";
  71. _errorCodeTextDic[0x003D] = "Wrong Motor Type";
  72. _errorCodeTextDic[0x0040] = "X4.3 Brake Driver Error";
  73. _errorCodeTextDic[0x0041] = "Dig Out X4.4..X4.11 Status";
  74. _errorCodeTextDic[0x0042] = "Dig Out X6 Status";
  75. _errorCodeTextDic[0x0043] = "Fan Driver Error";
  76. _errorCodeTextDic[0x0044] = "X4 Dig Out GND Fuse Blown";
  77. _errorCodeTextDic[0x0045] = "Motor Comm Lost";
  78. _errorCodeTextDic[0x0046] = "PTC 1 Broken";
  79. _errorCodeTextDic[0x0047] = "PTC 1 Short To 24V";
  80. _errorCodeTextDic[0x0048] = "Motor Invalid Data";
  81. _errorCodeTextDic[0x0049] = "Info Checksum";
  82. _errorCodeTextDic[0x004A] = "Data Checksum";
  83. _errorCodeTextDic[0x004B] = "Bad Motor Comm";
  84. _errorCodeTextDic[0x004C] = "No Motor connected/found";
  85. _errorCodeTextDic[0x004D] = "Motor HW Version invalid";
  86. _errorCodeTextDic[0x004E] = "Motor SW Version invalid";
  87. _errorCodeTextDic[0x004F] = "Motor Cfg Data Ver invalid";
  88. _errorCodeTextDic[0x0050] = "HW Not Supported";
  89. _errorCodeTextDic[0x0051] = "SW Key Missing";
  90. _errorCodeTextDic[0x0052] = "SW Key Missing";
  91. _errorCodeTextDic[0x0053] = "Act Vel too high";
  92. _errorCodeTextDic[0x0057] = "SW Key Missing";
  93. _errorCodeTextDic[0x0058] = "ROM write error";
  94. _errorCodeTextDic[0x0059] = "Par Job List Ovflw";
  95. _errorCodeTextDic[0x005A] = "Motor Temp Line Low";
  96. _errorCodeTextDic[0x005C] = "Commutation frequency high";
  97. _errorCodeTextDic[0x005D] = "No Motor TempSensor Def";
  98. _errorCodeTextDic[0x005E] = "Par Range Error";
  99. _errorCodeTextDic[0x005F] = "Par Access Error";
  100. _errorCodeTextDic[0x0060] = "RR Voltage Set Too Low";
  101. _errorCodeTextDic[0x0061] = "RR Hysteresis < 0.5V";
  102. _errorCodeTextDic[0x0062] = "Curve Not Defined";
  103. _errorCodeTextDic[0x0063] = "Pos Ctrl Max Curr High";
  104. _errorCodeTextDic[0x0064] = "No Motor Defined";
  105. _errorCodeTextDic[0x0065] = "No Trigger Mode Defined";
  106. _errorCodeTextDic[0x0066] = "Lin Distance Error";
  107. _errorCodeTextDic[0x0067] = "Wrong Stator Type";
  108. _errorCodeTextDic[0x0068] = "No Motor Communication";
  109. _errorCodeTextDic[0x0069] = "Wrong Slider";
  110. _errorCodeTextDic[0x006A] = "UPID Err Range Ind";
  111. _errorCodeTextDic[0x006B] = "Commutation not Supp";
  112. _errorCodeTextDic[0x006C] = "Par Access wrong UPID";
  113. _errorCodeTextDic[0x006D] = "Par Access Wrong Type";
  114. _errorCodeTextDic[0x006E] = "Motor not supported";
  115. _errorCodeTextDic[0x006F] = "Wrong Motor Ttype";
  116. _errorCodeTextDic[0x0070] = "Pos Corr Tab Not Exists";
  117. _errorCodeTextDic[0x0071] = "Pos Corr Tab not Supp";
  118. _errorCodeTextDic[0x0080] = "Lin:Not Homed";
  119. _errorCodeTextDic[0x0081] = "Unknown Motion Cmd";
  120. _errorCodeTextDic[0x0082] = "PVT Buffer Overflow";
  121. _errorCodeTextDic[0x0083] = "PVT Buffer Underflow";
  122. _errorCodeTextDic[0x0084] = "PVT Master Too Fast";
  123. _errorCodeTextDic[0x0085] = "PVT Master Too Slow";
  124. _errorCodeTextDic[0x0086] = "Motion Cmd In Wrong St";
  125. _errorCodeTextDic[0x0087] = "Limit Switch Neg High";
  126. _errorCodeTextDic[0x0088] = "Limit Switch Pos High";
  127. _errorCodeTextDic[0x0089] = "Curve Amp Scale Error";
  128. _errorCodeTextDic[0x008A] = "Cmd Tab Entry Not Def";
  129. _errorCodeTextDic[0x0090] = "Less Calc Time C0";
  130. _errorCodeTextDic[0x0091] = "Less Calc Time C1";
  131. _errorCodeTextDic[0x0092] = "Less Calc Time C2";
  132. _errorCodeTextDic[0x0093] = "Less Calc Time C3";
  133. _errorCodeTextDic[0x00A0] = "Sensor Comm. CRC";
  134. _errorCodeTextDic[0x00A1] = "X13 Sensor Error";
  135. _errorCodeTextDic[0x00A2] = "X13 Sensor Comm. ACK";
  136. _errorCodeTextDic[0x00A4] = "X13 Sensor Comm. TO";
  137. }
  138. /// <summary>
  139. /// 获取错误码内容
  140. /// </summary>
  141. /// <param name="errorCode"></param>
  142. /// <returns></returns>
  143. public string GetErrorCodeText(short errorCode)
  144. {
  145. return _errorCodeTextDic.ContainsKey(errorCode) ? _errorCodeTextDic[errorCode] : "";
  146. }
  147. }
  148. }