AppGlobalVar.c 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. /*
  2. * @Author : ChenJie
  3. * @Date : 2022-01-23 13:45:09
  4. * @Version : V3.0
  5. * @LastEditors: chenjie
  6. * @LastEditTime: 2022-11-10
  7. * @Description : file content
  8. * @FilePath: \S32K146_4G\code\app\AppGlobalVar.c
  9. */
  10. /*
  11. * AppGlobalVar.c
  12. *应用层全局变量
  13. * Created on: 2022年1月19日
  14. * Author: QiXiang_CHENJIE
  15. */
  16. #include "AppGlobalVar.h"
  17. #define defaultSn "ZLTEST00000000003"
  18. //#define APP_RELEASE
  19. #ifdef APP_RELEASE
  20. const char WebSiteName[] = "\"iotp.fast-fun.cn\"";
  21. uint16 WebSitePort = 8712;
  22. #define EEP_START_SEC_VAR_INIT_8_NO_CACHEABLE
  23. #include "Eep_MemMap.h"
  24. AppConfigBody AppConfigInfo = {false, true, {defaultSn}, {0}};
  25. BcuSaveType BcuSaveDataInfo = {0};
  26. BcuAppSaveBody BcuAppSaveDataInfoDefaultValue =
  27. {
  28. //uint8 1*16
  29. 0,23,01,01,0,0,0,0,
  30. 0,0,0,0,0,0,0,0,
  31. //uint16 2*8
  32. 0,0,0,0,0,0,0,0,
  33. //float 4*24
  34. 0,0,100,0,0,0,0,0,
  35. 0,0,0,0,0,0,0,0,
  36. 0,0,0,0,0,0,0,0
  37. };
  38. #define EEP_STOP_SEC_VAR_INIT_8_NO_CACHEABLE
  39. #include "Eep_MemMap.h"
  40. #else
  41. const char WebSiteName[] = "\"nas.fast-fun.cn\"";
  42. uint16 WebSitePort = 8812;
  43. #define EEP_START_SEC_VAR_INIT_8_NO_CACHEABLE
  44. #include "Eep_MemMap.h"
  45. AppConfigBody AppConfigInfo = {false, true, {defaultSn}, {0}};
  46. BcuSaveType BcuSaveDataInfo = {0};
  47. BcuAppSaveBody BcuAppSaveDataInfoDefaultValue =
  48. {
  49. //uint8 1*16
  50. 0,23,01,01,0,0,0,0,
  51. 0,0,0,0,0,0,0,0,
  52. //uint16 2*8
  53. 0,0,0,0,0,0,0,0,
  54. //float 4*24
  55. 0,0,100,0,0,0,0,0,
  56. 0,0,0,0,0,0,0,0,
  57. 0,0,0,0,0,0,0,0
  58. };
  59. #define EEP_STOP_SEC_VAR_INIT_8_NO_CACHEABLE
  60. #include "Eep_MemMap.h"
  61. #endif
  62. //*全局变量*//
  63. const uint32 AppSwVersion = 0x0002000D;
  64. const uint8 DataModuleType = 0x02; // 01=NB,02-4G
  65. const uint16 HwVersion = 0x0102;
  66. const uint32 BlSwVersion = 0x00000002;
  67. const uint32 DrvSwVersion = 0x00000004;
  68. const uint8 BmsManuFacture = 0xff;
  69. const uint8 BmsInfo = 0xff;
  70. uint8 TcpbattSN[BATT_SN_LEN] = {0x31};
  71. uint8 VIN[17] = {0};
  72. volatile uint32 TimerCounter = 0; // ms单位
  73. uint32 BattTempR[4] = {0}; // ADC查询的温度R值
  74. uint16 ErrorArray[10] = {0};
  75. uint8 Fota_update_flag = 0;
  76. boolean Fota_Process_Going = false;
  77. uint8 Fota_error_flag = 0;
  78. uint8 DeviceErrNum = 0;
  79. uint8 globalSaveFlag = 0;
  80. /*GPS*/
  81. QueueHandle_t GpsDataQueueHandle;
  82. sint16 xyzData[3] = {0};
  83. /*Hal_Can*/
  84. uint8 CanIf_u8TxConfirmCnt = 0U;
  85. boolean CanIf_bTxFlag = false;
  86. uint8 CanIf_u8RxIndicationCnt = 0U;
  87. boolean CanIf_bRxFlag = false;
  88. QueueHandle_t CanRecvQueueHandle0;
  89. QueueHandle_t CanRecvQueueHandle1;
  90. QueueHandle_t CanRecvQueueHandle2;
  91. TaskHandle_t Uart_Hal_RecvTask_Handle, Uart_Hal_SendTask_Handle, MainTask_Handle, Uart0Task_Handle, CanTask_Handle, GpsTask_Handle, Uart_4G_Task_Handle,BBox_BCU_Task_Handle;
  92. SemaphoreHandle_t sleep_mutex = NULL;
  93. bool TcpSysReboot = 0;
  94. char ImeiNum[15] = {0};
  95. char IccidNum[20] = {0};
  96. uint8 CSQValue = 0;
  97. sint8 SocketId = -1;
  98. sint8 RegChkRet = 0;
  99. char WebSiteIp[20] = {0};
  100. uint8 TcpWorkState = 0;
  101. uint16 DeviceSpeed = 0;
  102. real_T returnFreq[3][5];
  103. real_T returnP[3][5];
  104. /*以下变量均为App_CAN相关变量*/
  105. #ifdef APP_CAN_ENABLE
  106. // VCU相关
  107. uint8 vehicleStatus = 0;
  108. uint8 bmsHVOn = 0;
  109. uint8 currentGearPosition = 0;
  110. uint8 parkingBreakStatus = 0;
  111. uint8 breakingStatus = 0;
  112. uint32 ODO = 0;
  113. uint8 dcdcWorkStatus = 0;
  114. uint8 numOfChrgableSubsys = 0;
  115. uint8 chrgableSubsysCode = 0;
  116. uint16 vcuDCVol = 0;
  117. // EBC相关
  118. uint8 ebcStatus = 0;
  119. uint8 ebcAskHVOn = 0;
  120. uint8 ebcAskHVOff = 0;
  121. uint8 retainLockSignal = 0;
  122. uint8 dischargeLockSignal = 0;
  123. uint8 chargeLockSignal = 0;
  124. uint8 chargeFlag = 0;
  125. // Bcu相关
  126. UINT32 BcuInTable[28] = {
  127. 0x1801D0F3,
  128. 0x1801D8F3,
  129. 0x1880D0F3,
  130. 0x1881D0F3,
  131. 0x1882D0F3,
  132. 0x1883D0F3,
  133. 0x1884D0F3,
  134. 0x1885D0F3,
  135. 0x1886D0F3,
  136. 0x1887D0F3,
  137. 0x1888D0F3,
  138. 0x1889D0F3,
  139. 0x188AD0F3,
  140. 0x18C1D0F3,
  141. 0x18C2D0F3,
  142. 0x18E1D0F3,
  143. 0x18E2D0F3,
  144. 0x18E3D0F3,
  145. 0x18E4D0F3,
  146. 0x18E5D0F3,
  147. 0x18E6D0F3,
  148. 0x18F1D0F3,
  149. 0x18F2D0F3,
  150. 0x18F3D0F3,
  151. 0x18F4D0F3,
  152. 0x18F5D0F3,
  153. 0x18FF45F4,
  154. 0x18FFC13A,
  155. };
  156. BOOL BcuRxShortError[28];
  157. BOOL BcuRxLongError[28];
  158. UINT8 BcuRxErrorCounter[28];
  159. UINT8 BcuRxFlag[28];
  160. /************************************************************
  161. *BCU->4G解码变量存放区
  162. ************************************************************/
  163. UINT8 BMS_CellRecvFlg = 0; //电压收取标志位
  164. UINT8 canRecvFramNum[BMS_CELL_MAX_NUM/3] = {0};
  165. UINT8 BMS_ReqVIN = 0x00; // 是否请求VIN码,0:预留;1:请求VIN;2:不请求VIN;3:无效;,Re-1,Off-0,
  166. UINT8 BMS_ReqHVOff = 0x00; // 是否请求下高压,0:预留;1:请求下高压;2:不请求下高压;3:无效;,Re-1,Off-0,
  167. UINT8 BMS_ProtocolEditionH = 0x00; // 通讯协议版本高位(例 : 版本为3 .1, 则此处发3), , Re - 1, Off - 0,
  168. UINT8 BMS_ProtocolEditionL = 0x00; // 通讯协议版本低位(例 : 版本为3 .1, 则此处发1), , Re - 1, Off - 0,
  169. UINT8 BMS_CharDevNum = 0x00; // 可充电装置系统序号(BMS是整车中可充电装置系统中的第几个, 需要整车告知),1,Re-1,Off-0,
  170. UINT8 BMS_FtPosRly = 0x00; // 主正继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  171. UINT8 BMS_FtNegRly = 0x00; // 主负继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  172. UINT8 BMS_FtPosCharRly1 = 0x00; // 充正1继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  173. UINT8 BMS_FtNegCharRly1 = 0x00; // 充负1继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  174. UINT8 BMS_FtPosCharRly2 = 0x00; // 充正2继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  175. UINT8 BMS_FtNegCharRly2 = 0x00; // 充负2继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  176. UINT8 BMS_FtHeatRly1 = 0x00; // 加热1/正继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  177. UINT8 BMS_FtHeatRly2 = 0x00; // 加热2/负继电器粘连故障,0:正常; 1:故障,Re-1,Off-0,
  178. UINT8 BMS_StPosRly = 0x00; // 主正继电器状态(如继电器状态由BMS检测),0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  179. UINT8 BMS_StNegRly = 0x00; // 主负继电器状态(如继电器状态由BMS检测),0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  180. UINT8 BMS_StPreCharRly = 0x00; // 预充继电器状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  181. UINT8 BMS_StPosCharRly1 = 0x00; // 直流充正继电器1状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  182. UINT8 BMS_StNegCharRly1 = 0x00; // 直流充负继电器1状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  183. UINT8 BMS_StPosCharRly2 = 0x00; // 直流充正继电器2状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  184. UINT8 BMS_StNegCharRly2 = 0x00; // 直流充负继电器2状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0,
  185. UINT8 BMS_FtAuxRelayWeld = 0x00; // 附件继电器粘连故障(保留),0:正常; 1:故障,Re-1,Off-0,
  186. UINT8 BMS_BraOpenCirc = 0x00; // 支路断路故障,0:正常; 1:故障,Re-1,Off-0,
  187. UINT8 BMS_FtBackCharCurrOutLim = 0x00; // 回充电流超限报警,0:正常1 : 1级 轻微故障 2 : 2级 较严重故障 3 : 3级 最严重故障, Re - 1, Off - 0,
  188. UINT8 BMS_FtPosRlyOpen = 0x00; // 主正继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  189. UINT8 BMS_FtNegRlyOpen = 0x00; // 主负继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  190. UINT8 BMS_FtPosCharRly1Open = 0x00; // 直流充电正1继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  191. UINT8 BMS_FtPosCharRly2Open = 0x00; // 直流充电正2继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  192. UINT8 BMS_FtNegCharRly1Open = 0x00; // 直流充电负1继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  193. UINT8 BMS_FtNegCharRly2Open = 0x00; // 直流充电负2继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  194. UINT8 BMS_FtTMSContClose = 0x00; // 加热膜或TMS接触器无法断开报警,0:正常; 1:故障,Re-1,Off-0,
  195. UINT8 BMS_FtTMSContOpen = 0x00; // 加热膜或TMS接触器无法闭合报警,0:正常; 1:故障,Re-1,Off-0,
  196. UINT8 BMS_FtTMS = 0x00; // 热管理系统故障,0:正常; 1:故障,Re-1,Off-0,
  197. UINT8 BMS_Ft24VSpy = 0x00; // BMS 24V供电异常报警,0:正常; 1:故障,Re-1,Off-0,
  198. UINT8 BMS_FtPACKSelfProt = 0x00; // 电池包自保护报警,0:正常; 1:故障,Re-1,Off-0,
  199. UINT8 BMS_FtCharSockTempOver = 0x00; // 充电插座过温报警,0:正常1 : 1级 轻微故障 2 : 2级 较严重故障 3 : 3级 最严重故障, Re - 1, Off - 0,
  200. UINT8 BMS_FtTempOutCtrl = 0x00; // 热失控报警,0:正常; 1:故障,Re-1,Off-0,
  201. UINT8 BMS_StPosHeatRly = 0x00; // 加热正继电器状态,0:保留;1:开启;2:闭合;3:无效,Re-1,Off-0,
  202. UINT8 BMS_StNegHeatRly = 0x00; // 加热负继电器状态,0:保留;1:开启;2:闭合;3:无效,Re-1,Off-0,
  203. UINT8 BMS_CharSysNum = 0x00; // 可充电储能子系统总数(保留),,Re-1,Off-0,
  204. UINT8 BMS_FtCode = 0x00; // 电池系统故障码,详见附表电池系统故障码列表,Re-1,Off-0,
  205. 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,
  206. UINT8 BMS_ST1Counter = 0x00; // B2V_ST1的生命信号,0~14循环,15:信号无效,Re-1,Off-0,
  207. UINT8 BMS_Mode = 0x00; // BMS当前状态,0-未上高压,2-上高压
  208. UINT8 BMS_AuxRlySt = 0x00; // 附件继电器状态,0:开启;1:闭合;,Re-1,Off-0,
  209. UINT8 BMS_BattBalaSt = 0x00; // BMS当前均衡状态,0:未开启均衡;1:开启均衡;,Re-1,Off-0,
  210. UINT8 BMS_CharGunSt = 0x00; // 直流充电枪连接状态,0:未连接1 : 连接, Re - 1, Off - 0,
  211. UINT8 BMS_CharMode = 0x00; // BMS当前充电模式,0:预留1 : 直流充电 2 : 交流充电 3 : 其他充电, Re - 1, Off - 0,
  212. UINT8 BMS_CharSt = 0x00; // 充电状态,0:可以充电1 : 正在充电 2 : 充电结束 3 : 充电故障, Re - 1, Off - 0,
  213. UINT8 BMS_FtLvl = 0x00; // 当前最高故障等级,0:正常1 : 1级 轻微故障 2 : 2级 较严重故障 3 : 3级 最严重故障, Re - 1, Off - 0,
  214. UINT8 BMS_FtCellTempDiff = 0x00; // 电芯温差异常报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  215. UINT8 BMS_FtCellTempHigh = 0x00; // 电芯温度过高报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  216. UINT8 BMS_FtPACKOverVolt = 0x00; // PACK过压报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  217. UINT8 BMS_FtPACKUndeVolt = 0x00; // PACK欠压报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  218. UINT8 BMS_FtSOCLow = 0x00; // SOC过低报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  219. UINT8 BMS_FtCellOverVolt = 0x00; // 单体电压过高报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  220. UINT8 BMS_FtCellUndeVolt = 0x00; // 单体电压欠压报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  221. UINT8 BMS_FtIns = 0x00; // 绝缘报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  222. UINT8 BMS_FtCellOverVoltDiff = 0x00; // 单体压差过大,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  223. UINT8 BMS_FtCharCurrOver = 0x00; // 充电电流过大报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  224. UINT8 BMS_FtDisCharCurrOver = 0x00; // 放电电流过大报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  225. UINT8 BMS_FtCellTempLow = 0x00; // 电芯温度过低报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  226. UINT8 BMS_FtBranVoltDifOver = 0x00; // 支路压差过大报警(存在并联支路的系统),0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  227. UINT8 BMS_FtBMSHardWare = 0x00; // BMS硬件故障,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0,
  228. UINT8 BMS_FtSOCHigh = 0x00; // SOC过高报警,0:正常; 1:故障,Re-1,Off-0,
  229. UINT8 BMS_FtSOCJump = 0x00; // SOC跳变报警,0:正常; 1:故障,Re-1,Off-0,
  230. UINT8 BMS_FtInCom = 0x00; // BMS内部通信故障,0:正常; 1:故障,Re-1,Off-0,
  231. UINT8 BMS_FtSysMism = 0x00; // BMS/可充电储能系统不匹配报警,0:正常; 1:故障,Re-1,Off-0,
  232. UINT8 BMS_FtHvIntLock = 0x00; // 高压互锁报警,0:正常; 1:故障,Re-1,Off-0,
  233. UINT8 BMS_FtSmoke = 0x00; // 火警探测器故障,0:正常; 1:故障,Re-1,Off-0,
  234. UINT8 BMS_FtFire = 0x00; // 电池包火灾报警,0:正常; 1:故障,Re-1,Off-0,
  235. UINT8 BMS_FtNum = 0x00; // BMS当前发生的故障总数目(包括GB32960中规定的故障数目),,Re-1,Off-0,
  236. UINT8 BMS_PackSOC = 0x00; // 电池包SOC,,Re-0.4,Off-0,
  237. UINT8 BMS_PackSOH = 0x00; // 电池包SOH,,Re-0.4,Off-0,
  238. UINT8 BMS_MaxCellTemp = 0x00; // 单体最高温度,,Re-1,Off--50,℃
  239. UINT8 BMS_MinCellTemp = 0x00; // 单体最低温度,,Re-1,Off--50,℃
  240. UINT8 BMS_AverCellTemp = 0x00; // 单体平均温度,,Re-1,Off--50,℃
  241. UINT8 BMS_MaxCellTempCSC = 0x00; // 最高温度电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0,
  242. UINT8 BMS_MaxCellTempNum = 0x00; // 最高温度电芯所在子系统(CSC)内温度探针编号,范围(1~255),Re-1,Off-0,
  243. UINT8 BMS_MinCellTempCSC = 0x00; // 最低温度电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0,
  244. UINT8 BMS_MinCellTempNum = 0x00; // 最低温度电芯所在子系统(CSC)内温度探针编号,范围(1~255),Re-1,Off-0,
  245. UINT8 BMS_MaxCellVoltCSC = 0x00; // 最高电压电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0,
  246. UINT8 BMS_MaxCellVoltNum = 0x00; // 最高电压电芯所在子系统(CSC)内单体编号,范围(1~255),Re-1,Off-0,
  247. UINT8 BMS_MinCellVoltCSC = 0x00; // 最低电压电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0,
  248. UINT8 BMS_MinCellVoltNum = 0x00; // 最低电压电芯所在子系统(CSC)内单体编号,范围(1~255),Re-1,Off-0,
  249. UINT8 BMS_InsDeteSt = 0x00; // BMS绝缘检测状态,0:停止检测;1:激活检测;,Re-1,Off-0,
  250. UINT8 BMS_FtCharInsLow = 0x00; // 充电绝缘阻值低,0:正常; 1:故障,Re-1,Off-0,
  251. UINT8 BMS_FtCurrSenr = 0x00; // 电流传感器故障,0:正常; 1:故障,Re-1,Off-0,
  252. UINT8 BMS_FtHeatingFilm = 0x00; // 加热膜加热回路故障,0:正常; 1:故障,Re-1,Off-0,
  253. UINT8 BMS_FtMainLoopPreChar = 0x00; // 主回路预充或预检故障,0:正常; 1:故障,Re-1,Off-0,
  254. UINT8 BMS_FtAuxLoopPreChar = 0x00; // 辅件回路预充或预检故障,0:正常; 1:故障,Re-1,Off-0,
  255. UINT8 BMS_FtACANLost = 0x00; // ACAN/整车CAN通讯故障,0:正常; 1:故障,Re-1,Off-0,
  256. UINT8 BMS_FtDCDC = 0x00; // BMS-DC-DC故障,0:正常; 1:故障,Re-1,Off-0,
  257. UINT8 BMS_FtSOCDif = 0x00; // SOC差异过大,0:正常; 1:故障,Re-1,Off-0,
  258. UINT8 BMS_FtCellOverDisChar = 0x00; // 电芯过放故障,0:正常; 1:故障,Re-1,Off-0,
  259. UINT8 BMS_FtCharOver = 0x00; // 车载储能装置过充报警,0:正常;1:1级 轻微故障;2:2级 较严重故障3 : 10级 最严重故障, Re - 1, Off - 0,
  260. UINT8 BMS_FtContDisCharCurrOverLoad = 0x00; // 持续回充过流故障,0:正常;1:1级 轻微故障;2:2级 较严重故障3 : 10级 最严重故障, Re - 1, Off - 0,
  261. UINT8 BMS_FtContCharCurrOverLoad = 0x00; // 持续放电过流故障,0:正常;1:1级 轻微故障;2:2级 较严重故障3 : 10级 最严重故障, Re - 1, Off - 0,
  262. UINT8 BMS_Gun1DCNegTemp = 0x00; // 充电口1负温感值,,Re-1,Off--40,℃
  263. UINT8 BMS_Gun1DCPosTemp = 0x00; // 充电口1正温感值,,Re-1,Off--40,℃
  264. UINT8 BMS_Gun2DCNegTemp = 0x00; // 充电口2负温感值,,Re-1,Off--40,℃
  265. UINT8 BMS_Gun2DCPosTemp = 0x00; // 充电口2正温感值,,Re-1,Off--40,℃
  266. UINT8 BMS_CurrHeatSt = 0x00; // 当前加热状态,0:未加热;1:加热中;2:预留;3:无效;,Re-1,Off-0,
  267. UINT8 BMS_CurrCoolSt = 0x00; // 当前冷却状态,0:未冷却;1:冷却中;2:预留;3:无效;,Re-1,Off-0,
  268. UINT8 BMS_FtCharCnct = 0x00; // 插枪连接信号异常,0:正常; 1:故障,Re-1,Off-0,
  269. UINT8 BMS_FtOverDisCharCurrDuringChar = 0x00; // 充电时放电电流过大,0:正常; 1:故障,Re-1,Off-0,
  270. UINT8 BMS_FtCharNTC = 0x00; // 充电插座NTC故障,0:正常; 1:故障,Re-1,Off-0,
  271. UINT8 BMS_FtELock = 0x00; // 电子锁故障,0:正常; 1:故障,Re-1,Off-0,
  272. UINT8 BMS_CellVoltFramNum = 0x00; // 单体电压帧序号,有效值1~255,Re-1,Off-0,
  273. UINT8 BMS_CellTempFramNum = 0x00; // 温度帧序号,有效值1~255,Re-1,Off-0,
  274. UINT8 BMS_CSC_Code = 0x00; // 子系统编号CSC,有效值1~255,Re-1,Off-0,
  275. UINT8 BMS_CellTemp[BMS_TEMP_MAX_NUM] = {0x00}; // 当前CSC下的第N个探针的温度,255 "Invalid" 0xFF 无效有效值 0 ~254, 单位 ℃, 范围(-50 ~204)℃, , Re - 1, Off-- 50,℃
  276. UINT8 BMS_Checksum = 0x00; // 电池编码信息1的CheckSum,Byte0=Byte1 XOR Byte2 XOR Byte3 XOR Byte4 XOR Byte5 XOR Byte6 XOR Byte7,Re-1,Off-0,
  277. UINT8 BMS_PackComp = 0x00; // 电池厂家,1:"CATL" 2:"Li Shen" 3:"MGL" 4:"SAMSUN" 5:"LG",Re-1,Off-0,
  278. UINT8 BMS_BattCodeLeng = 0x00; // 电池编码长度,0:Do not transmit this Code,Re-1,Off-0,
  279. UINT8 BMS_SN[27] = {0}; // 电池编码(SN)字符1(ASCII),,Re-1,Off-0,
  280. UINT8 BMS_BattType = 0x00; // 电池类型,1:铅酸电池; 2:镍氢电池; 3:磷酸铁锂电池; 4:锰酸锂电池; 5:钴酸锂电池; 6:三元材料电池; 7:聚合物锂离子电池; 8:钛酸锂电池; 9:超级电容; 10~13:保留; 14:燃料电池;15:保留,Re-1,Off-0,
  281. UINT8 BMS_CoolType = 0x00; // 电池冷却方式,0:其他冷却方式1 : 自然冷却 2 : 风扇冷却 3 : 水冷却, Re - 1, Off - 0,
  282. UINT8 BMS_CSC_Total = 0x00; // 电池系统中CSC总的数目,,Re-1,Off-0,
  283. UINT8 BMS_CellVoltLevel = 0x00; // 单体平台电压(非实时变化的值),有效值0~5V; 255 "Signal Invalid" 0xFF 无效,Re-0.1,Off-0,V
  284. UINT8 BMS_CellMinVolt = 0x00; // 单体可用最低电压(非实时变化的值),有效值0~5V; 255 "Signal Invalid" 0xFF 无效,Re-0.1,Off-0,V
  285. UINT8 BMS_CellMaxVolt = 0x00; // 单体可用最高电压(非实时变化的值),有效值0~5V; 255 "Signal Invalid" 0xFF 无效,Re-0.1,Off-0,V
  286. UINT8 BMS_HVBranNum = 0x00; // 电池系统高压支路数,,Re-1,Off-0,
  287. UINT8 BMS_SingleHVBranchCellNum = 0x00; // 电池系统单支路电芯数,,Re-1,Off-0,
  288. UINT8 BMS_ReqMode = 0x00; // BMS请求设定模式,0:关机模式1 : 制冷模式 2 : 制热模式 3 : 自循环模式, Re - 1, Off - 0,
  289. UINT8 BMS_HVCmd = 0x00; // 高压请求,0:请求上高压1 : 请求下高压, Re - 1, Off - 0,
  290. UINT8 BMS_ChgSts = 0x00; // 充电状态,0:非充电1 : 充电, Re - 1, Off - 0,
  291. UINT8 BMS_HVRelaySts = 0x00; // BMS高压继电器状态,0:断开状态; 1:闭合状态; 2~3:无效,Re-1,Off-0,
  292. UINT8 BMS_SetTemp = 0x00; // 设定温度,,Re-1,Off--40,
  293. UINT8 BMS_Life = 0x00; // BMS生命帧,,Re-1,Off-0,
  294. UINT8 BMS_CRC = 0x00; // CRC校验值,,Re-1,Off-0,
  295. UINT8 TMS_WorkStatus = 0x00; // TMS工作状态,0:关机模式1 : 制冷模式 2 : 制热模式 3 : 自循环模式, Re - 1, Off - 0,
  296. UINT8 TMS_HVRelayST = 0x00; // TMS高压继电器状态,0:断开状态; 1:闭合状态; 2~3:无效,Re-1,Off-0,
  297. UINT8 TMS_OutletTemp = 0x00; // 出水温度(机组到电池),255:无效,Re-1,Off--40,
  298. UINT8 TMS_InletTemp = 0x00; // 回水温度(电池到机组),255:无效,Re-1,Off--40,
  299. UINT8 TMS_ErrCode = 0x00; // TMS故障码,0:无故障; 出现 1 种以上循环发送,Re-1,Off-0,
  300. UINT8 TMS_FaultLevel = 0x00; // TMS故障码等级,0:无效1 : 1级故障 2 : 2级故障 3 : 3级故障, Re - 1, Off - 0,
  301. UINT16 BMS_SoftwareVersion = 0x00; // 软件版本号:RyyyBzzz(R为软件版本、B为测试版本、正式版本不带B) ,yyy:0~254,精度1,255:无效,不显示;zzz:0~254,精度1,255:无效,不显示;
  302. UINT16 BMS_HardwareVersion = 0x00; // 硬件版本号:VyyyBzzz(V为硬件版本、B为测试版本、正式版本不带B) ,,Re-1,Off-0,
  303. UINT16 BMS_PackCurr = 0x00; // 电池包总电流,充电为负值,放电为正值,,Re-0.1,Off--1000,A
  304. UINT16 BMS_MaxCharCurr = 0x00; // 电池包最大回充电流,,Re-0.1,Off--1000,A
  305. UINT16 BMS_MaxDisCharCurr = 0x00; // 电池包最大放电电流,,Re-0.1,Off--1000,A
  306. UINT16 BMS_PosIns = 0x00; // 母线正对车体绝缘电阻,,Re-1,Off-0,KΩ
  307. UINT16 BMS_NegIns = 0x00; // 母线负对车体绝缘电阻,,Re-1,Off-0,KΩ
  308. UINT16 BMS_BattVolt = 0x00; // 电池包内侧电压,,Re-0.1,Off-0,V
  309. UINT16 BMS_LinkVolt = 0x00; // 电池包外侧电压,,Re-0.1,Off-0,V
  310. UINT16 BMS_MaxCellVolt = 0x00; // 单体最高电压值,,Re-0.001,Off-0,V
  311. UINT16 BMS_AverCellVolt = 0x00; // 电芯电压平均值,,Re-0.001,Off-0,V
  312. UINT16 BMS_MinCellVolt = 0x00; // 电芯最低电压值,,Re-0.001,Off-0,V
  313. UINT16 BMS_ContChrgCurr = 0x00; // BMS允许的持续回充电流,,Re-0.1,Off-0,A
  314. UINT16 BMS_ContDisCharCurr = 0x00; // BMS允许的持续放电电流,,Re-0.1,Off--1000,A
  315. UINT16 BMS_CharReqVolt = 0x00; // 充电所需电压(交流),,Re-0.1,Off-0,V
  316. UINT16 BMS_CharReqCurr = 0x00; // 充电所需电流(交流),,Re-0.1,Off--1000,A
  317. UINT16 BMS_SysInsRes = 0x00; // 系统绝缘电阻,,Re-1,Off-0,KΩ
  318. UINT16 BMS_MaxDisCharPwr = 0x00; // 最大允许放电功率,,Re-0.1,Off-0,kw
  319. UINT16 BMS_MaxCharPwr = 0x00; // 最大允许充电功率,,Re-0.1,Off-0,kw
  320. UINT16 BMS_ContDisCharPwr = 0x00; // BMS允许的持续放电功率,,Re-0.1,Off-0,kw
  321. UINT16 BMS_ContCharPwr = 0x00; // BMS允许的持续充电功率,,Re-0.1,Off-0,kw
  322. UINT16 BMS_InstEngyCons = 0x00; // 动力电池瞬时百公里能耗,,Re-0.1,Off-0,kwh
  323. UINT16 BMS_TotalEngyCons = 0x00; // 动力电池总/平均百公里能耗,,Re-0.1,Off-0,kwh
  324. UINT16 BMS_SOE = 0x00; // 剩余电量,,Re-0.01,Off-0,kwh
  325. UINT16 BMS_RmanCharTime = 0x00; // 剩余充电时间,,Re-1,Off-0,min
  326. UINT16 BMS_CharNum = 0x00; // 充电次数,,Re-1,Off-0,
  327. UINT16 BMS_CellVolt[BMS_CELL_MAX_NUM] = {0x00}; // 电芯的电压,65535 "Invalid" 0xFFFF 无效有效值 0 ~65534, 范围(0 ~65.534) V, Re - 0.001, Off - 0, V
  328. UINT16 BMS_BattRateCap = 0x00; // 电池包额定容量,有效值 0~65534,65535 "Signal Invalid" 无效,Re-1,Off-0,Ah
  329. UINT16 BMS_BattRateVolt = 0x00; // 电池包额定电压,有效值 0~6553.4,65535 "Signal Invalid" 无效,Re-0.1,Off-0,V
  330. UINT16 BMS_BattRateEngy = 0x00; // 电池包额定能量,有效值 0~6553.4,65535 "Signal Invalid" 无效,Re-0.1,Off-0,kWh
  331. UINT16 BMS_CellTotal = BMS_CELL_MAX_NUM; // PACK中单体电芯的总数目,,Re-1,Off-0,//
  332. UINT16 BMS_TempTotal = BMS_TEMP_MAX_NUM; // PACK中电芯温度点(探针)的总数目,,Re-1,Off-0,
  333. UINT16 BMS_SingleCharEngy = 0x00; // 单次充电kWh 数,,Re-0.1,Off-0,KWh
  334. UINT16 BMS_SingleCharCapy = 0x00; // 单次充电Ah 数,,Re-0.1,Off-0,Ah
  335. UINT16 BMS_HVVolt = 0x00; // BMS当前电压,,Re-1,Off-0,
  336. UINT16 TMS_ReqPow = 0x00; // TMS需求功率,65535:无效,Re-0.1,Off-0,Kw
  337. UINT32 BMS_TotalCharEngy = 0x00; // 累计充入kWh 数,,Re-0.1,Off-0,KWh
  338. UINT32 BMS_TotalDischarEngy = 0x00; // 累计放出kWh 数,,Re-0.1,Off-0,KWh
  339. UINT32 BMS_TotalBackCharEngy = 0x00; // 累计动能回馈充入kWh 数,,Re-0.1,Off-0,KWh
  340. UINT32 BMS_TotalStaCharEngy = 0x00; // 累计换电站充入kWh 数,,Re-0.1,Off-0,KWh
  341. UINT32 BMS_TotalGunCharEngy = 0x00; // 累计插枪充电充入kWh 数,,Re-0.1,Off-0,KWh
  342. UINT32 BMS_TotalGunCharCapy = 0x00; // 累计插枪充电充入Ah 数,,Re-0.1,Off-0,Ah
  343. UINT32 BMS_TotalCharCapy = 0x00; // 累计充入Ah 数,,Re-0.1,Off-0,Ah
  344. UINT32 BMS_TotalDischarCapy = 0x00; // 累计放出Ah 数,,Re-0.1,Off-0,Ah
  345. UINT32 BMS_TotalBackCharCapy = 0x00; // 累计动能回馈充入Ah 数,,Re-0.1,Off-0,Ah
  346. UINT32 BMS_TotalStaCharCapy = 0x00; // 累计换电站充入Ah 数,,Re-0.1,Off-0,Ah
  347. /************************************************************
  348. *BBox计算变量定义区
  349. ************************************************************/
  350. UINT8 BBox_DataReadyFlag = 0;
  351. UINT8 BBox_VCUConSt = 0x01; //VCU 连接状态,用于判断电池连接与车或站的连接状态,1为站,0为车
  352. UINT8 BBox_PackSOC = 0x00; //BBox计算SOC,Re-0.4,Off-0;
  353. UINT8 BBox_PackSOH = 0x00; //BBox计算SOH,Re-1,Off-0;
  354. UINT32 BBox_TotalCharEngy = 0x00; // 累计充入kWh 数,,Re-0.1,Off-0,KWh
  355. UINT32 BBox_TotalDischarEngy = 0x00; // 累计放出kWh 数,,Re-0.1,Off-0,KWh
  356. UINT32 BBox_TotalBackCharEngy = 0x00; // 累计动能回馈充入kWh 数,,Re-0.1,Off-0,KWh
  357. UINT32 BBox_TotalStaCharEngy = 0x00; // 累计换电站充入kWh 数,,Re-0.1,Off-0,KWh
  358. UINT32 BBox_TotalGunCharEngy = 0x00; // 累计插枪充电充入kWh 数,,Re-0.1,Off-0,KWh
  359. UINT32 BBox_TotalGunCharCapy = 0x00; // 累计插枪充电充入Ah 数,,Re-0.1,Off-0,Ah
  360. UINT32 BBox_TotalCharCapy = 0x00; // 累计充入Ah 数,,Re-0.1,Off-0,Ah
  361. UINT32 BBox_TotalDischarCapy = 0x00; // 累计放出Ah 数,,Re-0.1,Off-0,Ah
  362. UINT32 BBox_TotalBackCharCapy = 0x00; // 累计动能回馈充入Ah 数,,Re-0.1,Off-0,Ah
  363. UINT32 BBox_TotalStaCharCapy = 0x00; // 累计换电站充入Ah 数,,Re-0.1,Off-0,Ah
  364. UINT32 BBox_Dq_Dv_MAX = 0x00; //BBox计算dq/dv_MAX,Re-0.001,Off-0,Ah/10mV
  365. UINT32 BBox_Dq_Dv_MIN = 0x00; //BBox计算dq/dv_MIN,Re-0.001,Off-0,Ah/10mV
  366. float BBox_SocCorrectionValue = 0x00; //BBox的SOC修正量,平台下发,Re-0.1,0ff-100,1bit std for 0.1% -100~100
  367. float BBox_SohCorrectionValue = 0x00; //BBox的SOHC修正量,平台下发,Re-0.1,0ff-0,1bit std for 0.1% 1~100
  368. #endif