CanVar.c 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. /*
  2. * CanVar.c
  3. *
  4. * Created on: 2021年12月27日
  5. * 编码
  6. * Author: QiXiang_CHENJIE
  7. */
  8. #include "CanVar.h"
  9. /******************************CAN2变量区域****************************************/
  10. UINT32 Can2OutTable[16][2] =
  11. {{0x1C00EBEC, 100},
  12. {0x1C01EBEC, 100},
  13. {0x1C02EBEC, 100},
  14. {0x1C03EBEC, 100},
  15. {0x1C04EBEC, 100},
  16. {0x1C05EBEC, 100},
  17. {0x1C06EBEC, 100},
  18. {0x1C07EBEC, 100},
  19. {0x1C08EBEC, 100},
  20. {0x1C09EBEC, 100},
  21. {0x1C0AEBEC, 100},
  22. {0x1C0BEBEC, 100},
  23. {0x1C0CEBEC, 100},
  24. {0x1C0DEBEC, 100},
  25. {0x1C0EEBEC, 100},
  26. {0x1C12EBEC, 100}};
  27. /*Can变量区
  28. uint8 cand_st_bleConnCtrlCmd = 0; //蓝牙连接控制,0-无操作 1-连接蓝牙 2-断开蓝牙
  29. uint8 cand_st_blePwrCtrlCmd = 0; //蓝牙电源控制,0-无操作 1-关闭蓝牙 2-开启蓝牙
  30. uint8 cand_st_wifiConnCtrlCmd = 0; //WiFi连接控制,0-无操作 1-连接WiFi 2-断开WiFI
  31. uint8 cand_st_wifiPwrCtrlCmd = 0; //WIFI电源控制,0-无操作 1-关闭WiFI 2-开启WiFI
  32. uint8 cand_st_ebcWorkMode = 0; //换电当前状态,0-行车 1-通信 2-换电
  33. uint8 cand_st_ebcCommMode = 0; //换电通讯状态,0-无线蓝牙 1-有线连接 默认无线连接
  34. uint8 cand_st_ebcManuMode = 0; //换电操作状态,0-单步模式 1-自动模式 默认为单步模式
  35. uint8 cand_st_ebcPlugType = 0; //连接器类型,0-四连接器 1-单连接器
  36. uint8 cand_flg_ebcAllWOper = 0; //允许换电判断,0-不允许 1-允许
  37. uint8 cand_st_unlockSnsrJug = 0; //0-完全未解锁 1-完全解锁 2-未完全解锁
  38. uint8 cand_st_lockSnsrJug = 0; //0-完全未锁紧 1-完全锁紧 2-未完全锁紧
  39. uint8 cand_st_placeSnsrJug = 0;//0-完全未到位 1-完全到位 2-未完全到位
  40. uint8 cand_flg_unlockSnsrBit = 0;//传感器0-3的状态 每bit:1-触发,0-不触发
  41. uint8 cand_flg_lockSnsrBit = 0;//传感器0-3的状态 每bit:1-触发,0-不触发
  42. uint8 cand_flg_placeSnsrBit = 0;//bit0-bit1:传感器0-1的状态 每bit:1-触发,0-无触发
  43. uint8 cand_flg_hvLokcBit = 0;//bit0:连接器互锁,bit1:整车互锁
  44. uint8 cand_Mpa_airPress = 0;//单位Mpa,精度0.01Mpa
  45. uint8 cand = 0;//1-液位正常 0-液位过低
  46. uint8 cand_flg_vehiComm = 0;
  47. uint8 cand_flg_vehiKeyon = 0;
  48. uint8 cand_st_vehiStart = 0;
  49. uint8 cand_flg_vehiBrakeBit = 0;
  50. uint8 cand_st_vehiGear = 0;
  51. uint8 cand_st_vehiWheel = 0;
  52. uint8 cand_Mpa_vehiFrAirP = 0;
  53. uint8 cand_Mpa_vehiBkAirP = 0;
  54. uint8 cand_flg_battCanComm = 0;
  55. uint8 cand_st_battBmsState = 0;
  56. uint8 cand_st_battMainRely = 0;
  57. uint8 cand_pct_battSoc = 0;
  58. */
  59. /******************************CAN2变量区域****************************************/
  60. UINT32 BcuInTable[28] = {
  61. 0x1801D0F3,
  62. 0x1801D8F3,
  63. 0x1880D0F3,
  64. 0x1881D0F3,
  65. 0x1882D0F3,
  66. 0x1883D0F3,
  67. 0x1884D0F3,
  68. 0x1885D0F3,
  69. 0x1886D0F3,
  70. 0x1887D0F3,
  71. 0x1888D0F3,
  72. 0x1889D0F3,
  73. 0x188AD0F3,
  74. 0x18C1D0F3,
  75. 0x18C2D0F3,
  76. 0x18E1D0F3,
  77. 0x18E2D0F3,
  78. 0x18E3D0F3,
  79. 0x18E4D0F3,
  80. 0x18E5D0F3,
  81. 0x18E6D0F3,
  82. 0x18F1D0F3,
  83. 0x18F2D0F3,
  84. 0x18F3D0F3,
  85. 0x18F4D0F3,
  86. 0x18F5D0F3,
  87. 0x18FF45F4,
  88. 0x18FFC13A,
  89. };
  90. BOOL BcuRxShortError[28];
  91. BOOL BcuRxLongError[28];
  92. UINT8 BcuRxErrorCounter[28];
  93. UINT8 BcuRxFlag[28];
  94. /************************************************************
  95. *BCU->Ebc解码变量存放区
  96. ************************************************************/
  97. UINT8 BMS_ReqVIN = 0x00; //是否请求VIN码,0:预留;1:请求VIN;2:不请求VIN;3:无效;,Re-1,Off-0,
  98. UINT8 BMS_ReqHVOff = 0x00; //是否请求下高压,0:预留;1:请求下高压;2:不请求下高压;3:无效;,Re-1,Off-0,
  99. UINT8 BMS_ProtocolEditionH = 0x00; //通讯协议版本高位(例 : 版本为3 .1, 则此处发3), , Re - 1, Off - 0,
  100. UINT8 BMS_ProtocolEditionL = 0x00; //通讯协议版本低位(例 : 版本为3 .1, 则此处发1), , Re - 1, Off - 0,
  101. UINT8 BMS_CharDevNum = 0x00; //可充电装置系统序号(BMS是整车中可充电装置系统中的第几个, 需要整车告知),1,Re-1,Off-0,
  102. UINT8 BMS_FtPosRly = 0x00; //主正继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  103. UINT8 BMS_FtNegRly = 0x00; //主负继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  104. UINT8 BMS_FtPosCharRly1 = 0x00; //充正1继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  105. UINT8 BMS_FtNegCharRly1 = 0x00; //充负1继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  106. UINT8 BMS_FtPosCharRly2 = 0x00; //充正2继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  107. UINT8 BMS_FtNegCharRly2 = 0x00; //充负2继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  108. UINT8 BMS_FtHeatRly1 = 0x00; //加热1/正继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  109. UINT8 BMS_FtHeatRly2 = 0x00; //加热2/负继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  110. UINT8 BMS_StPosRly = 0x00; //主正继电器状态(如继电器状态由BMS检测),0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  111. UINT8 BMS_StNegRly = 0x00; //主负继电器状态(如继电器状态由BMS检测),0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  112. UINT8 BMS_StPreCharRly = 0x00; //预充继电器状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  113. UINT8 BMS_StPosCharRly1 = 0x00; //直流充正继电器1状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  114. UINT8 BMS_StNegCharRly1 = 0x00; //直流充负继电器1状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  115. UINT8 BMS_StPosCharRly2 = 0x00; //直流充正继电器2状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  116. UINT8 BMS_StNegCharRly2 = 0x00; //直流充负继电器2状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  117. UINT8 BMS_FtAuxRelayWeld = 0x00; //附件继电器粘连故障(保留),0:正常; 1:故障,Re-1,Off-0,
  118. UINT8 BMS_BraOpenCirc = 0x00; //支路断路故障,0:正常; 1:故障,Re-1,Off-0,
  119. UINT8 BMS_FtBackCharCurrOutLim = 0x00; //回充电流超限报警,0:正常1 : 1级 轻微故障 2 : 2级 较严重故障 3 : 3级 最严重故障, Re - 1, Off - 0,
  120. UINT8 BMS_FtPosRlyOpen = 0x00; //主正继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  121. UINT8 BMS_FtNegRlyOpen = 0x00; //主负继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  122. UINT8 BMS_FtPosCharRly1Open = 0x00; //直流充电正1继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  123. UINT8 BMS_FtPosCharRly2Open = 0x00; //直流充电正2继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  124. UINT8 BMS_FtNegCharRly1Open = 0x00; //直流充电负1继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  125. UINT8 BMS_FtNegCharRly2Open = 0x00; //直流充电负2继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  126. UINT8 BMS_FtTMSContClose = 0x00; //加热膜或TMS接触器无法断开报警,0:正常; 1:故障,Re-1,Off-0,
  127. UINT8 BMS_FtTMSContOpen = 0x00; //加热膜或TMS接触器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  128. UINT8 BMS_FtTMS = 0x00; //热管理系统故障,0:正常; 1:故障,Re-1,Off-0,
  129. UINT8 BMS_Ft24VSpy = 0x00; // BMS 24V供电异常报警,0:正常; 1:故障,Re-1,Off-0,
  130. UINT8 BMS_FtPACKSelfProt = 0x00; //电池包自保护报警,0:正常; 1:故障,Re-1,Off-0,
  131. UINT8 BMS_FtCharSockTempOver = 0x00; //充电插座过温报警,0:正常1 : 1级 轻微故障 2 : 2级 较严重故障 3 : 3级 最严重故障, Re - 1, Off - 0,
  132. UINT8 BMS_FtTempOutCtrl = 0x00; //热失控报警,0:正常; 1:故障,Re-1,Off-0,
  133. UINT8 BMS_StPosHeatRly = 0x00; //加热正继电器状态,0:保留;1:开启;2:闭合;3:无效,Re-1,Off-0,
  134. UINT8 BMS_StNegHeatRly = 0x00; //加热负继电器状态,0:保留;1:开启;2:闭合;3:无效,Re-1,Off-0,
  135. UINT8 BMS_CharSysNum = 0x00; //可充电储能子系统总数(保留),,Re-1,Off-0,
  136. UINT8 BMS_FtCode = 0x00; //电池系统故障码,详见附表电池系统故障码列表,Re-1,Off-0,
  137. UINT8 BMS_ST1CheckSum = 0x00; // B2V_ST1的CheckSum,Byte0=Byte1 XOR Byte2 XOR Byte3 XOR Byte4 XOR Byte5 XOR Byte6 XOR Byte7,Re-1,Off-0,
  138. UINT8 BMS_ST1Counter = 0x00; // B2V_ST1的生命信号,0~14循环,15:信号无效,Re-1,Off-0,
  139. UINT8 BMS_Mode = 0x00; // BMS当前状态,0:预留;1:高压上电;2:高压下电;3:无效;,Re-1,Off-0,
  140. UINT8 BMS_AuxRlySt = 0x00; //附件继电器状态,0:开启;1:闭合;,Re-1,Off-0,
  141. UINT8 BMS_BattBalaSt = 0x00; // BMS当前均衡状态,0:未开启均衡;1:开启均衡;,Re-1,Off-0,
  142. UINT8 BMS_CharGunSt = 0x00; //直流充电枪连接状态,0:未连接1 : 连接, Re - 1, Off - 0,
  143. UINT8 BMS_CharMode = 0x00; // BMS当前充电模式,0:预留1 : 直流充电 2 : 交流充电 3 : 其他充电, Re - 1, Off - 0,
  144. UINT8 BMS_CharSt = 0x00; //充电状态,0:可以充电1 : 正在充电 2 : 充电结束 3 : 充电故障, Re - 1, Off - 0,
  145. UINT8 BMS_FtLvl = 0x00; //当前最高故障等级,0:正常1 : 1级 轻微故障 2 : 2级 较严重故障 3 : 3级 最严重故障, Re - 1, Off - 0,
  146. UINT8 BMS_FtCellTempDiff = 0x00; //电芯温差异常报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  147. UINT8 BMS_FtCellTempHigh = 0x00; //电芯温度过高报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  148. UINT8 BMS_FtPACKOverVolt = 0x00; // PACK过压报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  149. UINT8 BMS_FtPACKUndeVolt = 0x00; // PACK欠压报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  150. UINT8 BMS_FtSOCLow = 0x00; // SOC过低报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  151. UINT8 BMS_FtCellOverVolt = 0x00; //单体电压过高报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  152. UINT8 BMS_FtCellUndeVolt = 0x00; //单体电压欠压报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  153. UINT8 BMS_FtIns = 0x00; //绝缘报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  154. UINT8 BMS_FtCellOverVoltDiff = 0x00; //单体压差过大,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  155. UINT8 BMS_FtCharCurrOver = 0x00; //充电电流过大报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  156. UINT8 BMS_FtDisCharCurrOver = 0x00; //放电电流过大报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  157. UINT8 BMS_FtCellTempLow = 0x00; //电芯温度过低报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  158. UINT8 BMS_FtBranVoltDifOver = 0x00; //支路压差过大报警(存在并联支路的系统),0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  159. UINT8 BMS_FtBMSHardWare = 0x00; // BMS硬件故障,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  160. UINT8 BMS_FtSOCHigh = 0x00; // SOC过高报警,0:正常; 1:故障,Re-1,Off-0,
  161. UINT8 BMS_FtSOCJump = 0x00; // SOC跳变报警,0:正常; 1:故障,Re-1,Off-0,
  162. UINT8 BMS_FtInCom = 0x00; // BMS内部通信故障,0:正常; 1:故障,Re-1,Off-0,
  163. UINT8 BMS_FtSysMism = 0x00; // BMS/可充电储能系统不匹配报警,0:正常; 1:故障,Re-1,Off-0,
  164. UINT8 BMS_FtHvIntLock = 0x00; //高压互锁报警,0:正常; 1:故障,Re-1,Off-0,
  165. UINT8 BMS_FtSmoke = 0x00; //火警探测器故障,0:正常; 1:故障,Re-1,Off-0,
  166. UINT8 BMS_FtFire = 0x00; //电池包火灾报警,0:正常; 1:故障,Re-1,Off-0,
  167. UINT8 BMS_FtNum = 0x00; // BMS当前发生的故障总数目(包括GB32960中规定的故障数目),,Re-1,Off-0,
  168. UINT8 BMS_PackSOC = 0x00; //电池包SOC,,Re-0.4,Off-0,
  169. UINT8 BMS_PackSOH = 0x00; //电池包SOH,,Re-0.4,Off-0,
  170. UINT8 BMS_MaxCellTemp = 0x00; //单体最高温度,,Re-1,Off--50,℃
  171. UINT8 BMS_MinCellTemp = 0x00; //单体最低温度,,Re-1,Off--50,℃
  172. UINT8 BMS_AverCellTemp = 0x00; //单体平均温度,,Re-1,Off--50,℃
  173. UINT8 BMS_MaxCellTempCSC = 0x00; //最高温度电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0,
  174. UINT8 BMS_MaxCellTempNum = 0x00; //最高温度电芯所在子系统(CSC)内温度探针编号,范围(1~255),Re-1,Off-0,
  175. UINT8 BMS_MinCellTempCSC = 0x00; //最低温度电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0,
  176. UINT8 BMS_MinCellTempNum = 0x00; //最低温度电芯所在子系统(CSC)内温度探针编号,范围(1~255),Re-1,Off-0,
  177. UINT8 BMS_MaxCellVoltCSC = 0x00; //最高电压电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0,
  178. UINT8 BMS_MaxCellVoltNum = 0x00; //最高电压电芯所在子系统(CSC)内单体编号,范围(1~255),Re-1,Off-0,
  179. UINT8 BMS_MinCellVoltCSC = 0x00; //最低电压电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0,
  180. UINT8 BMS_MinCellVoltNum = 0x00; //最低电压电芯所在子系统(CSC)内单体编号,范围(1~255),Re-1,Off-0,
  181. UINT8 BMS_InsDeteSt = 0x00; // BMS绝缘检测状态,0:停止检测;1:激活检测;,Re-1,Off-0,
  182. UINT8 BMS_FtCharInsLow = 0x00; //充电绝缘阻值低,0:正常; 1:故障,Re-1,Off-0,
  183. UINT8 BMS_FtCurrSenr = 0x00; //电流传感器故障,0:正常; 1:故障,Re-1,Off-0,
  184. UINT8 BMS_FtHeatingFilm = 0x00; //加热膜加热回路故障,0:正常; 1:故障,Re-1,Off-0,
  185. UINT8 BMS_FtMainLoopPreChar = 0x00; //主回路预充或预检故障,0:正常; 1:故障,Re-1,Off-0,
  186. UINT8 BMS_FtAuxLoopPreChar = 0x00; //辅件回路预充或预检故障,0:正常; 1:故障,Re-1,Off-0,
  187. UINT8 BMS_FtACANLost = 0x00; // ACAN/整车CAN通讯故障,0:正常; 1:故障,Re-1,Off-0,
  188. UINT8 BMS_FtDCDC = 0x00; // BMS-DC-DC故障,0:正常; 1:故障,Re-1,Off-0,
  189. UINT8 BMS_FtSOCDif = 0x00; // SOC差异过大,0:正常; 1:故障,Re-1,Off-0,
  190. UINT8 BMS_FtCellOverDisChar = 0x00; //电芯过放故障,0:正常; 1:故障,Re-1,Off-0,
  191. UINT8 BMS_FtCharOver = 0x00; //车载储能装置过充报警,0:正常;1:1级 轻微故障;2:2级 较严重故障3 : 10级 最严重故障, Re - 1, Off - 0,
  192. UINT8 BMS_FtContDisCharCurrOverLoad = 0x00; //持续回充过流故障,0:正常;1:1级 轻微故障;2:2级 较严重故障3 : 10级 最严重故障, Re - 1, Off - 0,
  193. UINT8 BMS_FtContCharCurrOverLoad = 0x00; //持续放电过流故障,0:正常;1:1级 轻微故障;2:2级 较严重故障3 : 10级 最严重故障, Re - 1, Off - 0,
  194. UINT8 BMS_Gun1DCNegTemp = 0x00; //充电口1负温感值,,Re-1,Off--40,℃
  195. UINT8 BMS_Gun1DCPosTemp = 0x00; //充电口1正温感值,,Re-1,Off--40,℃
  196. UINT8 BMS_Gun2DCNegTemp = 0x00; //充电口2负温感值,,Re-1,Off--40,℃
  197. UINT8 BMS_Gun2DCPosTemp = 0x00; //充电口2正温感值,,Re-1,Off--40,℃
  198. UINT8 BMS_CurrHeatSt = 0x00; //当前加热状态,0:未加热;1:加热中;2:预留;3:无效;,Re-1,Off-0,
  199. UINT8 BMS_CurrCoolSt = 0x00; //当前冷却状态,0:未冷却;1:冷却中;2:预留;3:无效;,Re-1,Off-0,
  200. UINT8 BMS_FtCharCnct = 0x00; //插枪连接信号异常,0:正常; 1:故障,Re-1,Off-0,
  201. UINT8 BMS_FtOverDisCharCurrDuringChar = 0x00; //充电时放电电流过大,0:正常; 1:故障,Re-1,Off-0,
  202. UINT8 BMS_FtCharNTC = 0x00; //充电插座NTC故障,0:正常; 1:故障,Re-1,Off-0,
  203. UINT8 BMS_FtELock = 0x00; //电子锁故障,0:正常; 1:故障,Re-1,Off-0,
  204. UINT8 BMS_CellVoltFramNum = 0x00; //单体电压帧序号,有效值1~255,Re-1,Off-0,
  205. UINT8 BMS_CellTempFramNum = 0x00; //温度帧序号,有效值1~255,Re-1,Off-0,
  206. UINT8 BMS_CSC_Code = 0x00; //子系统编号CSC,有效值1~255,Re-1,Off-0,
  207. UINT8 BMS_CellTemp[64] = {0x00}; //当前CSC下的第N个探针的温度,255 "Invalid" 0xFF 无效有效值 0 ~254, 单位 ℃, 范围(-50 ~204)℃, , Re - 1, Off-- 50,℃
  208. UINT8 BMS_Checksum = 0x00; //电池编码信息1的CheckSum,Byte0=Byte1 XOR Byte2 XOR Byte3 XOR Byte4 XOR Byte5 XOR Byte6 XOR Byte7,Re-1,Off-0,
  209. UINT8 BMS_PackComp = 0x00; //电池厂家,1:"CATL" 2:"Li Shen" 3:"MGL" 4:"SAMSUN" 5:"LG",Re-1,Off-0,
  210. UINT8 BMS_BattCodeLeng = 0x00; //电池编码长度,0:Do not transmit this Code,Re-1,Off-0,
  211. UINT8 BMS_SN[27] = {0x00}; //电池编码(SN)字符1(ASCII),,Re-1,Off-0,
  212. UINT8 BMS_BattType = 0x00; //电池类型,1:铅酸电池; 2:镍氢电池; 3:磷酸铁锂电池; 4:锰酸锂电池; 5:钴酸锂电池; 6:三元材料电池; 7:聚合物锂离子电池; 8:钛酸锂电池; 9:超级电容; 10~13:保留; 14:燃料电池;15:保留,Re-1,Off-0,
  213. UINT8 BMS_CoolType = 0x00; //电池冷却方式,0:其他冷却方式1 : 自然冷却 2 : 风扇冷却 3 : 水冷却, Re - 1, Off - 0,
  214. UINT8 BMS_CSC_Total = 0x00; //电池系统中CSC总的数目,,Re-1,Off-0,
  215. UINT8 BMS_CellVoltLevel = 0x00; //单体平台电压(非实时变化的值),有效值0~5V; 255 "Signal Invalid" 0xFF 无效,Re-0.1,Off-0,V
  216. UINT8 BMS_CellMinVolt = 0x00; //单体可用最低电压(非实时变化的值),有效值0~5V; 255 "Signal Invalid" 0xFF 无效,Re-0.1,Off-0,V
  217. UINT8 BMS_CellMaxVolt = 0x00; //单体可用最高电压(非实时变化的值),有效值0~5V; 255 "Signal Invalid" 0xFF 无效,Re-0.1,Off-0,V
  218. UINT8 BMS_HVBranNum = 0x00; //电池系统高压支路数,,Re-1,Off-0,
  219. UINT8 BMS_SingleHVBranchCellNum = 0x00; //电池系统单支路电芯数,,Re-1,Off-0,
  220. UINT8 BMS_ReqMode = 0x00; // BMS请求设定模式,0:关机模式1 : 制冷模式 2 : 制热模式 3 : 自循环模式, Re - 1, Off - 0,
  221. UINT8 BMS_HVCmd = 0x00; //高压请求,0:请求上高压1 : 请求下高压, Re - 1, Off - 0,
  222. UINT8 BMS_ChgSts = 0x00; //充电状态,0:非充电1 : 充电, Re - 1, Off - 0,
  223. UINT8 BMS_HVRelaySts = 0x00; // BMS高压继电器状态,0:断开状态; 1:闭合状态; 2~3:无效,Re-1,Off-0,
  224. UINT8 BMS_SetTemp = 0x00; //设定温度,,Re-1,Off--40,
  225. UINT8 BMS_Life = 0x00; // BMS生命帧,,Re-1,Off-0,
  226. UINT8 BMS_CRC = 0x00; // CRC校验值,,Re-1,Off-0,
  227. UINT8 TMS_WorkStatus = 0x00; // TMS工作状态,0:关机模式1 : 制冷模式 2 : 制热模式 3 : 自循环模式, Re - 1, Off - 0,
  228. UINT8 TMS_HVRelayST = 0x00; // TMS高压继电器状态,0:断开状态; 1:闭合状态; 2~3:无效,Re-1,Off-0,
  229. UINT8 TMS_OutletTemp = 0x00; //出水温度(机组到电池),255:无效,Re-1,Off--40,
  230. UINT8 TMS_InletTemp = 0x00; //回水温度(电池到机组),255:无效,Re-1,Off--40,
  231. UINT8 TMS_ErrCode = 0x00; // TMS故障码,0:无故障; 出现 1 种以上循环发送,Re-1,Off-0,
  232. UINT8 TMS_FaultLevel = 0x00; // TMS故障码等级,0:无效1 : 1级故障 2 : 2级故障 3 : 3级故障, Re - 1, Off - 0,
  233. UINT16 BMS_SoftwareVersion = 0x00; //软件版本号:RyyyBzzz(R为软件版本、B为测试版本、正式版本不带B) ,yyy:0~254,精度1,255:无效,不显示;zzz:0~254,精度1,255:无效,不显示;
  234. UINT16 BMS_HardwareVersion = 0x00; //硬件版本号:VyyyBzzz(V为硬件版本、B为测试版本、正式版本不带B) ,,Re-1,Off-0,
  235. UINT16 BMS_PackCurr = 0x00; //电池包总电流,充电为负值,放电为正值,,Re-0.1,Off--1000,A
  236. UINT16 BMS_MaxCharCurr = 0x00; //电池包最大回充电流,,Re-0.1,Off--1000,A
  237. UINT16 BMS_MaxDisCharCurr = 0x00; //电池包最大放电电流,,Re-0.1,Off--1000,A
  238. UINT16 BMS_PosIns = 0x00; //母线正对车体绝缘电阻,,Re-1,Off-0,KΩ
  239. UINT16 BMS_NegIns = 0x00; //母线负对车体绝缘电阻,,Re-1,Off-0,KΩ
  240. UINT16 BMS_BattVolt = 0x00; //电池包内侧电压,,Re-0.1,Off-0,V
  241. UINT16 BMS_LinkVolt = 0x00; //电池包外侧电压,,Re-0.1,Off-0,V
  242. UINT16 BMS_MaxCellVolt = 0x00; //单体最高电压值,,Re-0.001,Off-0,V
  243. UINT16 BMS_AverCellVolt = 0x00; //电芯电压平均值,,Re-0.001,Off-0,V
  244. UINT16 BMS_MinCellVolt = 0x00; //电芯最低电压值,,Re-0.001,Off-0,V
  245. UINT16 BMS_ContChrgCurr = 0x00; // BMS允许的持续回充电流,,Re-0.1,Off-0,A
  246. UINT16 BMS_ContDisCharCurr = 0x00; // BMS允许的持续放电电流,,Re-0.1,Off--1000,A
  247. UINT16 BMS_CharReqVolt = 0x00; //充电所需电压(交流),,Re-0.1,Off-0,V
  248. UINT16 BMS_CharReqCurr = 0x00; //充电所需电流(交流),,Re-0.1,Off--1000,A
  249. UINT16 BMS_SysInsRes = 0x00; //系统绝缘电阻,,Re-1,Off-0,KΩ
  250. UINT16 BMS_MaxDisCharPwr = 0x00; //最大允许放电功率,,Re-0.1,Off-0,kw
  251. UINT16 BMS_MaxCharPwr = 0x00; //最大允许充电功率,,Re-0.1,Off-0,kw
  252. UINT16 BMS_ContDisCharPwr = 0x00; // BMS允许的持续放电功率,,Re-0.1,Off-0,kw
  253. UINT16 BMS_ContCharPwr = 0x00; // BMS允许的持续充电功率,,Re-0.1,Off-0,kw
  254. UINT16 BMS_InstEngyCons = 0x00; //动力电池瞬时百公里能耗,,Re-0.1,Off-0,kwh
  255. UINT16 BMS_TotalEngyCons = 0x00; //动力电池总/平均百公里能耗,,Re-0.1,Off-0,kwh
  256. UINT16 BMS_SOE = 0x00; //剩余电量,,Re-0.01,Off-0,kwh
  257. UINT16 BMS_RmanCharTime = 0x00; //剩余充电时间,,Re-1,Off-0,min
  258. UINT16 BMS_CharNum = 0x00; //充电次数,,Re-1,Off-0,
  259. UINT16 BMS_CellVolt[384] = {0x00}; //电芯的电压,65535 "Invalid" 0xFFFF 无效有效值 0 ~65534, 范围(0 ~65.534) V, Re - 0.001, Off - 0, V
  260. UINT16 BMS_BattRateCap = 0x00; //电池包额定容量,有效值 0~65534,65535 "Signal Invalid" 无效,Re-1,Off-0,Ah
  261. UINT16 BMS_BattRateVolt = 0x00; //电池包额定电压,有效值 0~6553.4,65535 "Signal Invalid" 无效,Re-0.1,Off-0,V
  262. UINT16 BMS_BattRateEngy = 0x00; //电池包额定能量,有效值 0~6553.4,65535 "Signal Invalid" 无效,Re-0.1,Off-0,kWh
  263. UINT16 BMS_CellTotal = 0x00; // PACK中单体电芯的总数目,,Re-1,Off-0,
  264. UINT16 BMS_TempTotal = 0x00; // PACK中电芯温度点(探针)的总数目,,Re-1,Off-0,
  265. UINT16 BMS_SingleCharEngy = 0x00; //单次充电kWh 数,,Re-0.1,Off-0,KWh
  266. UINT16 BMS_SingleCharCapy = 0x00; //单次充电Ah 数,,Re-0.1,Off-0,Ah
  267. UINT16 BMS_HVVolt = 0x00; // BMS当前电压,,Re-1,Off-0,
  268. UINT16 TMS_ReqPow = 0x00; // TMS需求功率,65535:无效,Re-0.1,Off-0,Kw
  269. UINT32 BMS_TotalCharEngy = 0x00; //累计充入kWh 数,,Re-0.1,Off-0,KWh
  270. UINT32 BMS_TotalDisCharEngy = 0x00; //累计放出kWh 数,,Re-0.1,Off-0,KWh
  271. UINT32 BMS_TotalBackCharEngy = 0x00; //累计动能回馈充入kWh 数,,Re-0.1,Off-0,KWh
  272. UINT32 BMS_TotalStaCharEngy = 0x00; //累计换电站充入kWh 数,,Re-0.1,Off-0,KWh
  273. UINT32 BMS_TotalGunCharEngy = 0x00; //累计插枪充电充入kWh 数,,Re-0.1,Off-0,KWh
  274. UINT32 BMS_TotalGunCharCapy = 0x00; //累计插枪充电充入Ah 数,,Re-0.1,Off-0,Ah
  275. UINT32 BMS_TotalCharCapy = 0x00; //累计充入Ah 数,,Re-0.1,Off-0,Ah
  276. UINT32 BMS_TotalDisCharCapy = 0x00; //累计放出Ah 数,,Re-0.1,Off-0,Ah
  277. UINT32 BMS_TotalBackCharCapy = 0x00; //累计动能回馈充入Ah 数,,Re-0.1,Off-0,Ah
  278. UINT32 BMS_TotalStaCharCapy = 0x00; //累计换电站充入Ah 数,,Re-0.1,Off-0,Ah
  279. /*VCU->EBC信号*****************************************/
  280. UINT32 VcuInTable[4] = {
  281. 0x18F101D0,
  282. 0x18F103D0,
  283. 0x18E1F3D0,
  284. 0x18FEF100};
  285. BOOL VcuRxShortError[4];
  286. BOOL VcuRxLongError[4];
  287. UINT8 VcuRxFlag[4];
  288. UINT8 VcuRxErrorCounter[4];
  289. UINT8 VCU_Num_VIN[17]; // VCU-VIN
  290. UINT8 VCU_St_VinRecv; // VIN接收状态
  291. UINT8 VCU_St_BattRly = 0x00; //电池接触器状态,0:闭合,指示灯灭 1:断开,指示灯亮 2:预留 3:无效,R-1,Off-0,
  292. UINT8 VCU_St_Check = 0x00; // VCU自检状态,0:正在自检 1:自检成功 2:自检失败 3:无效,R-1,Off-0,
  293. UINT8 VCU_St_SysIntLock = 0x00; //系统互锁状态,0:没有互锁 1:充电互锁 2:预留 3:无效,R-1,Off-0,
  294. UINT8 VCU_St_Veh = 0x00; //整车状态,0:Wait 1:Ready 2:预留 3:无效,R-1,Off-0,
  295. UINT8 VCU_St_Gear = 0x00; //档位状态, -1:倒档 0:空档 1:1档 2:2档 3:3档 4:4档 5:5档 6:6档 7:7档 8:8档 9:9档 10:10档 11:11档 12:12档 13:13档 14:14无效 ,R-1,Off--125,
  296. UINT8 VCU_Ft_Sys = 0x00; // VCU故障(与MCU故障点亮同一个符号),0:无故障 1:系统故障,R-1,Off-0,
  297. UINT8 VCU_Ft_Tran = 0x00; //变速箱故障,0:正常 1:报警,R-1,Off-0,
  298. UINT8 VCU_Ft_BattSys = 0x00; //动力电池系统故障,0:正常 1:报警,R-1,Off-0,
  299. UINT8 VCU_State_Veh = 0x00; //车辆状态,1:车辆启动状态 2:熄火 3:其他状态 14:异常 15:无效,R-1,Off-0,
  300. UINT8 VCU_Counter = 0x00; //循环计数器,,R-0.1,Off-0,
  301. UINT8 VCU_SoftVersion = 0x00; // VCU软件版本号,,R-0.1,Off-0,
  302. UINT8 VCU_St_AccPedal = 0x00; //加速踏板状态,,R-0.4,Off-0,
  303. UINT8 VCU_St_BrakePedal = 0x00; //刹车踏板状态,,R-0.4,Off-0,
  304. UINT8 VCU_St_ParkBrakeSw = 0; //手刹状态
  305. // declear the UINT16 vars
  306. UINT16 VCU_VehSpd = 0x00; //车速,,R-0.0039,Off-0,Km/h
  307. UINT16 VCU_RemaMile = 0x00; //剩余里程,,R-0.125,Off-0,Km
  308. /*EBC->CAN信号*****************************/
  309. UINT32 EbcOutTable[2][2] =
  310. {{0x18FFF8A7, 100},
  311. {0x18FEF8A7, 100}};
  312. UINT8 EBC_Counter = 0; // EBC_Counter LIFE 信号
  313. UINT8 EBC_LockSt = 0; // EBC_LockSt 锁止销反馈状态
  314. UINT8 EBC_CnctSt = 0; //换电连接器状态(充电回路&放电回路同时闭合代表闭合,有一路断开则为断开)
  315. UINT8 EBC_DisCharCnctSt = 0; // 放电回路换电连接器状态(保留)
  316. UINT8 EBC_CharCnctSt = 0; // 充电回路换电连接器状态(保留)
  317. UINT8 EBC_FtLvl = 0; //换电系统故障等级
  318. UINT8 EBC_FtCode = 0; //换电系统故障码
  319. UINT8 EBC_AirPressure = 0; //气压值
  320. UINT8 EBC_CharSt = 0; //充电标志位
  321. UINT8 EBC_ActHeatReq = 0; //主动预热请求
  322. UINT8 EBC_InhiHVOn = 0; //禁止高压上电
  323. UINT8 EBC_ReqHVOff = 0; //请求高压下电
  324. UINT8 EBC_StopChgCmd = 0; //停止充电指令
  325. UINT8 EBC_State = 0; //换电控制器状态
  326. UINT8 EBC_DisCharPos1Temp = 0; //放电正1温度
  327. UINT8 EBC_DischarNeg1Temp = 0; //放电负1温度
  328. UINT8 EBC_DisCharPos2Temp = 0; //放电正2温度
  329. UINT8 EBC_DisCharNeg2Temp = 0; //放电负2温度
  330. UINT8 EBC_ChgPos1Temp = 0; //充电正1温度(保留)
  331. UINT8 EBC_ChgNeg1Temp = 0; //充电负1温度(保留)
  332. UINT8 EBC_ChgPos2Temp = 0; //充电正2温度(保留)
  333. UINT8 EBC_ChgNeg2Temp = 0; //充电负2温度(保留)
  334. /*************************************************************
  335. *Ebc->Ble组码变量以及Ebc应用层变量存放区
  336. ************************************************************/
  337. uint8 g_c_BlePwr = 0;
  338. uint8 g_c_AirPwr = 0;
  339. uint8 g_c_LedPwr = 0;
  340. uint16 bcud_E_snglChrg; //单次充电能量,精度0.1kwh
  341. uint16 bcud_pct_soc; //电池SOC,精度0.1
  342. uint16 bcud_Q_snglChrg; //单次充电容量,精度0.1Ah
  343. uint16 bcud_V_battU; //电池电压 精度0.1V
  344. uint32 bcud_E_accChrg; //累计充电能量,精度0.1kwh
  345. uint32 bcud_E_accDischrg; //累计放电能量,精度0.1kwh
  346. uint32 bcud_E_accPlugInChrg; //累计插枪充电能量,精度0.1kwh
  347. uint32 bcud_E_accRecovry; //累计回收能量,精度0.1kwh
  348. uint32 bcud_E_accSwapBatt; //累计换电站能量,精度0.1kwh
  349. uint32 bcud_Q_accChrg; //累计充电容量,精度0.1ah
  350. uint32 bcud_Q_accDischrg; //累计放电容量,精度0.1ah
  351. uint32 bcud_Q_accPlugInChrg; //累计插枪充电容量,精度0.1ah
  352. uint32 bcud_Q_accRecovry; //累计回收容量,精度0.1ah
  353. uint32 bcud_Q_accSwapBatt; //累计换电站容量,精度0.1ah
  354. uint32 vcud_M_accDrv; //累计行驶里程,精度0.1km
  355. uint8 bcud_pct_bcuSoh; //电池Soh,精度0.4%
  356. uint8 bcud_st_bcuComun; //电池通讯状态,0-通信中断,1-通信正常
  357. uint8 bcud_st_bcuMainRelay; //主继电器信号,0-保留 1-断开,2-关闭 3-异常
  358. uint8 bcud_st_bcuTmsLiquid; //热管理液位状态,1-液位正常,0-液位过低
  359. uint8 bcud_st_hvWork; //电池高压状态,0-高压开启 1-预充,2-高压关断,3-高压上电故障
  360. uint8 bcuv_Num_battSn[32]; //电池SN号码
  361. uint8 vcud_P_airSensorBack; //后桥气压值,单位Mpa,精度0.01Mpa
  362. uint8 vcud_P_airSensorForward; //前桥气压值,单位Mpa,精度0.01Mpa
  363. uint8 vcud_st_carStart; //整车启动状态,0001-车辆启动状态,0010-熄火,0011-其他状态,1111-无效
  364. uint8 vcud_st_footbrake; //脚刹信号,0-无效,1-有效
  365. uint8 vcud_st_gear; //档位信号,FF-倒挡(R),0-空挡(N),X-前进档(DX)X取1-12
  366. uint8 vcud_st_handbrake; //手刹信号,0-无效,1-有效
  367. uint8 vcud_st_keyOn; //钥匙信号,1-上电,0-下电
  368. uint8 vcud_st_Steer; //方向盘信号,bit0-左侧转向灯,bit1-右侧转向灯,每bit 0-OFF,1-ON
  369. uint8 vcud_st_vcuComun; // vcu通讯状态,0-通信中断,1-通信正常
  370. uint8 vcuv_Num_vin[17]; // VIN码
  371. uint8 bled_flg_lockCmd = 0; //锁钩电磁阀锁紧命令,1-有效,0-无效
  372. uint8 bled_flg_unlockCmd = 0; //锁钩电磁阀解锁命令,1-有效,0-无效
  373. uint8 bled_flg_lockCmdForce = 0; //锁钩电磁阀锁紧强制命令,1-有效,0-无效
  374. uint8 bled_flg_unlockCmdForce = 0; //锁钩电磁阀解锁强制命令,1-有效,0-无效
  375. uint8 bled_flg_topAscendCmd = 0; //顶板上升命令,1-有效,0-无效
  376. uint8 bled_flg_topDescendCmd = 0; //顶板下降命令,1-有效,0-无效
  377. uint8 bled_flg_topAscendCmdForce = 0; //顶板强制上升命令,1-有效,0-无效
  378. uint8 bled_flg_topDescendCmdForce = 0; //顶板强制下降命令,1-有效,0-无效
  379. uint8 bled_flg_openDustReCmd = 0; //除尘打开指令,1-有效,0-无效
  380. uint8 bled_flg_closeDustReCmd = 0; //除尘关闭指令,1-有效,0-无效
  381. uint8 bled_flg_Heart = 0; //心跳维持指令
  382. uint8 bled_flg_getEbcData = 0; //获取ebc数据指令
  383. uint8 bled_flg_getVcuData = 0; //获取vcu数据指令
  384. uint8 bled_flg_getBmsData = 0; //获取bms数据指令
  385. uint8 bled_flg_handShake = 0; //握手指令
  386. uint8 bled_flg_swapBattDone = 0; //换电完成指令
  387. uint8 bled_flg_backToDrv = 0; //回到行驶状态指令
  388. uint8 bled_flg_autoLock = 0; //自动锁定指令
  389. uint8 bled_flg_autoUnlock = 0; //自动解锁指令
  390. uint8 bled_flg_toSwapMod = 0; //换到换电状态
  391. uint8 bled_flg_safeStopCmd = 0; //急停指令
  392. uint32 bled_Nr_softVer = 0; // BLE软件版本
  393. uint8 bled_flg_role = 0; // ble的主从模式 01-主,02-从
  394. uint8 bled_flg_bleConn = 0; // ble蓝牙连接状态
  395. uint8 bled_flg_bleDisconn = 0; // ble蓝牙断开状态
  396. uint8 bled_st_dataTrans = 0; //蓝牙数据传输状态
  397. /*
  398. ebc应用层变量
  399. */
  400. uint8 ebcd_flg_Can2SendEnbale = 0; //应答BLE的使能
  401. uint8 ebcd_st_toBleAns = 0; //应答BLE的指令序号
  402. uint8 ebcd_P_airSensor = 0; //压力传感器气压值:单位Mpa,精度0.01Mpa
  403. uint8 ebcd_T_plugin[4] = {0}; //四个接插件温度,加了偏移量40
  404. uint8 ebcd_flg_forbidHVOn = 0; //禁止高压上电 BMS
  405. uint8 ebcb_flg_reqHvOff = 0; //请求高压下电 BMS
  406. uint8 ebcd_flg_LockErr = 0; //锁紧机构故障状态,0-异常,1-正常
  407. uint8 ebcd_flg_dChrgLockErr = 0; //放电互锁故障状态
  408. uint8 ebcd_flg_chrgLockErr = 0; //充电互锁故障状态
  409. uint8 ebcd_flg_dChgCnctOverTemp = 0; //放电连接器过温标志
  410. uint8 ebcd_st_ebcWork = DriveMode; // Ebc当前状态 0-行车,1-通讯(握手才进入通讯状态),2-换电
  411. uint8 ebcd_Nr_errMax; //故障等级:当前故障最大等级
  412. uint8 ebcd_Num_faultCode; // ebc故障码,未定义
  413. uint8 ebcd_st_chargingMod; //充电模式,1-车载充电,2-换电站充电
  414. uint8 ebdc_st_lockUpState = 0; //锁止机构状态,0-故障,1-解锁成功,2-上锁成功
  415. uint8 ebdc_st_ConnecState = 0; //换电连接器状态(充电回路&放电回路同时闭合代表闭合,有一路断开则为断开),0_未连接 1_连接
  416. uint8 ebcd_flg_pluginLockSig; //互锁接插件信号状态,1-触发,0-无触发
  417. uint8 ebcd_flg_swapAdmit; //允许换电判断:0-不允许,1-允许
  418. uint8 ebcd_Num_err1; //故障码1
  419. uint8 ebcd_Num_err2; //故障码2
  420. uint8 ebcd_st_ebcConnect; // Ebc通讯模式,0-无线蓝牙,1-有线连接 ,默认0
  421. uint8 ebcd_st_ebcLockWork; // Ebc解锁模式,0-单步模式,1-自动模式
  422. uint8 ebcd_st_errTable1; //故障表1,bit0-气压异常,bit1-液位异常,bit2-Flash读取异常
  423. uint8 ebcd_st_errTable2; //故障表2,bit0-互锁异常,bit1-整车CAN异常,bit2-电池CAN异常,bit3-锁钩异常,bit4-升降机异常,bit5-电池位置异常
  424. uint8 ebcd_st_errTable3; //故障表3,bit0-放电互锁异常,bit1-充电互锁异常,bit2-整车高压互锁异常
  425. uint8 ebcd_st_lockSensor; //锁紧传感器信号:bit0-bit3:传感器0-3的状态每,bit:1-触发,0-不触发
  426. uint8 ebcd_st_lockSucJug; //锁紧完成判断:0-完全未锁紧,1-完全锁紧,2-未完全锁紧"
  427. uint8 ebcd_st_pedstSensor; //底座落座传感器:bit0-bit1:传感器0-1的状态,每bit:1-触发,0-无触发
  428. uint8 ebcd_st_pedstSucJug; //电池底座到位判断:0-完全未到位,1-完全到位,2-未完全到位
  429. uint8 ebcd_st_pluginLockSig; //互锁接插件信号具体状态,1-触发,0-无触发
  430. uint8 ebcd_st_unlockSensor; //解锁传感器信号:bit0-bit3:传感器0-3的状态每,bit:1-触发,0-不触发
  431. uint8 ebcd_st_unlockSucJug; //解锁完成判断:0-完全未解锁,1-完全解锁,2-未完全解锁
  432. uint8 m_flg_HVlock1 = 0; //互锁状态1,电池换电接插件
  433. uint8 m_flg_HVlock2 = 0; //互锁状态2,整车放电接插件
  434. uint16 Test_LockPressure = 0; //锁紧力测试
  435. uint8 ebcd_flg_ebcManCtrlEn = 0; // EBC手动控制使能
  436. uint8 ebcd_flg_ebcManCtrlMode = 0; // EBC手动控制模式
  437. uint8 BattHvCtl = 0;
  438. #define EEPDATA_START_SEC_VAR
  439. #include "MemMap.h"
  440. uint16 ebcd_Nr_swapBatt; //换电次数
  441. uint16 ebcd_Nr_swapSucBatt; //换电成功次数
  442. uint16 ManuControlTimes = 0;
  443. uint16 LockDelayTime = 0; //锁定延时时间(传感器到位以后延时多少时间确定为锁定成功
  444. uint16 UnlockDelayTime = 0; //解锁延时时间(传感器到位以后延时多少时间确定为解锁成功
  445. uint8 sfmv_Num_FltEEsave = 0;
  446. #define EEPDATA_STOP_SEC_VAR
  447. #include "MemMap.h"
  448. #define APPLAYERVER_START_SEC_VAR
  449. #include "MemMap.h"
  450. const uint8 T_table[240] = {239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224,
  451. 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203,
  452. 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182,
  453. 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161,
  454. 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
  455. 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119,
  456. 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97,
  457. 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69,
  458. 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41,
  459. 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13,
  460. 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
  461. const uint32 R_table[240] = {125, 127, 129, 131, 133, 136, 138, 141, 143, 145, 148, 151, 153, 156, 159, 162, 165,
  462. 168, 171, 174, 177, 180, 183, 187, 190, 194, 198, 201, 205, 209, 213, 217, 221, 226, 230, 234, 239, 244, 249,
  463. 254, 259, 264, 269, 274, 280, 286, 292, 298, 304, 310, 316, 323, 330, 337, 344, 351, 359, 366, 374, 382, 391,
  464. 399, 408, 417, 426, 436, 445, 455, 466, 476, 487, 498, 509, 521, 533, 546, 558, 571, 585, 599, 613, 627, 642,
  465. 658, 674, 690, 707, 724, 742, 760, 779, 799, 819, 839, 861, 883, 905, 928, 952, 977, 1002, 1029, 1056, 1083,
  466. 1112, 1142, 1172, 1204, 1236, 1270, 1305, 1340, 1377, 1415, 1455, 1495, 1537, 1581, 1626, 1672, 1720, 1769,
  467. 1821, 1874, 1928, 1985, 2044, 2104, 2167, 2232, 2299, 2369, 2441, 2515, 2592, 2672, 2755, 2841, 2931, 3023,
  468. 3119, 3218, 3321, 3428, 3539, 3654, 3773, 3898, 4026, 4160, 4299, 4443, 4593, 4749, 4911, 5080, 5255, 5438,
  469. 5627, 5825, 6030, 6244, 6466, 6698, 6940, 7191, 7454, 7727, 8012, 8309, 8619, 8942, 9280, 9632, 10000, 10383,
  470. 10784, 11203, 11641, 12098, 12577, 13077, 13600, 14147, 14720, 15319, 15947, 16604, 17293, 18015, 18771,
  471. 19564, 20395, 21268, 22183, 23144, 24152, 25211, 26324, 27493, 28722, 30014, 31373, 32802, 34307, 35891,
  472. 37558, 39315, 41166, 43117, 45174, 47343, 49633, 52049, 54599, 57293, 60140, 63148, 66329, 69693, 73252,
  473. 77019, 81008, 85233, 89710, 94455, 99488, 104827, 110493, 116508, 122898, 129687, 136905, 144580,
  474. 152746, 161438, 170694, 180554, 191063, 202269};
  475. #define APPLAYERVER_STOP_SEC_VAR
  476. #include "MemMap.h"