/* * @Author : ChenJie * @Date : 2022-01-23 13:45:09 * @Version : V3.0 * @LastEditors: chenjie * @LastEditTime: 2022-11-10 * @Description : file content * @FilePath: \S32K146_4G\code\app\AppGlobalVar.c */ /* * AppGlobalVar.c *应用层全局变量 * Created on: 2022年1月19日 * Author: QiXiang_CHENJIE */ #include "AppGlobalVar.h" #define defaultSn "ZLTEST00000000002" //#define APP_RELEASE #ifdef APP_RELEASE const char WebSiteName[] = "\"iotp.fast-fun.cn\""; uint16 WebSitePort = 8712; #define EEP_START_SEC_VAR_INIT_8_NO_CACHEABLE #include "Eep_MemMap.h" AppConfigBody AppConfigInfo = {false, false, {defaultSn}, {0}}; BcuAppSaveBody BcuAppSaveDataInfo = {0}; #define EEP_STOP_SEC_VAR_INIT_8_NO_CACHEABLE #include "Eep_MemMap.h" #else const char WebSiteName[] = "\"nas.fast-fun.cn\""; uint16 WebSitePort = 8812; #define EEP_START_SEC_VAR_INIT_8_NO_CACHEABLE #include "Eep_MemMap.h" AppConfigBody AppConfigInfo = {false, true, {defaultSn}, {0}}; BcuAppSaveBody BcuAppSaveDataInfo = {0}; #define EEP_STOP_SEC_VAR_INIT_8_NO_CACHEABLE #include "Eep_MemMap.h" #endif //*全局变量*// const uint32 AppSwVersion = 0x0002000A; const uint8 DataModuleType = 0x02; // 01=NB,02-4G const uint16 HwVersion = 0x0102; const uint32 BlSwVersion = 0x00000002; const uint32 DrvSwVersion = 0x00000004; const uint8 BmsManuFacture = 0xff; const uint8 BmsInfo = 0xff; uint8 TcpbattSN[BATT_SN_LEN] = {0x31}; uint8 VIN[17] = {0}; volatile uint32 TimerCounter = 0; // ms单位 uint32 BattTempR[4] = {0}; // ADC查询的温度R值 uint16 ErrorArray[10] = {0}; uint8 Fota_update_flag = 0; boolean Fota_Process_Going = false; uint8 Fota_error_flag = 0; uint8 DeviceErrNum = 0; /*GPS*/ QueueHandle_t GpsDataQueueHandle; sint16 xyzData[3] = {0}; /*Hal_Can*/ uint8 CanIf_u8TxConfirmCnt = 0U; boolean CanIf_bTxFlag = false; uint8 CanIf_u8RxIndicationCnt = 0U; boolean CanIf_bRxFlag = false; QueueHandle_t CanRecvQueueHandle0; QueueHandle_t CanRecvQueueHandle1; QueueHandle_t CanRecvQueueHandle2; 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; SemaphoreHandle_t sleep_mutex = NULL; bool TcpSysReboot = 0; char ImeiNum[15] = {0}; char IccidNum[20] = {0}; uint8 CSQValue = 0; sint8 SocketId = -1; sint8 RegChkRet = 0; char WebSiteIp[20] = {0}; uint8 TcpWorkState = 0; uint16 DeviceSpeed = 0; real_T returnFreq[3][5]; real_T returnP[3][5]; /*以下变量均为App_CAN相关变量*/ #ifdef APP_CAN_ENABLE // VCU相关 uint8 vehicleStatus = 0; uint8 bmsHVOn = 0; uint8 currentGearPosition = 0; uint8 parkingBreakStatus = 0; uint8 breakingStatus = 0; uint32 ODO = 0; uint8 dcdcWorkStatus = 0; uint8 numOfChrgableSubsys = 0; uint8 chrgableSubsysCode = 0; uint16 vcuDCVol = 0; // EBC相关 uint8 ebcStatus = 0; uint8 ebcAskHVOn = 0; uint8 ebcAskHVOff = 0; uint8 retainLockSignal = 0; uint8 dischargeLockSignal = 0; uint8 chargeLockSignal = 0; uint8 chargeFlag = 0; // Bcu相关 UINT32 BcuInTable[28] = { 0x1801D0F3, 0x1801D8F3, 0x1880D0F3, 0x1881D0F3, 0x1882D0F3, 0x1883D0F3, 0x1884D0F3, 0x1885D0F3, 0x1886D0F3, 0x1887D0F3, 0x1888D0F3, 0x1889D0F3, 0x188AD0F3, 0x18C1D0F3, 0x18C2D0F3, 0x18E1D0F3, 0x18E2D0F3, 0x18E3D0F3, 0x18E4D0F3, 0x18E5D0F3, 0x18E6D0F3, 0x18F1D0F3, 0x18F2D0F3, 0x18F3D0F3, 0x18F4D0F3, 0x18F5D0F3, 0x18FF45F4, 0x18FFC13A, }; BOOL BcuRxShortError[28]; BOOL BcuRxLongError[28]; UINT8 BcuRxErrorCounter[28]; UINT8 BcuRxFlag[28]; /************************************************************ *BCU->4G解码变量存放区 ************************************************************/ UINT8 BMS_CellRecvFlg = 0; //电压收取标志位 UINT8 canRecvFramNum[BMS_CELL_MAX_NUM/3] = {0}; UINT8 BMS_ReqVIN = 0x00; // 是否请求VIN码,0:预留;1:请求VIN;2:不请求VIN;3:无效;,Re-1,Off-0, UINT8 BMS_ReqHVOff = 0x00; // 是否请求下高压,0:预留;1:请求下高压;2:不请求下高压;3:无效;,Re-1,Off-0, UINT8 BMS_ProtocolEditionH = 0x00; // 通讯协议版本高位(例 : 版本为3 .1, 则此处发3), , Re - 1, Off - 0, UINT8 BMS_ProtocolEditionL = 0x00; // 通讯协议版本低位(例 : 版本为3 .1, 则此处发1), , Re - 1, Off - 0, UINT8 BMS_CharDevNum = 0x00; // 可充电装置系统序号(BMS是整车中可充电装置系统中的第几个, 需要整车告知),1,Re-1,Off-0, UINT8 BMS_FtPosRly = 0x00; // 主正继电器粘连故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtNegRly = 0x00; // 主负继电器粘连故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtPosCharRly1 = 0x00; // 充正1继电器粘连故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtNegCharRly1 = 0x00; // 充负1继电器粘连故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtPosCharRly2 = 0x00; // 充正2继电器粘连故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtNegCharRly2 = 0x00; // 充负2继电器粘连故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtHeatRly1 = 0x00; // 加热1/正继电器粘连故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtHeatRly2 = 0x00; // 加热2/负继电器粘连故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_StPosRly = 0x00; // 主正继电器状态(如继电器状态由BMS检测),0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0, UINT8 BMS_StNegRly = 0x00; // 主负继电器状态(如继电器状态由BMS检测),0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0, UINT8 BMS_StPreCharRly = 0x00; // 预充继电器状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0, UINT8 BMS_StPosCharRly1 = 0x00; // 直流充正继电器1状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0, UINT8 BMS_StNegCharRly1 = 0x00; // 直流充负继电器1状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0, UINT8 BMS_StPosCharRly2 = 0x00; // 直流充正继电器2状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0, UINT8 BMS_StNegCharRly2 = 0x00; // 直流充负继电器2状态,0:预留;1:开启;2:闭合;3:无效;,Re-1,Off-0, UINT8 BMS_FtAuxRelayWeld = 0x00; // 附件继电器粘连故障(保留),0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_BraOpenCirc = 0x00; // 支路断路故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtBackCharCurrOutLim = 0x00; // 回充电流超限报警,0:正常1 : 1级 轻微故障 2 : 2级 较严重故障 3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtPosRlyOpen = 0x00; // 主正继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtNegRlyOpen = 0x00; // 主负继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtPosCharRly1Open = 0x00; // 直流充电正1继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtPosCharRly2Open = 0x00; // 直流充电正2继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtNegCharRly1Open = 0x00; // 直流充电负1继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtNegCharRly2Open = 0x00; // 直流充电负2继电器无法闭合报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtTMSContClose = 0x00; // 加热膜或TMS接触器无法断开报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtTMSContOpen = 0x00; // 加热膜或TMS接触器无法闭合报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtTMS = 0x00; // 热管理系统故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_Ft24VSpy = 0x00; // BMS 24V供电异常报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtPACKSelfProt = 0x00; // 电池包自保护报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtCharSockTempOver = 0x00; // 充电插座过温报警,0:正常1 : 1级 轻微故障 2 : 2级 较严重故障 3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtTempOutCtrl = 0x00; // 热失控报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_StPosHeatRly = 0x00; // 加热正继电器状态,0:保留;1:开启;2:闭合;3:无效,Re-1,Off-0, UINT8 BMS_StNegHeatRly = 0x00; // 加热负继电器状态,0:保留;1:开启;2:闭合;3:无效,Re-1,Off-0, UINT8 BMS_CharSysNum = 0x00; // 可充电储能子系统总数(保留),,Re-1,Off-0, UINT8 BMS_FtCode = 0x00; // 电池系统故障码,详见附表电池系统故障码列表,Re-1,Off-0, 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, UINT8 BMS_ST1Counter = 0x00; // B2V_ST1的生命信号,0~14循环,15:信号无效,Re-1,Off-0, UINT8 BMS_Mode = 0x00; // BMS当前状态,0-未上高压,2-上高压 UINT8 BMS_AuxRlySt = 0x00; // 附件继电器状态,0:开启;1:闭合;,Re-1,Off-0, UINT8 BMS_BattBalaSt = 0x00; // BMS当前均衡状态,0:未开启均衡;1:开启均衡;,Re-1,Off-0, UINT8 BMS_CharGunSt = 0x00; // 直流充电枪连接状态,0:未连接1 : 连接, Re - 1, Off - 0, UINT8 BMS_CharMode = 0x00; // BMS当前充电模式,0:预留1 : 直流充电 2 : 交流充电 3 : 其他充电, Re - 1, Off - 0, UINT8 BMS_CharSt = 0x00; // 充电状态,0:可以充电1 : 正在充电 2 : 充电结束 3 : 充电故障, Re - 1, Off - 0, UINT8 BMS_FtLvl = 0x00; // 当前最高故障等级,0:正常1 : 1级 轻微故障 2 : 2级 较严重故障 3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtCellTempDiff = 0x00; // 电芯温差异常报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtCellTempHigh = 0x00; // 电芯温度过高报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtPACKOverVolt = 0x00; // PACK过压报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtPACKUndeVolt = 0x00; // PACK欠压报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtSOCLow = 0x00; // SOC过低报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtCellOverVolt = 0x00; // 单体电压过高报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtCellUndeVolt = 0x00; // 单体电压欠压报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtIns = 0x00; // 绝缘报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtCellOverVoltDiff = 0x00; // 单体压差过大,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtCharCurrOver = 0x00; // 充电电流过大报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtDisCharCurrOver = 0x00; // 放电电流过大报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtCellTempLow = 0x00; // 电芯温度过低报警,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtBranVoltDifOver = 0x00; // 支路压差过大报警(存在并联支路的系统),0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtBMSHardWare = 0x00; // BMS硬件故障,0:无故障; 1:1级 轻微故障; 2:2级 较严重故障3 : 3级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtSOCHigh = 0x00; // SOC过高报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtSOCJump = 0x00; // SOC跳变报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtInCom = 0x00; // BMS内部通信故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtSysMism = 0x00; // BMS/可充电储能系统不匹配报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtHvIntLock = 0x00; // 高压互锁报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtSmoke = 0x00; // 火警探测器故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtFire = 0x00; // 电池包火灾报警,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtNum = 0x00; // BMS当前发生的故障总数目(包括GB32960中规定的故障数目),,Re-1,Off-0, UINT8 BMS_PackSOC = 0x00; // 电池包SOC,,Re-0.4,Off-0, UINT8 BMS_PackSOH = 0x00; // 电池包SOH,,Re-0.4,Off-0, UINT8 BMS_MaxCellTemp = 0x00; // 单体最高温度,,Re-1,Off--50,℃ UINT8 BMS_MinCellTemp = 0x00; // 单体最低温度,,Re-1,Off--50,℃ UINT8 BMS_AverCellTemp = 0x00; // 单体平均温度,,Re-1,Off--50,℃ UINT8 BMS_MaxCellTempCSC = 0x00; // 最高温度电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0, UINT8 BMS_MaxCellTempNum = 0x00; // 最高温度电芯所在子系统(CSC)内温度探针编号,范围(1~255),Re-1,Off-0, UINT8 BMS_MinCellTempCSC = 0x00; // 最低温度电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0, UINT8 BMS_MinCellTempNum = 0x00; // 最低温度电芯所在子系统(CSC)内温度探针编号,范围(1~255),Re-1,Off-0, UINT8 BMS_MaxCellVoltCSC = 0x00; // 最高电压电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0, UINT8 BMS_MaxCellVoltNum = 0x00; // 最高电压电芯所在子系统(CSC)内单体编号,范围(1~255),Re-1,Off-0, UINT8 BMS_MinCellVoltCSC = 0x00; // 最低电压电芯所在子系统(CSC)编号,范围(1~255),Re-1,Off-0, UINT8 BMS_MinCellVoltNum = 0x00; // 最低电压电芯所在子系统(CSC)内单体编号,范围(1~255),Re-1,Off-0, UINT8 BMS_InsDeteSt = 0x00; // BMS绝缘检测状态,0:停止检测;1:激活检测;,Re-1,Off-0, UINT8 BMS_FtCharInsLow = 0x00; // 充电绝缘阻值低,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtCurrSenr = 0x00; // 电流传感器故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtHeatingFilm = 0x00; // 加热膜加热回路故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtMainLoopPreChar = 0x00; // 主回路预充或预检故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtAuxLoopPreChar = 0x00; // 辅件回路预充或预检故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtACANLost = 0x00; // ACAN/整车CAN通讯故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtDCDC = 0x00; // BMS-DC-DC故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtSOCDif = 0x00; // SOC差异过大,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtCellOverDisChar = 0x00; // 电芯过放故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtCharOver = 0x00; // 车载储能装置过充报警,0:正常;1:1级 轻微故障;2:2级 较严重故障3 : 10级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtContDisCharCurrOverLoad = 0x00; // 持续回充过流故障,0:正常;1:1级 轻微故障;2:2级 较严重故障3 : 10级 最严重故障, Re - 1, Off - 0, UINT8 BMS_FtContCharCurrOverLoad = 0x00; // 持续放电过流故障,0:正常;1:1级 轻微故障;2:2级 较严重故障3 : 10级 最严重故障, Re - 1, Off - 0, UINT8 BMS_Gun1DCNegTemp = 0x00; // 充电口1负温感值,,Re-1,Off--40,℃ UINT8 BMS_Gun1DCPosTemp = 0x00; // 充电口1正温感值,,Re-1,Off--40,℃ UINT8 BMS_Gun2DCNegTemp = 0x00; // 充电口2负温感值,,Re-1,Off--40,℃ UINT8 BMS_Gun2DCPosTemp = 0x00; // 充电口2正温感值,,Re-1,Off--40,℃ UINT8 BMS_CurrHeatSt = 0x00; // 当前加热状态,0:未加热;1:加热中;2:预留;3:无效;,Re-1,Off-0, UINT8 BMS_CurrCoolSt = 0x00; // 当前冷却状态,0:未冷却;1:冷却中;2:预留;3:无效;,Re-1,Off-0, UINT8 BMS_FtCharCnct = 0x00; // 插枪连接信号异常,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtOverDisCharCurrDuringChar = 0x00; // 充电时放电电流过大,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtCharNTC = 0x00; // 充电插座NTC故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_FtELock = 0x00; // 电子锁故障,0:正常; 1:故障,Re-1,Off-0, UINT8 BMS_CellVoltFramNum = 0x00; // 单体电压帧序号,有效值1~255,Re-1,Off-0, UINT8 BMS_CellTempFramNum = 0x00; // 温度帧序号,有效值1~255,Re-1,Off-0, UINT8 BMS_CSC_Code = 0x00; // 子系统编号CSC,有效值1~255,Re-1,Off-0, UINT8 BMS_CellTemp[BMS_TEMP_MAX_NUM] = {0x00}; // 当前CSC下的第N个探针的温度,255 "Invalid" 0xFF 无效有效值 0 ~254, 单位 ℃, 范围(-50 ~204)℃, , Re - 1, Off-- 50,℃ UINT8 BMS_Checksum = 0x00; // 电池编码信息1的CheckSum,Byte0=Byte1 XOR Byte2 XOR Byte3 XOR Byte4 XOR Byte5 XOR Byte6 XOR Byte7,Re-1,Off-0, UINT8 BMS_PackComp = 0x00; // 电池厂家,1:"CATL" 2:"Li Shen" 3:"MGL" 4:"SAMSUN" 5:"LG",Re-1,Off-0, UINT8 BMS_BattCodeLeng = 0x00; // 电池编码长度,0:Do not transmit this Code,Re-1,Off-0, UINT8 BMS_SN[27] = {0}; // 电池编码(SN)字符1(ASCII),,Re-1,Off-0, UINT8 BMS_BattType = 0x00; // 电池类型,1:铅酸电池; 2:镍氢电池; 3:磷酸铁锂电池; 4:锰酸锂电池; 5:钴酸锂电池; 6:三元材料电池; 7:聚合物锂离子电池; 8:钛酸锂电池; 9:超级电容; 10~13:保留; 14:燃料电池;15:保留,Re-1,Off-0, UINT8 BMS_CoolType = 0x00; // 电池冷却方式,0:其他冷却方式1 : 自然冷却 2 : 风扇冷却 3 : 水冷却, Re - 1, Off - 0, UINT8 BMS_CSC_Total = 0x00; // 电池系统中CSC总的数目,,Re-1,Off-0, UINT8 BMS_CellVoltLevel = 0x00; // 单体平台电压(非实时变化的值),有效值0~5V; 255 "Signal Invalid" 0xFF 无效,Re-0.1,Off-0,V UINT8 BMS_CellMinVolt = 0x00; // 单体可用最低电压(非实时变化的值),有效值0~5V; 255 "Signal Invalid" 0xFF 无效,Re-0.1,Off-0,V UINT8 BMS_CellMaxVolt = 0x00; // 单体可用最高电压(非实时变化的值),有效值0~5V; 255 "Signal Invalid" 0xFF 无效,Re-0.1,Off-0,V UINT8 BMS_HVBranNum = 0x00; // 电池系统高压支路数,,Re-1,Off-0, UINT8 BMS_SingleHVBranchCellNum = 0x00; // 电池系统单支路电芯数,,Re-1,Off-0, UINT8 BMS_ReqMode = 0x00; // BMS请求设定模式,0:关机模式1 : 制冷模式 2 : 制热模式 3 : 自循环模式, Re - 1, Off - 0, UINT8 BMS_HVCmd = 0x00; // 高压请求,0:请求上高压1 : 请求下高压, Re - 1, Off - 0, UINT8 BMS_ChgSts = 0x00; // 充电状态,0:非充电1 : 充电, Re - 1, Off - 0, UINT8 BMS_HVRelaySts = 0x00; // BMS高压继电器状态,0:断开状态; 1:闭合状态; 2~3:无效,Re-1,Off-0, UINT8 BMS_SetTemp = 0x00; // 设定温度,,Re-1,Off--40, UINT8 BMS_Life = 0x00; // BMS生命帧,,Re-1,Off-0, UINT8 BMS_CRC = 0x00; // CRC校验值,,Re-1,Off-0, UINT8 TMS_WorkStatus = 0x00; // TMS工作状态,0:关机模式1 : 制冷模式 2 : 制热模式 3 : 自循环模式, Re - 1, Off - 0, UINT8 TMS_HVRelayST = 0x00; // TMS高压继电器状态,0:断开状态; 1:闭合状态; 2~3:无效,Re-1,Off-0, UINT8 TMS_OutletTemp = 0x00; // 出水温度(机组到电池),255:无效,Re-1,Off--40, UINT8 TMS_InletTemp = 0x00; // 回水温度(电池到机组),255:无效,Re-1,Off--40, UINT8 TMS_ErrCode = 0x00; // TMS故障码,0:无故障; 出现 1 种以上循环发送,Re-1,Off-0, UINT8 TMS_FaultLevel = 0x00; // TMS故障码等级,0:无效1 : 1级故障 2 : 2级故障 3 : 3级故障, Re - 1, Off - 0, UINT16 BMS_SoftwareVersion = 0x00; // 软件版本号:RyyyBzzz(R为软件版本、B为测试版本、正式版本不带B) ,yyy:0~254,精度1,255:无效,不显示;zzz:0~254,精度1,255:无效,不显示; UINT16 BMS_HardwareVersion = 0x00; // 硬件版本号:VyyyBzzz(V为硬件版本、B为测试版本、正式版本不带B) ,,Re-1,Off-0, UINT16 BMS_PackCurr = 0x00; // 电池包总电流,充电为负值,放电为正值,,Re-0.1,Off--1000,A UINT16 BMS_MaxCharCurr = 0x00; // 电池包最大回充电流,,Re-0.1,Off--1000,A UINT16 BMS_MaxDisCharCurr = 0x00; // 电池包最大放电电流,,Re-0.1,Off--1000,A UINT16 BMS_PosIns = 0x00; // 母线正对车体绝缘电阻,,Re-1,Off-0,KΩ UINT16 BMS_NegIns = 0x00; // 母线负对车体绝缘电阻,,Re-1,Off-0,KΩ UINT16 BMS_BattVolt = 0x00; // 电池包内侧电压,,Re-0.1,Off-0,V UINT16 BMS_LinkVolt = 0x00; // 电池包外侧电压,,Re-0.1,Off-0,V UINT16 BMS_MaxCellVolt = 0x00; // 单体最高电压值,,Re-0.001,Off-0,V UINT16 BMS_AverCellVolt = 0x00; // 电芯电压平均值,,Re-0.001,Off-0,V UINT16 BMS_MinCellVolt = 0x00; // 电芯最低电压值,,Re-0.001,Off-0,V UINT16 BMS_ContChrgCurr = 0x00; // BMS允许的持续回充电流,,Re-0.1,Off-0,A UINT16 BMS_ContDisCharCurr = 0x00; // BMS允许的持续放电电流,,Re-0.1,Off--1000,A UINT16 BMS_CharReqVolt = 0x00; // 充电所需电压(交流),,Re-0.1,Off-0,V UINT16 BMS_CharReqCurr = 0x00; // 充电所需电流(交流),,Re-0.1,Off--1000,A UINT16 BMS_SysInsRes = 0x00; // 系统绝缘电阻,,Re-1,Off-0,KΩ UINT16 BMS_MaxDisCharPwr = 0x00; // 最大允许放电功率,,Re-0.1,Off-0,kw UINT16 BMS_MaxCharPwr = 0x00; // 最大允许充电功率,,Re-0.1,Off-0,kw UINT16 BMS_ContDisCharPwr = 0x00; // BMS允许的持续放电功率,,Re-0.1,Off-0,kw UINT16 BMS_ContCharPwr = 0x00; // BMS允许的持续充电功率,,Re-0.1,Off-0,kw UINT16 BMS_InstEngyCons = 0x00; // 动力电池瞬时百公里能耗,,Re-0.1,Off-0,kwh UINT16 BMS_TotalEngyCons = 0x00; // 动力电池总/平均百公里能耗,,Re-0.1,Off-0,kwh UINT16 BMS_SOE = 0x00; // 剩余电量,,Re-0.01,Off-0,kwh UINT16 BMS_RmanCharTime = 0x00; // 剩余充电时间,,Re-1,Off-0,min UINT16 BMS_CharNum = 0x00; // 充电次数,,Re-1,Off-0, UINT16 BMS_CellVolt[BMS_CELL_MAX_NUM] = {0x00}; // 电芯的电压,65535 "Invalid" 0xFFFF 无效有效值 0 ~65534, 范围(0 ~65.534) V, Re - 0.001, Off - 0, V UINT16 BMS_BattRateCap = 0x00; // 电池包额定容量,有效值 0~65534,65535 "Signal Invalid" 无效,Re-1,Off-0,Ah UINT16 BMS_BattRateVolt = 0x00; // 电池包额定电压,有效值 0~6553.4,65535 "Signal Invalid" 无效,Re-0.1,Off-0,V UINT16 BMS_BattRateEngy = 0x00; // 电池包额定能量,有效值 0~6553.4,65535 "Signal Invalid" 无效,Re-0.1,Off-0,kWh UINT16 BMS_CellTotal = BMS_CELL_MAX_NUM; // PACK中单体电芯的总数目,,Re-1,Off-0,// UINT16 BMS_TempTotal = BMS_TEMP_MAX_NUM; // PACK中电芯温度点(探针)的总数目,,Re-1,Off-0, UINT16 BMS_SingleCharEngy = 0x00; // 单次充电kWh 数,,Re-0.1,Off-0,KWh UINT16 BMS_SingleCharCapy = 0x00; // 单次充电Ah 数,,Re-0.1,Off-0,Ah UINT16 BMS_HVVolt = 0x00; // BMS当前电压,,Re-1,Off-0, UINT16 TMS_ReqPow = 0x00; // TMS需求功率,65535:无效,Re-0.1,Off-0,Kw UINT32 BMS_TotalCharEngy = 0x00; // 累计充入kWh 数,,Re-0.1,Off-0,KWh UINT32 BMS_TotalDisCharEngy = 0x00; // 累计放出kWh 数,,Re-0.1,Off-0,KWh UINT32 BMS_TotalBackCharEngy = 0x00; // 累计动能回馈充入kWh 数,,Re-0.1,Off-0,KWh UINT32 BMS_TotalStaCharEngy = 0x00; // 累计换电站充入kWh 数,,Re-0.1,Off-0,KWh UINT32 BMS_TotalGunCharEngy = 0x00; // 累计插枪充电充入kWh 数,,Re-0.1,Off-0,KWh UINT32 BMS_TotalGunCharCapy = 0x00; // 累计插枪充电充入Ah 数,,Re-0.1,Off-0,Ah UINT32 BMS_TotalCharCapy = 0x00; // 累计充入Ah 数,,Re-0.1,Off-0,Ah UINT32 BMS_TotalDisCharCapy = 0x00; // 累计放出Ah 数,,Re-0.1,Off-0,Ah UINT32 BMS_TotalBackCharCapy = 0x00; // 累计动能回馈充入Ah 数,,Re-0.1,Off-0,Ah UINT32 BMS_TotalStaCharCapy = 0x00; // 累计换电站充入Ah 数,,Re-0.1,Off-0,Ah /************************************************************ *BBox计算变量定义区 ************************************************************/ UINT8 BBox_PackSOC = 0x00; //BBox计算SOC,Re-0.4,Off-0; UINT8 BBox_PackSOH = 0x00; //BBox计算SOH,Re-1,Off-0; UINT32 BBox_TotalDischarCapy = 0x00; //BBox计算累计放电Ah,Re-0.1,Off-0,Ah UINT32 BBox_TotalCharCapy = 0x00; //BBox计算累计充电Ah,Re-0.1,Off-0,Ah UINT32 BBox_TotalBackCharCapy = 0x00; //BBox计算累计动能回收Ah,Re-0.1,Off-0,Ah UINT32 BBox_TotalDischarEngy = 0x00; //BBox计算累计放电能量,Re-0.1,Off-0,Kwh UINT32 BBox_TotalCharEngy = 0x00; //BBox计算累计充电能量,Re-0.1,Off-0,Kwh UINT32 BBox_TotalBackCharEngy = 0x00; //BBox计算累计动能回收能量,Re-0.1,Off-0,Kwh UINT32 BBox_Dq_Dv_MAX = 0x00; //BBox计算dq/dv_MAX,Re-0.001,Off-0,Ah/10mV UINT32 BBox_Dq_Dv_MIN = 0x00; //BBox计算dq/dv_MIN,Re-0.001,Off-0,Ah/10mV #endif