From 1291337e2cd774de9958e9844e8cf62aa0b63db8 Mon Sep 17 00:00:00 2001 From: FerroO2000 Date: Fri, 3 May 2024 11:37:43 +0200 Subject: [PATCH] dm1 backbone --- examples/dm1/MCB.dbc | 263 ++++++++++++++++++++++++++++++++++ examples/dm1/MCB_DM1.dbc | 298 +++++++++++++++++++++++++++++++++++++++ examples/dm1/main.go | 98 ++----------- examples/sc24/main.go | 270 ----------------------------------- plugins/dm1/dm1.go | 133 +++++++++++++++++ 5 files changed, 708 insertions(+), 354 deletions(-) create mode 100644 examples/dm1/MCB.dbc create mode 100644 examples/dm1/MCB_DM1.dbc delete mode 100644 examples/sc24/main.go create mode 100644 plugins/dm1/dm1.go diff --git a/examples/dm1/MCB.dbc b/examples/dm1/MCB.dbc new file mode 100644 index 0000000..60a9ca7 --- /dev/null +++ b/examples/dm1/MCB.dbc @@ -0,0 +1,263 @@ +VERSION "0.1" + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_ : + +BU_ : bms_lv dash dspace sens_front sens_rear tlb_bat + +BO_ 5 Sens_Front_1: 8 sens_front + SG_ Throttle_0_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ Throttle_1_Voltage_mV : 16|16@1+ (1,0) [0|65535] "" dspace + SG_ Steering_Voltage_mV : 32|16@1+ (1,0) [0|65535] "" dspace + SG_ Brake_Straingauge_Voltage_mV : 48|16@1+ (1,0) [0|65535] "" dspace + +BO_ 16 Sens_Front_2: 6 sens_front + SG_ Pot_FL_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ Pot_FR_Voltage_mV : 16|16@1+ (1,0) [0|65535] "" dspace + SG_ BrakePressure_Voltage_mV : 32|16@1+ (1,0) [0|65535] "" dspace + +BO_ 17 Sens_Rear_1: 6 sens_rear + SG_ Pot_RL_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ Pot_RR_Voltage_RR : 16|16@1+ (1,0) [0|65535] "" dspace + SG_ BrakePressure_Rear_Voltage_mV : 32|16@1+ (1,0) [0|65535] "" dspace + +BO_ 18 TLB_Battery_ShutStatus: 3 tlb_bat + SG_ isShutClosed_preAMS_IMD_Latch : 0|1@1+ (1,0) [0|1] "" dspace + SG_ isShutClosed_postAMSLatch : 1|1@1+ (1,0) [0|1] "" dspace + SG_ isShutClosed_postIMDLatch : 2|1@1+ (1,0) [0|1] "" dspace + SG_ isShutdownClosed_preTLBBattFinal : 3|1@1+ (1,0) [0|1] "" dspace + SG_ isAMSErrorLatched : 4|1@1+ (1,0) [0|1] "" dspace + SG_ isIMDErrorLatched : 5|1@1+ (1,0) [0|1] "" dspace + SG_ isSdPrchRlyClosed : 6|1@1+ (1,0) [0|1] "" dspace + SG_ ShutdownADC_postSDPrechargeRelay : 8|8@1+ (0.117,0) [0|255] "V" dspace + SG_ ShutdownADC_AIRsOpeningDelayCaps : 16|8@1+ (0.117,0) [0|255] "V" dspace + +BO_ 19 TLB_Battery_TSALStatus: 3 tlb_bat + SG_ TSAL_isGreenON : 0|1@1+ (1,0) [0|1] "" dspace + SG_ TSAL_isAIRPosClosed : 1|1@1+ (1,0) [0|1] "" dspace + SG_ TSAL_IsAIRNegClosed : 2|1@1+ (1,0) [0|1] "" dspace + SG_ TSAL_IsRelayPrechargeClosed : 3|1@1+ (1,0) [0|1] "" dspace + SG_ TSAL_isDCBusOver60V : 4|1@1+ (1,0) [0|1] "" dspace + SG_ IntentionalState_AIRPos : 5|1@1+ (1,0) [0|1] "" dspace + SG_ IntentionalState_AIRNeg : 6|1@1+ (1,0) [0|1] "" dspace + SG_ IntentionalState_RelayPrecharge : 7|1@1+ (1,0) [0|1] "" dspace + SG_ SCS_Short2GND_AirPos : 8|1@1+ (1,0) [0|1] "" dspace + SG_ SCS_Short2GND_AirNeg : 9|1@1+ (1,0) [0|1] "" dspace + SG_ SCS_isAnyShort2GND_Present : 10|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isAnyImp_Present : 11|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isAIRPosImp_Present : 12|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isAIRNegImp_Present : 13|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isRelayPrechargeImp_Present : 14|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isDCBusVoltageImp_Present : 15|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isAnyImp_Latched : 16|1@1+ (1,0) [0|1] "" dspace + +BO_ 20 BMSLV_Helo: 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 21 Sens_Front_Helo: 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 22 Sens_Rear_Helo: 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 23 Steering_Helo: 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 24 TLB_Battery_Helo: 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 25 dSpaxe_Helo: 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 37 dSpace_RTD_ACK: 1 dspace + SG_ RTD_FSM_STATE : 0|8@1- (1,0) [-1|6] "" dash + +BO_ 38 Steering_RTD: 1 dash + SG_ RTD_CMD : 0|8@1+ (1,0) [0|255] "" dspace + +BO_ 48 Sens_Rear_ShutdownStatus: 1 sens_rear + SG_ isShutClosed_postBSPD : 0|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_preFunghi : 1|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_postInvMono : 2|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_postInvFR : 3|1@1- (1,0) [0|1] "" dspace + SG_ isBSPDinError : 4|1@1- (1,0) [0|1] "" dspace + +BO_ 49 Sens_Front_ShutdownStatus: 1 sens_front + SG_ isShutClosed_preInertia : 0|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_postInertia : 1|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_postBOTS : 2|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_postCockpit : 3|1@1- (1,0) [0|1] "" dspace + +BO_ 255 BMSLV_RelayOverride: 2 dspace + SG_ password : 0|15@1+ (1,0) [0|65535] "" bms_lv + SG_ close_relay : 15|1@1+ (1,0) [0|1] "" bms_lv + +BO_ 256 BMSLV_CellVoltage1: 8 bms_lv + SG_ Cell_1_Voltage_mV : 0|16@1+ (0.038,2000) [0|2490.33] "" dspace + SG_ Cell_2_Voltage_mV : 16|16@1+ (0.038,2000) [0|2490.33] "" dspace + SG_ Cell_3_Voltage_mV : 32|16@1+ (0.038,2000) [0|2490.33] "" dspace + SG_ Cell_4_Voltage_mV : 48|16@1+ (0.038,2000) [0|2490.33] "" dspace + +BO_ 257 BMSLV_CellVoltage2: 6 bms_lv + SG_ Cell_5_Voltage_mV : 0|16@1+ (0.038,2000) [0|2490.33] "" dspace + SG_ Cell_6_Voltage_mV : 16|16@1+ (0.038,2000) [0|2490.33] "" dspace + SG_ Cell_7_Voltage_mV : 32|16@1+ (0.038,2000) [0|2490.33] "" dspace + +BO_ 258 BMSLV_BatteryPackGeneral: 6 bms_lv + SG_ Current_Sensor_mV : 0|16@1+ (0.076,0) [0|4980.66] "" dspace + SG_ LV_Total_Voltage_mV : 16|16@1+ (0.267,14000) [0|17497.845] "" dspace + SG_ LV_Total_Voltage_Sum_mV : 32|16@1+ (0.267,14000) [0|17497.845] "" dspace + +BO_ 259 BMSLV_Status: 4 bms_lv + SG_ isRelayOpen : 0|1@1+ (1,0) [0|1] "" dspace + SG_ cell1_OV : 1|1@1+ (1,0) [0|1] "" dspace + SG_ cell2_OV : 2|1@1+ (1,0) [0|1] "" dspace + SG_ cell3_OV : 3|1@1+ (1,0) [0|1] "" dspace + SG_ cell4_OV : 4|1@1+ (1,0) [0|1] "" dspace + SG_ cell5_OV : 5|1@1+ (1,0) [0|1] "" dspace + SG_ cell6_OV : 6|1@1+ (1,0) [0|1] "" dspace + SG_ cell7_OV : 7|1@1+ (1,0) [0|1] "" dspace + SG_ cell1_UV : 8|1@1+ (1,0) [0|1] "" dspace + SG_ cell2_UV : 9|1@1+ (1,0) [0|1] "" dspace + SG_ cell3_UV : 10|1@1+ (1,0) [0|1] "" dspace + SG_ cell4_UV : 11|1@1+ (1,0) [0|1] "" dspace + SG_ cell5_UV : 12|1@1+ (1,0) [0|1] "" dspace + SG_ cell6_UV : 13|1@1+ (1,0) [0|1] "" dspace + SG_ cell7_UV : 14|1@1+ (1,0) [0|1] "" dspace + SG_ temp1_OT : 15|1@1+ (1,0) [0|1] "" dspace + SG_ temp2_OT : 16|1@1+ (1,0) [0|1] "" dspace + SG_ temp3_OT : 17|1@1+ (1,0) [0|1] "" dspace + SG_ temp4_OT : 18|1@1+ (1,0) [0|1] "" dspace + SG_ temp5_OT : 19|1@1+ (1,0) [0|1] "" dspace + SG_ temp6_OT : 20|1@1+ (1,0) [0|1] "" dspace + SG_ temp7_OT : 21|1@1+ (1,0) [0|1] "" dspace + SG_ temp8_OT : 22|1@1+ (1,0) [0|1] "" dspace + SG_ temp9_OT : 23|1@1+ (1,0) [0|1] "" dspace + SG_ temp10_OT : 24|1@1+ (1,0) [0|1] "" dspace + SG_ temp11_OT : 25|1@1+ (1,0) [0|1] "" dspace + SG_ temp12_OT : 26|1@1+ (1,0) [0|1] "" dspace + +BO_ 260 BMSLV_Temp1: 8 bms_lv + SG_ NTC1_Resistance : 1|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC2_Resistance : 11|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC3_Resistance : 21|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC4_Resistance : 31|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC5_Resistance : 41|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC6_Resistance : 54|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + +BO_ 261 BMSLV_Temp2: 8 bms_lv + SG_ NTC1_Resistance : 1|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC2_Resistance : 11|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC3_Resistance : 21|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC4_Resistance : 31|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC5_Resistance : 41|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC6_Resistance : 54|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + +BO_ 288 Sens_Front_3: 8 sens_front + SG_ Straingauge_PushFR_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_TieFR_Voltage_mV : 16|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_PushFL_Voltage_mV : 32|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_TieFL_Voltage_mV : 48|16@1+ (1,0) [0|65535] "" dspace + +BO_ 289 Sens_Rear_3: 8 sens_rear + SG_ Straingauge_PushRR_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_TieRR_Voltage_mV : 16|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_PushRL_Voltage_mV : 32|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_TieRL_Voltage_mV : 48|16@1+ (1,0) [0|65535] "" dspace + +BO_ 512 dSpace_PeripheralsCTRL: 3 dspace + SG_ BrakeLightON_CTRL : 0|1@1- (1,0) [0|1] "" dash + SG_ RadFAN_PWM_CTRL : 8|8@1+ (1,0) [0|255] "" dash + SG_ BattHVFan_CTRL : 16|8@1+ (1,0) [0|255] "" dash + +BO_ 1024 Sens_Front_NTC: 8 sens_front + SG_ NTC_1_Resistance : 0|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_2_Resistance : 10|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_3_Resistance : 20|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_4_Resistance : 30|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_Spare1_Resistance : 40|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_Spare2_Resistance : 50|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + +BO_ 1025 Sens_Rear_NTC: 8 sens_rear + SG_ NTC_1_Resistance : 0|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_2_Resistance : 10|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_3_Resistance : 20|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_4_Resistance : 30|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_5_Resistance : 40|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_6_Resistance : 50|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + +BO_ 1026 Sens_Rear_2: 4 sens_rear + SG_ CoolingPressure_DX_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ CoolingPressure_SX_Voltage_mV : 16|16@1+ (1,0) [0|65535] "" dspace + +BO_ 1280 Steering_MotorControl_Debug: 1 dash + SG_ FrontLeft_ON : 0|1@1- (1,0) [0|1] "" dspace + SG_ FrontRight_ON : 1|1@1- (1,0) [0|1] "" dspace + SG_ RearLeft_ON : 2|1@1- (1,0) [0|1] "" dspace + SG_ RearRight_ON : 3|1@1- (1,0) [0|1] "" dspace + +CM_ BU_ bms_lv "battery-management-system low-voltage"; +CM_ BU_ dash "dashboard ECU"; +CM_ BU_ dspace "automotive ECU"; +CM_ BU_ sens_front "sensorboard front ECU"; +CM_ BU_ sens_rear "sensorboard rear ECU"; +CM_ BU_ tlb_bat "tsal-latch-board battery ECU"; +CM_ BO_ 260 "(period: 2000 ms)"; +CM_ BO_ 256 "(period: 100 ms)"; +CM_ BO_ 22 "(period: 10 ms)"; +CM_ BO_ 1026 "(period: 10 ms)"; +CM_ BO_ 1025 "(period: 10 ms)"; +CM_ BO_ 261 "(period: 2000 ms)"; +CM_ BO_ 5 "(period: 10 ms)"; +CM_ BO_ 258 "(period: 100 ms)"; +CM_ BO_ 16 "(period: 10 ms)"; +CM_ BO_ 18 "(period: 100 ms)"; +CM_ BO_ 19 "(period: 100 ms)"; +CM_ BO_ 288 "(period: 10 ms)"; +CM_ BO_ 17 "(period: 10 ms)"; +CM_ BO_ 49 "(period: 10 ms)"; +CM_ BO_ 48 "(period: 10 ms)"; +CM_ BO_ 259 "(period: 100 ms)"; +CM_ BO_ 289 "(period: 10 ms)"; +CM_ BO_ 257 "(period: 100 ms)"; +CM_ BO_ 1024 "(period: 10 ms)"; +CM_ BO_ 38 "(period: 500 ms)"; + +BA_DEF_ BO_ "GenMsgSendType" ENUM "NoMsgSendType","Cyclic","IfActive","cyclicIfActive","NotUsed"; +BA_DEF_ BO_ "GenMsgCycleTime" INT 0 1000; +BA_DEF_ SG_ "GenSigStartValue" FLOAT 0 100000000000; +BA_DEF_ SG_ "GenSigSendType" ENUM "NoSigSendType","Cyclic","OnWrite","OnWriteWithRepetition","OnChange","OnChangeWithRepetition","IfActive","IfActiveWithRepetition","NotUsed"; +BA_DEF_DEF_ "GenMsgCycleTime" 0; +BA_DEF_DEF_ "GenMsgSendType" "NoMsgSendType"; +BA_DEF_DEF_ "GenSigStartValue" 0; +BA_DEF_DEF_ "GenSigSendType" "NoSigSendType"; + diff --git a/examples/dm1/MCB_DM1.dbc b/examples/dm1/MCB_DM1.dbc new file mode 100644 index 0000000..5272913 --- /dev/null +++ b/examples/dm1/MCB_DM1.dbc @@ -0,0 +1,298 @@ +VERSION "_" + +NS_: + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + VAL_TABLE_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SIG_GROUP_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: bms_lv dash dspace sens_front sens_rear tlb_bat + +BO_ 20 BMSLV_Helo : 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 21 Sens_Front_Helo : 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 22 Sens_Rear_Helo : 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 23 Steering_Helo : 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 24 TLB_Battery_Helo : 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 25 dSpaxe_Helo : 8 bms_lv + SG_ time : 0|64@1+ (1,0) [0|18446744073709552000] "" dspace + +BO_ 208 dm1_bms_lv : 8 bms_lv + SG_ sin : 0|8@1+ (1,0) [0|117] "" Vector__XXX + SG_ fmi : 8|5@1+ (1,0) [0|31] "" Vector__XXX + SG_ occ_counter : 16|8@1+ (1,0) [0|255] "" Vector__XXX + +BO_ 256 BMSLV_CellVoltage1 : 8 bms_lv + SG_ Cell_1_Voltage_mV : 0|16@1+ (0.038,2000) [0|2490.33] "" dspace + SG_ Cell_2_Voltage_mV : 16|16@1+ (0.038,2000) [0|2490.33] "" dspace + SG_ Cell_3_Voltage_mV : 32|16@1+ (0.038,2000) [0|2490.33] "" dspace + SG_ Cell_4_Voltage_mV : 48|16@1+ (0.038,2000) [0|2490.33] "" dspace + +BO_ 257 BMSLV_CellVoltage2 : 6 bms_lv + SG_ Cell_5_Voltage_mV : 0|16@1+ (0.038,2000) [0|2490.33] "" dspace + SG_ Cell_6_Voltage_mV : 16|16@1+ (0.038,2000) [0|2490.33] "" dspace + SG_ Cell_7_Voltage_mV : 32|16@1+ (0.038,2000) [0|2490.33] "" dspace + +BO_ 258 BMSLV_BatteryPackGeneral : 6 bms_lv + SG_ Current_Sensor_mV : 0|16@1+ (0.076,0) [0|4980.66] "" dspace + SG_ LV_Total_Voltage_mV : 16|16@1+ (0.267,14000) [0|17497.845] "" dspace + SG_ LV_Total_Voltage_Sum_mV : 32|16@1+ (0.267,14000) [0|17497.845] "" dspace + +BO_ 259 BMSLV_Status : 4 bms_lv + SG_ isRelayOpen : 0|1@1+ (1,0) [0|1] "" dspace + SG_ cell1_OV : 1|1@1+ (1,0) [0|1] "" dspace + SG_ cell2_OV : 2|1@1+ (1,0) [0|1] "" dspace + SG_ cell3_OV : 3|1@1+ (1,0) [0|1] "" dspace + SG_ cell4_OV : 4|1@1+ (1,0) [0|1] "" dspace + SG_ cell5_OV : 5|1@1+ (1,0) [0|1] "" dspace + SG_ cell6_OV : 6|1@1+ (1,0) [0|1] "" dspace + SG_ cell7_OV : 7|1@1+ (1,0) [0|1] "" dspace + SG_ cell1_UV : 8|1@1+ (1,0) [0|1] "" dspace + SG_ cell2_UV : 9|1@1+ (1,0) [0|1] "" dspace + SG_ cell3_UV : 10|1@1+ (1,0) [0|1] "" dspace + SG_ cell4_UV : 11|1@1+ (1,0) [0|1] "" dspace + SG_ cell5_UV : 12|1@1+ (1,0) [0|1] "" dspace + SG_ cell6_UV : 13|1@1+ (1,0) [0|1] "" dspace + SG_ cell7_UV : 14|1@1+ (1,0) [0|1] "" dspace + SG_ temp1_OT : 15|1@1+ (1,0) [0|1] "" dspace + SG_ temp2_OT : 16|1@1+ (1,0) [0|1] "" dspace + SG_ temp3_OT : 17|1@1+ (1,0) [0|1] "" dspace + SG_ temp4_OT : 18|1@1+ (1,0) [0|1] "" dspace + SG_ temp5_OT : 19|1@1+ (1,0) [0|1] "" dspace + SG_ temp6_OT : 20|1@1+ (1,0) [0|1] "" dspace + SG_ temp7_OT : 21|1@1+ (1,0) [0|1] "" dspace + SG_ temp8_OT : 22|1@1+ (1,0) [0|1] "" dspace + SG_ temp9_OT : 23|1@1+ (1,0) [0|1] "" dspace + SG_ temp10_OT : 24|1@1+ (1,0) [0|1] "" dspace + SG_ temp11_OT : 25|1@1+ (1,0) [0|1] "" dspace + SG_ temp12_OT : 26|1@1+ (1,0) [0|1] "" dspace + +BO_ 260 BMSLV_Temp1 : 8 bms_lv + SG_ NTC1_Resistance : 1|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC2_Resistance : 11|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC3_Resistance : 21|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC4_Resistance : 31|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC5_Resistance : 41|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC6_Resistance : 54|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + +BO_ 261 BMSLV_Temp2 : 8 bms_lv + SG_ NTC1_Resistance : 1|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC2_Resistance : 11|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC3_Resistance : 21|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC4_Resistance : 31|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC5_Resistance : 41|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC6_Resistance : 54|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + +BO_ 38 Steering_RTD : 1 dash + SG_ RTD_CMD : 0|8@1+ (1,0) [0|255] "" dspace + +BO_ 49 dm1_dash : 8 dash + SG_ sin : 0|8@1+ (1,0) [0|117] "" Vector__XXX + SG_ fmi : 8|5@1+ (1,0) [0|31] "" Vector__XXX + SG_ occ_counter : 16|8@1+ (1,0) [0|255] "" Vector__XXX + +BO_ 1280 Steering_MotorControl_Debug : 1 dash + SG_ FrontLeft_ON : 0|1@1- (1,0) [0|1] "" dspace + SG_ FrontRight_ON : 1|1@1- (1,0) [0|1] "" dspace + SG_ RearLeft_ON : 2|1@1- (1,0) [0|1] "" dspace + SG_ RearRight_ON : 3|1@1- (1,0) [0|1] "" dspace + +BO_ 37 dSpace_RTD_ACK : 1 dspace + SG_ RTD_FSM_STATE : 0|8@1- (1,0) [-1|6] "" dash + +BO_ 66 dm1_dspace : 8 dspace + SG_ sin : 0|8@1+ (1,0) [0|117] "" Vector__XXX + SG_ fmi : 8|5@1+ (1,0) [0|31] "" Vector__XXX + SG_ occ_counter : 16|8@1+ (1,0) [0|255] "" Vector__XXX + +BO_ 255 BMSLV_RelayOverride : 2 dspace + SG_ password : 0|15@1+ (1,0) [0|65535] "" bms_lv + SG_ close_relay : 15|1@1+ (1,0) [0|1] "" bms_lv + +BO_ 512 dSpace_PeripheralsCTRL : 3 dspace + SG_ BrakeLightON_CTRL : 0|1@1- (1,0) [0|1] "" dash + SG_ RadFAN_PWM_CTRL : 8|8@1+ (1,0) [0|255] "" dash + SG_ BattHVFan_CTRL : 16|8@1+ (1,0) [0|255] "" dash + +BO_ 5 Sens_Front_1 : 8 sens_front + SG_ Throttle_0_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ Throttle_1_Voltage_mV : 16|16@1+ (1,0) [0|65535] "" dspace + SG_ Steering_Voltage_mV : 32|16@1+ (1,0) [0|65535] "" dspace + SG_ Brake_Straingauge_Voltage_mV : 48|16@1+ (1,0) [0|65535] "" dspace + +BO_ 16 Sens_Front_2 : 6 sens_front + SG_ Pot_FL_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ Pot_FR_Voltage_mV : 16|16@1+ (1,0) [0|65535] "" dspace + SG_ BrakePressure_Voltage_mV : 32|16@1+ (1,0) [0|65535] "" dspace + +BO_ 49 Sens_Front_ShutdownStatus : 1 sens_front + SG_ isShutClosed_preInertia : 0|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_postInertia : 1|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_postBOTS : 2|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_postCockpit : 3|1@1- (1,0) [0|1] "" dspace + +BO_ 99 dm1_sens_front : 8 sens_front + SG_ sin : 0|8@1+ (1,0) [0|117] "" Vector__XXX + SG_ fmi : 8|5@1+ (1,0) [0|31] "" Vector__XXX + SG_ occ_counter : 16|8@1+ (1,0) [0|255] "" Vector__XXX + +BO_ 288 Sens_Front_3 : 8 sens_front + SG_ Straingauge_PushFR_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_TieFR_Voltage_mV : 16|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_PushFL_Voltage_mV : 32|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_TieFL_Voltage_mV : 48|16@1+ (1,0) [0|65535] "" dspace + +BO_ 1024 Sens_Front_NTC : 8 sens_front + SG_ NTC_1_Resistance : 0|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_2_Resistance : 10|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_3_Resistance : 20|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_4_Resistance : 30|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_Spare1_Resistance : 40|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_Spare2_Resistance : 50|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + +BO_ 17 Sens_Rear_1 : 6 sens_rear + SG_ Pot_RL_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ Pot_RR_Voltage_RR : 16|16@1+ (1,0) [0|65535] "" dspace + SG_ BrakePressure_Rear_Voltage_mV : 32|16@1+ (1,0) [0|65535] "" dspace + +BO_ 48 Sens_Rear_ShutdownStatus : 1 sens_rear + SG_ isShutClosed_postBSPD : 0|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_preFunghi : 1|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_postInvMono : 2|1@1- (1,0) [0|1] "" dspace + SG_ isShutClosed_postInvFR : 3|1@1- (1,0) [0|1] "" dspace + SG_ isBSPDinError : 4|1@1- (1,0) [0|1] "" dspace + +BO_ 100 dm1_sens_rear : 8 sens_rear + SG_ sin : 0|8@1+ (1,0) [0|117] "" Vector__XXX + SG_ fmi : 8|5@1+ (1,0) [0|31] "" Vector__XXX + SG_ occ_counter : 16|8@1+ (1,0) [0|255] "" Vector__XXX + +BO_ 289 Sens_Rear_3 : 8 sens_rear + SG_ Straingauge_PushRR_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_TieRR_Voltage_mV : 16|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_PushRL_Voltage_mV : 32|16@1+ (1,0) [0|65535] "" dspace + SG_ Straingauge_TieRL_Voltage_mV : 48|16@1+ (1,0) [0|65535] "" dspace + +BO_ 1025 Sens_Rear_NTC : 8 sens_rear + SG_ NTC_1_Resistance : 0|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_2_Resistance : 10|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_3_Resistance : 20|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_4_Resistance : 30|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_5_Resistance : 40|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + SG_ NTC_6_Resistance : 50|10@1+ (31.25,1000) [0|31968.75] "Ohm" dspace + +BO_ 1026 Sens_Rear_2 : 4 sens_rear + SG_ CoolingPressure_DX_Voltage_mV : 0|16@1+ (1,0) [0|65535] "" dspace + SG_ CoolingPressure_SX_Voltage_mV : 16|16@1+ (1,0) [0|65535] "" dspace + +BO_ 18 TLB_Battery_ShutStatus : 3 tlb_bat + SG_ isShutClosed_preAMS_IMD_Latch : 0|1@1+ (1,0) [0|1] "" dspace + SG_ isShutClosed_postAMSLatch : 1|1@1+ (1,0) [0|1] "" dspace + SG_ isShutClosed_postIMDLatch : 2|1@1+ (1,0) [0|1] "" dspace + SG_ isShutdownClosed_preTLBBattFinal : 3|1@1+ (1,0) [0|1] "" dspace + SG_ isAMSErrorLatched : 4|1@1+ (1,0) [0|1] "" dspace + SG_ isIMDErrorLatched : 5|1@1+ (1,0) [0|1] "" dspace + SG_ isSdPrchRlyClosed : 6|1@1+ (1,0) [0|1] "" dspace + SG_ ShutdownADC_postSDPrechargeRelay : 8|8@1+ (0.117,0) [0|255] "V" dspace + SG_ ShutdownADC_AIRsOpeningDelayCaps : 16|8@1+ (0.117,0) [0|255] "V" dspace + +BO_ 19 TLB_Battery_TSALStatus : 3 tlb_bat + SG_ TSAL_isGreenON : 0|1@1+ (1,0) [0|1] "" dspace + SG_ TSAL_isAIRPosClosed : 1|1@1+ (1,0) [0|1] "" dspace + SG_ TSAL_IsAIRNegClosed : 2|1@1+ (1,0) [0|1] "" dspace + SG_ TSAL_IsRelayPrechargeClosed : 3|1@1+ (1,0) [0|1] "" dspace + SG_ TSAL_isDCBusOver60V : 4|1@1+ (1,0) [0|1] "" dspace + SG_ IntentionalState_AIRPos : 5|1@1+ (1,0) [0|1] "" dspace + SG_ IntentionalState_AIRNeg : 6|1@1+ (1,0) [0|1] "" dspace + SG_ IntentionalState_RelayPrecharge : 7|1@1+ (1,0) [0|1] "" dspace + SG_ SCS_Short2GND_AirPos : 8|1@1+ (1,0) [0|1] "" dspace + SG_ SCS_Short2GND_AirNeg : 9|1@1+ (1,0) [0|1] "" dspace + SG_ SCS_isAnyShort2GND_Present : 10|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isAnyImp_Present : 11|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isAIRPosImp_Present : 12|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isAIRNegImp_Present : 13|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isRelayPrechargeImp_Present : 14|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isDCBusVoltageImp_Present : 15|1@1+ (1,0) [0|1] "" dspace + SG_ Imp_isAnyImp_Latched : 16|1@1+ (1,0) [0|1] "" dspace + +BO_ 53 dm1_tlb_bat : 8 tlb_bat + SG_ sin : 0|8@1+ (1,0) [0|117] "" Vector__XXX + SG_ fmi : 8|5@1+ (1,0) [0|31] "" Vector__XXX + SG_ occ_counter : 16|8@1+ (1,0) [0|255] "" Vector__XXX + + +CM_ BU_ bms_lv "battery-management-system low-voltage"; +CM_ BO_ 22 "(period: 10 ms)"; +CM_ BO_ 256 "(period: 100 ms)"; +CM_ BO_ 257 "(period: 100 ms)"; +CM_ BO_ 258 "(period: 100 ms)"; +CM_ BO_ 259 "(period: 100 ms)"; +CM_ BO_ 260 "(period: 2000 ms)"; +CM_ BO_ 261 "(period: 2000 ms)"; +CM_ BU_ dash "dashboard ECU"; +CM_ BO_ 38 "(period: 500 ms)"; +CM_ BU_ dspace "automotive ECU"; +CM_ BU_ sens_front "sensorboard front ECU"; +CM_ BO_ 5 "(period: 10 ms)"; +CM_ BO_ 16 "(period: 10 ms)"; +CM_ BO_ 49 "(period: 10 ms)"; +CM_ BO_ 288 "(period: 10 ms)"; +CM_ BO_ 1024 "(period: 10 ms)"; +CM_ BU_ sens_rear "sensorboard rear ECU"; +CM_ BO_ 17 "(period: 10 ms)"; +CM_ BO_ 48 "(period: 10 ms)"; +CM_ BO_ 289 "(period: 10 ms)"; +CM_ BO_ 1025 "(period: 10 ms)"; +CM_ BO_ 1026 "(period: 10 ms)"; +CM_ BU_ tlb_bat "tsal-latch-board battery ECU"; +CM_ BO_ 18 "(period: 100 ms)"; +CM_ BO_ 19 "(period: 100 ms)"; + +VAL_ 208 sin 0 "time" 1 "Cell_1_Voltage_mV" 2 "Cell_2_Voltage_mV" 3 "Cell_3_Voltage_mV" 4 "Cell_4_Voltage_mV" 5 "Cell_5_Voltage_mV" 6 "Cell_6_Voltage_mV" 7 "Cell_7_Voltage_mV" 8 "Current_Sensor_mV" 9 "LV_Total_Voltage_mV" 10 "LV_Total_Voltage_Sum_mV" 11 "isRelayOpen" 12 "cell1_OV" 13 "cell2_OV" 14 "cell3_OV" 15 "cell4_OV" 16 "cell5_OV" 17 "cell6_OV" 18 "cell7_OV" 19 "cell1_UV" 20 "cell2_UV" 21 "cell3_UV" 22 "cell4_UV" 23 "cell5_UV" 24 "cell6_UV" 25 "cell7_UV" 26 "temp1_OT" 27 "temp2_OT" 28 "temp3_OT" 29 "temp4_OT" 30 "temp5_OT" 31 "temp6_OT" 32 "temp7_OT" 33 "temp8_OT" 34 "temp9_OT" 35 "temp10_OT" 36 "temp11_OT" 37 "temp12_OT" 38 "NTC1_Resistance" 39 "NTC2_Resistance" 40 "NTC3_Resistance" 41 "NTC4_Resistance" 42 "NTC5_Resistance" 43 "NTC6_Resistance" 44 "RTD_CMD" 45 "FrontLeft_ON" 46 "FrontRight_ON" 47 "RearLeft_ON" 48 "RearRight_ON" 49 "RTD_FSM_STATE" 50 "password" 51 "close_relay" 52 "BrakeLightON_CTRL" 53 "RadFAN_PWM_CTRL" 54 "BattHVFan_CTRL" 55 "Throttle_0_Voltage_mV" 56 "Throttle_1_Voltage_mV" 57 "Steering_Voltage_mV" 58 "Brake_Straingauge_Voltage_mV" 59 "Pot_FL_Voltage_mV" 60 "Pot_FR_Voltage_mV" 61 "BrakePressure_Voltage_mV" 62 "isShutClosed_preInertia" 63 "isShutClosed_postInertia" 64 "isShutClosed_postBOTS" 65 "isShutClosed_postCockpit" 66 "Straingauge_PushFR_Voltage_mV" 67 "Straingauge_TieFR_Voltage_mV" 68 "Straingauge_PushFL_Voltage_mV" 69 "Straingauge_TieFL_Voltage_mV" 70 "NTC_1_Resistance" 71 "NTC_2_Resistance" 72 "NTC_3_Resistance" 73 "NTC_4_Resistance" 74 "NTC_Spare1_Resistance" 75 "NTC_Spare2_Resistance" 76 "Pot_RL_Voltage_mV" 77 "Pot_RR_Voltage_RR" 78 "BrakePressure_Rear_Voltage_mV" 79 "isShutClosed_postBSPD" 80 "isShutClosed_preFunghi" 81 "isShutClosed_postInvMono" 82 "isShutClosed_postInvFR" 83 "isBSPDinError" 84 "Straingauge_PushRR_Voltage_mV" 85 "Straingauge_TieRR_Voltage_mV" 86 "Straingauge_PushRL_Voltage_mV" 87 "Straingauge_TieRL_Voltage_mV" 88 "NTC_5_Resistance" 89 "NTC_6_Resistance" 90 "CoolingPressure_DX_Voltage_mV" 91 "CoolingPressure_SX_Voltage_mV" 92 "isShutClosed_preAMS_IMD_Latch" 93 "isShutClosed_postAMSLatch" 94 "isShutClosed_postIMDLatch" 95 "isShutdownClosed_preTLBBattFinal" 96 "isAMSErrorLatched" 97 "isIMDErrorLatched" 98 "isSdPrchRlyClosed" 99 "ShutdownADC_postSDPrechargeRelay" 100 "ShutdownADC_AIRsOpeningDelayCaps" 101 "TSAL_isGreenON" 102 "TSAL_isAIRPosClosed" 103 "TSAL_IsAIRNegClosed" 104 "TSAL_IsRelayPrechargeClosed" 105 "TSAL_isDCBusOver60V" 106 "IntentionalState_AIRPos" 107 "IntentionalState_AIRNeg" 108 "IntentionalState_RelayPrecharge" 109 "SCS_Short2GND_AirPos" 110 "SCS_Short2GND_AirNeg" 111 "SCS_isAnyShort2GND_Present" 112 "Imp_isAnyImp_Present" 113 "Imp_isAIRPosImp_Present" 114 "Imp_isAIRNegImp_Present" 115 "Imp_isRelayPrechargeImp_Present" 116 "Imp_isDCBusVoltageImp_Present" 117 "Imp_isAnyImp_Latched"; +VAL_ 208 fmi 0 "high_severity" 1 "low_severity" 2 "erratic" 3 "v_above_normal" 4 "v_below_normal" 5 "i_above_normal" 6 "i_below_normal" 7 "system_not_responding_properly" 8 "abnormal_frequency" 9 "abnormal_update_rate" 10 "abnormal_rate_of_change" 11 "other_failure_mode" 12 "failure" 13 "out_of_calibration" 14 "special_instruction" 15 "data_valid_above_normal_range0" 16 "data_valid_above_normal_range1" 17 "data_valid_below_normal_range0" 18 "data_valid_below_normal_range1" 19 "received_network_data_error" 20 "data_drifted_high" 21 "data_drifted_low" 31 "condition_exists"; +VAL_ 49 sin 0 "time" 1 "Cell_1_Voltage_mV" 2 "Cell_2_Voltage_mV" 3 "Cell_3_Voltage_mV" 4 "Cell_4_Voltage_mV" 5 "Cell_5_Voltage_mV" 6 "Cell_6_Voltage_mV" 7 "Cell_7_Voltage_mV" 8 "Current_Sensor_mV" 9 "LV_Total_Voltage_mV" 10 "LV_Total_Voltage_Sum_mV" 11 "isRelayOpen" 12 "cell1_OV" 13 "cell2_OV" 14 "cell3_OV" 15 "cell4_OV" 16 "cell5_OV" 17 "cell6_OV" 18 "cell7_OV" 19 "cell1_UV" 20 "cell2_UV" 21 "cell3_UV" 22 "cell4_UV" 23 "cell5_UV" 24 "cell6_UV" 25 "cell7_UV" 26 "temp1_OT" 27 "temp2_OT" 28 "temp3_OT" 29 "temp4_OT" 30 "temp5_OT" 31 "temp6_OT" 32 "temp7_OT" 33 "temp8_OT" 34 "temp9_OT" 35 "temp10_OT" 36 "temp11_OT" 37 "temp12_OT" 38 "NTC1_Resistance" 39 "NTC2_Resistance" 40 "NTC3_Resistance" 41 "NTC4_Resistance" 42 "NTC5_Resistance" 43 "NTC6_Resistance" 44 "RTD_CMD" 45 "FrontLeft_ON" 46 "FrontRight_ON" 47 "RearLeft_ON" 48 "RearRight_ON" 49 "RTD_FSM_STATE" 50 "password" 51 "close_relay" 52 "BrakeLightON_CTRL" 53 "RadFAN_PWM_CTRL" 54 "BattHVFan_CTRL" 55 "Throttle_0_Voltage_mV" 56 "Throttle_1_Voltage_mV" 57 "Steering_Voltage_mV" 58 "Brake_Straingauge_Voltage_mV" 59 "Pot_FL_Voltage_mV" 60 "Pot_FR_Voltage_mV" 61 "BrakePressure_Voltage_mV" 62 "isShutClosed_preInertia" 63 "isShutClosed_postInertia" 64 "isShutClosed_postBOTS" 65 "isShutClosed_postCockpit" 66 "Straingauge_PushFR_Voltage_mV" 67 "Straingauge_TieFR_Voltage_mV" 68 "Straingauge_PushFL_Voltage_mV" 69 "Straingauge_TieFL_Voltage_mV" 70 "NTC_1_Resistance" 71 "NTC_2_Resistance" 72 "NTC_3_Resistance" 73 "NTC_4_Resistance" 74 "NTC_Spare1_Resistance" 75 "NTC_Spare2_Resistance" 76 "Pot_RL_Voltage_mV" 77 "Pot_RR_Voltage_RR" 78 "BrakePressure_Rear_Voltage_mV" 79 "isShutClosed_postBSPD" 80 "isShutClosed_preFunghi" 81 "isShutClosed_postInvMono" 82 "isShutClosed_postInvFR" 83 "isBSPDinError" 84 "Straingauge_PushRR_Voltage_mV" 85 "Straingauge_TieRR_Voltage_mV" 86 "Straingauge_PushRL_Voltage_mV" 87 "Straingauge_TieRL_Voltage_mV" 88 "NTC_5_Resistance" 89 "NTC_6_Resistance" 90 "CoolingPressure_DX_Voltage_mV" 91 "CoolingPressure_SX_Voltage_mV" 92 "isShutClosed_preAMS_IMD_Latch" 93 "isShutClosed_postAMSLatch" 94 "isShutClosed_postIMDLatch" 95 "isShutdownClosed_preTLBBattFinal" 96 "isAMSErrorLatched" 97 "isIMDErrorLatched" 98 "isSdPrchRlyClosed" 99 "ShutdownADC_postSDPrechargeRelay" 100 "ShutdownADC_AIRsOpeningDelayCaps" 101 "TSAL_isGreenON" 102 "TSAL_isAIRPosClosed" 103 "TSAL_IsAIRNegClosed" 104 "TSAL_IsRelayPrechargeClosed" 105 "TSAL_isDCBusOver60V" 106 "IntentionalState_AIRPos" 107 "IntentionalState_AIRNeg" 108 "IntentionalState_RelayPrecharge" 109 "SCS_Short2GND_AirPos" 110 "SCS_Short2GND_AirNeg" 111 "SCS_isAnyShort2GND_Present" 112 "Imp_isAnyImp_Present" 113 "Imp_isAIRPosImp_Present" 114 "Imp_isAIRNegImp_Present" 115 "Imp_isRelayPrechargeImp_Present" 116 "Imp_isDCBusVoltageImp_Present" 117 "Imp_isAnyImp_Latched"; +VAL_ 49 fmi 0 "high_severity" 1 "low_severity" 2 "erratic" 3 "v_above_normal" 4 "v_below_normal" 5 "i_above_normal" 6 "i_below_normal" 7 "system_not_responding_properly" 8 "abnormal_frequency" 9 "abnormal_update_rate" 10 "abnormal_rate_of_change" 11 "other_failure_mode" 12 "failure" 13 "out_of_calibration" 14 "special_instruction" 15 "data_valid_above_normal_range0" 16 "data_valid_above_normal_range1" 17 "data_valid_below_normal_range0" 18 "data_valid_below_normal_range1" 19 "received_network_data_error" 20 "data_drifted_high" 21 "data_drifted_low" 31 "condition_exists"; +VAL_ 66 sin 0 "time" 1 "Cell_1_Voltage_mV" 2 "Cell_2_Voltage_mV" 3 "Cell_3_Voltage_mV" 4 "Cell_4_Voltage_mV" 5 "Cell_5_Voltage_mV" 6 "Cell_6_Voltage_mV" 7 "Cell_7_Voltage_mV" 8 "Current_Sensor_mV" 9 "LV_Total_Voltage_mV" 10 "LV_Total_Voltage_Sum_mV" 11 "isRelayOpen" 12 "cell1_OV" 13 "cell2_OV" 14 "cell3_OV" 15 "cell4_OV" 16 "cell5_OV" 17 "cell6_OV" 18 "cell7_OV" 19 "cell1_UV" 20 "cell2_UV" 21 "cell3_UV" 22 "cell4_UV" 23 "cell5_UV" 24 "cell6_UV" 25 "cell7_UV" 26 "temp1_OT" 27 "temp2_OT" 28 "temp3_OT" 29 "temp4_OT" 30 "temp5_OT" 31 "temp6_OT" 32 "temp7_OT" 33 "temp8_OT" 34 "temp9_OT" 35 "temp10_OT" 36 "temp11_OT" 37 "temp12_OT" 38 "NTC1_Resistance" 39 "NTC2_Resistance" 40 "NTC3_Resistance" 41 "NTC4_Resistance" 42 "NTC5_Resistance" 43 "NTC6_Resistance" 44 "RTD_CMD" 45 "FrontLeft_ON" 46 "FrontRight_ON" 47 "RearLeft_ON" 48 "RearRight_ON" 49 "RTD_FSM_STATE" 50 "password" 51 "close_relay" 52 "BrakeLightON_CTRL" 53 "RadFAN_PWM_CTRL" 54 "BattHVFan_CTRL" 55 "Throttle_0_Voltage_mV" 56 "Throttle_1_Voltage_mV" 57 "Steering_Voltage_mV" 58 "Brake_Straingauge_Voltage_mV" 59 "Pot_FL_Voltage_mV" 60 "Pot_FR_Voltage_mV" 61 "BrakePressure_Voltage_mV" 62 "isShutClosed_preInertia" 63 "isShutClosed_postInertia" 64 "isShutClosed_postBOTS" 65 "isShutClosed_postCockpit" 66 "Straingauge_PushFR_Voltage_mV" 67 "Straingauge_TieFR_Voltage_mV" 68 "Straingauge_PushFL_Voltage_mV" 69 "Straingauge_TieFL_Voltage_mV" 70 "NTC_1_Resistance" 71 "NTC_2_Resistance" 72 "NTC_3_Resistance" 73 "NTC_4_Resistance" 74 "NTC_Spare1_Resistance" 75 "NTC_Spare2_Resistance" 76 "Pot_RL_Voltage_mV" 77 "Pot_RR_Voltage_RR" 78 "BrakePressure_Rear_Voltage_mV" 79 "isShutClosed_postBSPD" 80 "isShutClosed_preFunghi" 81 "isShutClosed_postInvMono" 82 "isShutClosed_postInvFR" 83 "isBSPDinError" 84 "Straingauge_PushRR_Voltage_mV" 85 "Straingauge_TieRR_Voltage_mV" 86 "Straingauge_PushRL_Voltage_mV" 87 "Straingauge_TieRL_Voltage_mV" 88 "NTC_5_Resistance" 89 "NTC_6_Resistance" 90 "CoolingPressure_DX_Voltage_mV" 91 "CoolingPressure_SX_Voltage_mV" 92 "isShutClosed_preAMS_IMD_Latch" 93 "isShutClosed_postAMSLatch" 94 "isShutClosed_postIMDLatch" 95 "isShutdownClosed_preTLBBattFinal" 96 "isAMSErrorLatched" 97 "isIMDErrorLatched" 98 "isSdPrchRlyClosed" 99 "ShutdownADC_postSDPrechargeRelay" 100 "ShutdownADC_AIRsOpeningDelayCaps" 101 "TSAL_isGreenON" 102 "TSAL_isAIRPosClosed" 103 "TSAL_IsAIRNegClosed" 104 "TSAL_IsRelayPrechargeClosed" 105 "TSAL_isDCBusOver60V" 106 "IntentionalState_AIRPos" 107 "IntentionalState_AIRNeg" 108 "IntentionalState_RelayPrecharge" 109 "SCS_Short2GND_AirPos" 110 "SCS_Short2GND_AirNeg" 111 "SCS_isAnyShort2GND_Present" 112 "Imp_isAnyImp_Present" 113 "Imp_isAIRPosImp_Present" 114 "Imp_isAIRNegImp_Present" 115 "Imp_isRelayPrechargeImp_Present" 116 "Imp_isDCBusVoltageImp_Present" 117 "Imp_isAnyImp_Latched"; +VAL_ 66 fmi 0 "high_severity" 1 "low_severity" 2 "erratic" 3 "v_above_normal" 4 "v_below_normal" 5 "i_above_normal" 6 "i_below_normal" 7 "system_not_responding_properly" 8 "abnormal_frequency" 9 "abnormal_update_rate" 10 "abnormal_rate_of_change" 11 "other_failure_mode" 12 "failure" 13 "out_of_calibration" 14 "special_instruction" 15 "data_valid_above_normal_range0" 16 "data_valid_above_normal_range1" 17 "data_valid_below_normal_range0" 18 "data_valid_below_normal_range1" 19 "received_network_data_error" 20 "data_drifted_high" 21 "data_drifted_low" 31 "condition_exists"; +VAL_ 99 sin 0 "time" 1 "Cell_1_Voltage_mV" 2 "Cell_2_Voltage_mV" 3 "Cell_3_Voltage_mV" 4 "Cell_4_Voltage_mV" 5 "Cell_5_Voltage_mV" 6 "Cell_6_Voltage_mV" 7 "Cell_7_Voltage_mV" 8 "Current_Sensor_mV" 9 "LV_Total_Voltage_mV" 10 "LV_Total_Voltage_Sum_mV" 11 "isRelayOpen" 12 "cell1_OV" 13 "cell2_OV" 14 "cell3_OV" 15 "cell4_OV" 16 "cell5_OV" 17 "cell6_OV" 18 "cell7_OV" 19 "cell1_UV" 20 "cell2_UV" 21 "cell3_UV" 22 "cell4_UV" 23 "cell5_UV" 24 "cell6_UV" 25 "cell7_UV" 26 "temp1_OT" 27 "temp2_OT" 28 "temp3_OT" 29 "temp4_OT" 30 "temp5_OT" 31 "temp6_OT" 32 "temp7_OT" 33 "temp8_OT" 34 "temp9_OT" 35 "temp10_OT" 36 "temp11_OT" 37 "temp12_OT" 38 "NTC1_Resistance" 39 "NTC2_Resistance" 40 "NTC3_Resistance" 41 "NTC4_Resistance" 42 "NTC5_Resistance" 43 "NTC6_Resistance" 44 "RTD_CMD" 45 "FrontLeft_ON" 46 "FrontRight_ON" 47 "RearLeft_ON" 48 "RearRight_ON" 49 "RTD_FSM_STATE" 50 "password" 51 "close_relay" 52 "BrakeLightON_CTRL" 53 "RadFAN_PWM_CTRL" 54 "BattHVFan_CTRL" 55 "Throttle_0_Voltage_mV" 56 "Throttle_1_Voltage_mV" 57 "Steering_Voltage_mV" 58 "Brake_Straingauge_Voltage_mV" 59 "Pot_FL_Voltage_mV" 60 "Pot_FR_Voltage_mV" 61 "BrakePressure_Voltage_mV" 62 "isShutClosed_preInertia" 63 "isShutClosed_postInertia" 64 "isShutClosed_postBOTS" 65 "isShutClosed_postCockpit" 66 "Straingauge_PushFR_Voltage_mV" 67 "Straingauge_TieFR_Voltage_mV" 68 "Straingauge_PushFL_Voltage_mV" 69 "Straingauge_TieFL_Voltage_mV" 70 "NTC_1_Resistance" 71 "NTC_2_Resistance" 72 "NTC_3_Resistance" 73 "NTC_4_Resistance" 74 "NTC_Spare1_Resistance" 75 "NTC_Spare2_Resistance" 76 "Pot_RL_Voltage_mV" 77 "Pot_RR_Voltage_RR" 78 "BrakePressure_Rear_Voltage_mV" 79 "isShutClosed_postBSPD" 80 "isShutClosed_preFunghi" 81 "isShutClosed_postInvMono" 82 "isShutClosed_postInvFR" 83 "isBSPDinError" 84 "Straingauge_PushRR_Voltage_mV" 85 "Straingauge_TieRR_Voltage_mV" 86 "Straingauge_PushRL_Voltage_mV" 87 "Straingauge_TieRL_Voltage_mV" 88 "NTC_5_Resistance" 89 "NTC_6_Resistance" 90 "CoolingPressure_DX_Voltage_mV" 91 "CoolingPressure_SX_Voltage_mV" 92 "isShutClosed_preAMS_IMD_Latch" 93 "isShutClosed_postAMSLatch" 94 "isShutClosed_postIMDLatch" 95 "isShutdownClosed_preTLBBattFinal" 96 "isAMSErrorLatched" 97 "isIMDErrorLatched" 98 "isSdPrchRlyClosed" 99 "ShutdownADC_postSDPrechargeRelay" 100 "ShutdownADC_AIRsOpeningDelayCaps" 101 "TSAL_isGreenON" 102 "TSAL_isAIRPosClosed" 103 "TSAL_IsAIRNegClosed" 104 "TSAL_IsRelayPrechargeClosed" 105 "TSAL_isDCBusOver60V" 106 "IntentionalState_AIRPos" 107 "IntentionalState_AIRNeg" 108 "IntentionalState_RelayPrecharge" 109 "SCS_Short2GND_AirPos" 110 "SCS_Short2GND_AirNeg" 111 "SCS_isAnyShort2GND_Present" 112 "Imp_isAnyImp_Present" 113 "Imp_isAIRPosImp_Present" 114 "Imp_isAIRNegImp_Present" 115 "Imp_isRelayPrechargeImp_Present" 116 "Imp_isDCBusVoltageImp_Present" 117 "Imp_isAnyImp_Latched"; +VAL_ 99 fmi 0 "high_severity" 1 "low_severity" 2 "erratic" 3 "v_above_normal" 4 "v_below_normal" 5 "i_above_normal" 6 "i_below_normal" 7 "system_not_responding_properly" 8 "abnormal_frequency" 9 "abnormal_update_rate" 10 "abnormal_rate_of_change" 11 "other_failure_mode" 12 "failure" 13 "out_of_calibration" 14 "special_instruction" 15 "data_valid_above_normal_range0" 16 "data_valid_above_normal_range1" 17 "data_valid_below_normal_range0" 18 "data_valid_below_normal_range1" 19 "received_network_data_error" 20 "data_drifted_high" 21 "data_drifted_low" 31 "condition_exists"; +VAL_ 100 sin 0 "time" 1 "Cell_1_Voltage_mV" 2 "Cell_2_Voltage_mV" 3 "Cell_3_Voltage_mV" 4 "Cell_4_Voltage_mV" 5 "Cell_5_Voltage_mV" 6 "Cell_6_Voltage_mV" 7 "Cell_7_Voltage_mV" 8 "Current_Sensor_mV" 9 "LV_Total_Voltage_mV" 10 "LV_Total_Voltage_Sum_mV" 11 "isRelayOpen" 12 "cell1_OV" 13 "cell2_OV" 14 "cell3_OV" 15 "cell4_OV" 16 "cell5_OV" 17 "cell6_OV" 18 "cell7_OV" 19 "cell1_UV" 20 "cell2_UV" 21 "cell3_UV" 22 "cell4_UV" 23 "cell5_UV" 24 "cell6_UV" 25 "cell7_UV" 26 "temp1_OT" 27 "temp2_OT" 28 "temp3_OT" 29 "temp4_OT" 30 "temp5_OT" 31 "temp6_OT" 32 "temp7_OT" 33 "temp8_OT" 34 "temp9_OT" 35 "temp10_OT" 36 "temp11_OT" 37 "temp12_OT" 38 "NTC1_Resistance" 39 "NTC2_Resistance" 40 "NTC3_Resistance" 41 "NTC4_Resistance" 42 "NTC5_Resistance" 43 "NTC6_Resistance" 44 "RTD_CMD" 45 "FrontLeft_ON" 46 "FrontRight_ON" 47 "RearLeft_ON" 48 "RearRight_ON" 49 "RTD_FSM_STATE" 50 "password" 51 "close_relay" 52 "BrakeLightON_CTRL" 53 "RadFAN_PWM_CTRL" 54 "BattHVFan_CTRL" 55 "Throttle_0_Voltage_mV" 56 "Throttle_1_Voltage_mV" 57 "Steering_Voltage_mV" 58 "Brake_Straingauge_Voltage_mV" 59 "Pot_FL_Voltage_mV" 60 "Pot_FR_Voltage_mV" 61 "BrakePressure_Voltage_mV" 62 "isShutClosed_preInertia" 63 "isShutClosed_postInertia" 64 "isShutClosed_postBOTS" 65 "isShutClosed_postCockpit" 66 "Straingauge_PushFR_Voltage_mV" 67 "Straingauge_TieFR_Voltage_mV" 68 "Straingauge_PushFL_Voltage_mV" 69 "Straingauge_TieFL_Voltage_mV" 70 "NTC_1_Resistance" 71 "NTC_2_Resistance" 72 "NTC_3_Resistance" 73 "NTC_4_Resistance" 74 "NTC_Spare1_Resistance" 75 "NTC_Spare2_Resistance" 76 "Pot_RL_Voltage_mV" 77 "Pot_RR_Voltage_RR" 78 "BrakePressure_Rear_Voltage_mV" 79 "isShutClosed_postBSPD" 80 "isShutClosed_preFunghi" 81 "isShutClosed_postInvMono" 82 "isShutClosed_postInvFR" 83 "isBSPDinError" 84 "Straingauge_PushRR_Voltage_mV" 85 "Straingauge_TieRR_Voltage_mV" 86 "Straingauge_PushRL_Voltage_mV" 87 "Straingauge_TieRL_Voltage_mV" 88 "NTC_5_Resistance" 89 "NTC_6_Resistance" 90 "CoolingPressure_DX_Voltage_mV" 91 "CoolingPressure_SX_Voltage_mV" 92 "isShutClosed_preAMS_IMD_Latch" 93 "isShutClosed_postAMSLatch" 94 "isShutClosed_postIMDLatch" 95 "isShutdownClosed_preTLBBattFinal" 96 "isAMSErrorLatched" 97 "isIMDErrorLatched" 98 "isSdPrchRlyClosed" 99 "ShutdownADC_postSDPrechargeRelay" 100 "ShutdownADC_AIRsOpeningDelayCaps" 101 "TSAL_isGreenON" 102 "TSAL_isAIRPosClosed" 103 "TSAL_IsAIRNegClosed" 104 "TSAL_IsRelayPrechargeClosed" 105 "TSAL_isDCBusOver60V" 106 "IntentionalState_AIRPos" 107 "IntentionalState_AIRNeg" 108 "IntentionalState_RelayPrecharge" 109 "SCS_Short2GND_AirPos" 110 "SCS_Short2GND_AirNeg" 111 "SCS_isAnyShort2GND_Present" 112 "Imp_isAnyImp_Present" 113 "Imp_isAIRPosImp_Present" 114 "Imp_isAIRNegImp_Present" 115 "Imp_isRelayPrechargeImp_Present" 116 "Imp_isDCBusVoltageImp_Present" 117 "Imp_isAnyImp_Latched"; +VAL_ 100 fmi 0 "high_severity" 1 "low_severity" 2 "erratic" 3 "v_above_normal" 4 "v_below_normal" 5 "i_above_normal" 6 "i_below_normal" 7 "system_not_responding_properly" 8 "abnormal_frequency" 9 "abnormal_update_rate" 10 "abnormal_rate_of_change" 11 "other_failure_mode" 12 "failure" 13 "out_of_calibration" 14 "special_instruction" 15 "data_valid_above_normal_range0" 16 "data_valid_above_normal_range1" 17 "data_valid_below_normal_range0" 18 "data_valid_below_normal_range1" 19 "received_network_data_error" 20 "data_drifted_high" 21 "data_drifted_low" 31 "condition_exists"; +VAL_ 53 sin 0 "time" 1 "Cell_1_Voltage_mV" 2 "Cell_2_Voltage_mV" 3 "Cell_3_Voltage_mV" 4 "Cell_4_Voltage_mV" 5 "Cell_5_Voltage_mV" 6 "Cell_6_Voltage_mV" 7 "Cell_7_Voltage_mV" 8 "Current_Sensor_mV" 9 "LV_Total_Voltage_mV" 10 "LV_Total_Voltage_Sum_mV" 11 "isRelayOpen" 12 "cell1_OV" 13 "cell2_OV" 14 "cell3_OV" 15 "cell4_OV" 16 "cell5_OV" 17 "cell6_OV" 18 "cell7_OV" 19 "cell1_UV" 20 "cell2_UV" 21 "cell3_UV" 22 "cell4_UV" 23 "cell5_UV" 24 "cell6_UV" 25 "cell7_UV" 26 "temp1_OT" 27 "temp2_OT" 28 "temp3_OT" 29 "temp4_OT" 30 "temp5_OT" 31 "temp6_OT" 32 "temp7_OT" 33 "temp8_OT" 34 "temp9_OT" 35 "temp10_OT" 36 "temp11_OT" 37 "temp12_OT" 38 "NTC1_Resistance" 39 "NTC2_Resistance" 40 "NTC3_Resistance" 41 "NTC4_Resistance" 42 "NTC5_Resistance" 43 "NTC6_Resistance" 44 "RTD_CMD" 45 "FrontLeft_ON" 46 "FrontRight_ON" 47 "RearLeft_ON" 48 "RearRight_ON" 49 "RTD_FSM_STATE" 50 "password" 51 "close_relay" 52 "BrakeLightON_CTRL" 53 "RadFAN_PWM_CTRL" 54 "BattHVFan_CTRL" 55 "Throttle_0_Voltage_mV" 56 "Throttle_1_Voltage_mV" 57 "Steering_Voltage_mV" 58 "Brake_Straingauge_Voltage_mV" 59 "Pot_FL_Voltage_mV" 60 "Pot_FR_Voltage_mV" 61 "BrakePressure_Voltage_mV" 62 "isShutClosed_preInertia" 63 "isShutClosed_postInertia" 64 "isShutClosed_postBOTS" 65 "isShutClosed_postCockpit" 66 "Straingauge_PushFR_Voltage_mV" 67 "Straingauge_TieFR_Voltage_mV" 68 "Straingauge_PushFL_Voltage_mV" 69 "Straingauge_TieFL_Voltage_mV" 70 "NTC_1_Resistance" 71 "NTC_2_Resistance" 72 "NTC_3_Resistance" 73 "NTC_4_Resistance" 74 "NTC_Spare1_Resistance" 75 "NTC_Spare2_Resistance" 76 "Pot_RL_Voltage_mV" 77 "Pot_RR_Voltage_RR" 78 "BrakePressure_Rear_Voltage_mV" 79 "isShutClosed_postBSPD" 80 "isShutClosed_preFunghi" 81 "isShutClosed_postInvMono" 82 "isShutClosed_postInvFR" 83 "isBSPDinError" 84 "Straingauge_PushRR_Voltage_mV" 85 "Straingauge_TieRR_Voltage_mV" 86 "Straingauge_PushRL_Voltage_mV" 87 "Straingauge_TieRL_Voltage_mV" 88 "NTC_5_Resistance" 89 "NTC_6_Resistance" 90 "CoolingPressure_DX_Voltage_mV" 91 "CoolingPressure_SX_Voltage_mV" 92 "isShutClosed_preAMS_IMD_Latch" 93 "isShutClosed_postAMSLatch" 94 "isShutClosed_postIMDLatch" 95 "isShutdownClosed_preTLBBattFinal" 96 "isAMSErrorLatched" 97 "isIMDErrorLatched" 98 "isSdPrchRlyClosed" 99 "ShutdownADC_postSDPrechargeRelay" 100 "ShutdownADC_AIRsOpeningDelayCaps" 101 "TSAL_isGreenON" 102 "TSAL_isAIRPosClosed" 103 "TSAL_IsAIRNegClosed" 104 "TSAL_IsRelayPrechargeClosed" 105 "TSAL_isDCBusOver60V" 106 "IntentionalState_AIRPos" 107 "IntentionalState_AIRNeg" 108 "IntentionalState_RelayPrecharge" 109 "SCS_Short2GND_AirPos" 110 "SCS_Short2GND_AirNeg" 111 "SCS_isAnyShort2GND_Present" 112 "Imp_isAnyImp_Present" 113 "Imp_isAIRPosImp_Present" 114 "Imp_isAIRNegImp_Present" 115 "Imp_isRelayPrechargeImp_Present" 116 "Imp_isDCBusVoltageImp_Present" 117 "Imp_isAnyImp_Latched"; +VAL_ 53 fmi 0 "high_severity" 1 "low_severity" 2 "erratic" 3 "v_above_normal" 4 "v_below_normal" 5 "i_above_normal" 6 "i_below_normal" 7 "system_not_responding_properly" 8 "abnormal_frequency" 9 "abnormal_update_rate" 10 "abnormal_rate_of_change" 11 "other_failure_mode" 12 "failure" 13 "out_of_calibration" 14 "special_instruction" 15 "data_valid_above_normal_range0" 16 "data_valid_above_normal_range1" 17 "data_valid_below_normal_range0" 18 "data_valid_below_normal_range1" 19 "received_network_data_error" 20 "data_drifted_high" 21 "data_drifted_low" 31 "condition_exists"; + diff --git a/examples/dm1/main.go b/examples/dm1/main.go index d95137f..a3c0fc5 100644 --- a/examples/dm1/main.go +++ b/examples/dm1/main.go @@ -1,106 +1,36 @@ package main import ( - "fmt" - "log" + "os" "github.com/FerroO2000/acmelib" + "github.com/FerroO2000/acmelib/plugins/dm1" ) -// !TODO: guardie sulle enum - -const dm1MsgName = "DM1" - -var uint16bit, _ = acmelib.NewIntegerSignalType("16_bit", 16, false) -var mVUnit = acmelib.NewSignalUnit("milli_volt", acmelib.SignalUnitKindElectrical, "mV") -var flagType = acmelib.NewFlagSignalType("flag") -var uint8bit, _ = acmelib.NewIntegerSignalType("uint_8", 8, false) - func main() { - bmslv := acmelib.NewNode("BMS_LV", 0) - - battPackGen := acmelib.NewMessage("BMSLV_BatteryPackGeneral", 6) - - currSens, _ := acmelib.NewStandardSignal("Current_Sensor_mV", uint16bit) - currSens.SetUnit(mVUnit) - totVolt, _ := acmelib.NewStandardSignal("Total_voltage", uint16bit) - totVolt.SetUnit(mVUnit) - - if err := battPackGen.AppendSignal(currSens); err != nil { - panic(err) - } - if err := battPackGen.AppendSignal(totVolt); err != nil { + mcbFile, err := os.Open("MCB.dbc") + if err != nil { panic(err) } - msgStatus := acmelib.NewMessage("BMSLV_Status", 6) - - isRelOpen, _ := acmelib.NewStandardSignal("is_relary_open", flagType) - - if err := msgStatus.AppendSignal(isRelOpen); err != nil { + mcbBus, err := acmelib.ImportDBCFile("MCB", mcbFile) + if err != nil { panic(err) } - bmslv.AddMessage(battPackGen) - bmslv.AddMessage(msgStatus) - - sinEnum, _ := genSin(bmslv.Messages()) + mcbFile.Close() - dm1Msg := acmelib.NewMessage(dm1MsgName, 8) - sinSig, _ := acmelib.NewEnumSignal("sin", sinEnum) - fmiSig, _ := acmelib.NewEnumSignal("fmi", initFmi()) - occSig, _ := acmelib.NewStandardSignal("occ_counter", uint8bit) - - if err := dm1Msg.InsertSignal(sinSig, 0); err != nil { - panic(err) - } - if err := dm1Msg.InsertSignal(fmiSig, 8); err != nil { + mcbBusDM1, err := dm1.GenerateDM1Messages(mcbBus) + if err != nil { panic(err) } - if err := dm1Msg.InsertSignal(occSig, 16); err != nil { - panic(err) - } - - bmslv.AddMessage(dm1Msg) - - log.Print(bmslv.String()) -} - -func genSin(messages []*acmelib.Message) (*acmelib.SignalEnum, error) { - sinEnum := acmelib.NewSignalEnum("sin") - - sigNames := make(map[string]int) - idx := 0 - for _, msg := range messages { - for _, sig := range msg.Signals() { - if sig.Name() == dm1MsgName { - continue - } - if _, ok := sigNames[sig.Name()]; !ok { - sigNames[sig.Name()] = idx - idx++ - } - } - } - - for enumValname, enumValIdx := range sigNames { - sigEnumVal := acmelib.NewSignalEnumValue(enumValname, enumValIdx) - if err := sinEnum.AddValue(sigEnumVal); err != nil { - panic(err) - } - } - - if sinEnum.GetSize() > 8 { - return nil, fmt.Errorf("too many signals") + mcbDM1File, err := os.Create("MCB_DM1.dbc") + if err != nil { + panic(err) } - return sinEnum, nil -} + acmelib.ExportBus(mcbDM1File, mcbBusDM1) -func initFmi() *acmelib.SignalEnum { - fmi := acmelib.NewSignalEnum("fmi") - fmi.AddValue(acmelib.NewSignalEnumValue("high_severity", 0)) - fmi.AddValue(acmelib.NewSignalEnumValue("condition_exists", 31)) - return fmi + mcbDM1File.Close() } diff --git a/examples/sc24/main.go b/examples/sc24/main.go deleted file mode 100644 index b3bbd1d..0000000 --- a/examples/sc24/main.go +++ /dev/null @@ -1,270 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/FerroO2000/acmelib" -) - -var ( - flagType = acmelib.NewFlagSignalType("flag") - float16Type, _ = acmelib.NewFloatSignalType("float16", 16) - unit8Type, _ = acmelib.NewIntegerSignalType("uint8", 8, false) -) - -var ( - voltageUnit = acmelib.NewSignalUnit("voltage", acmelib.SignalUnitKindElectrical, "V") - milliAmpereUnit = acmelib.NewSignalUnit("milli_ampere", acmelib.SignalUnitKindElectrical, "mA") - celsiusDegUnit = acmelib.NewSignalUnit("celsius_deg", acmelib.SignalUnitKindTemperature, "degC") - kiloWattUnit = acmelib.NewSignalUnit("kilo_watt", acmelib.SignalUnitKindPower, "kW") -) - -var ( - genSigStartVal, _ = acmelib.NewFloatAttribute("GenSigStartValue", 0, 0, 100000000000) -) - -func main() { - hvcb := acmelib.NewBus("hvcb") - - hvbNode := acmelib.NewNode("HVB", 0) - err := hvcb.AddNode(hvbNode) - panicErr(err) - - ivtMainNode := acmelib.NewNode("IVTMain", 1) - err = hvcb.AddNode(ivtMainNode) - panicErr(err) - - pcNode := acmelib.NewNode("PC", 2) - err = hvcb.AddNode(pcNode) - panicErr(err) - - vcuNode := acmelib.NewNode("VCU", 3) - err = hvcb.AddNode(vcuNode) - panicErr(err) - - chargerNode := acmelib.NewNode("Charger", 4) - err = hvcb.AddNode(chargerNode) - panicErr(err) - - info01DbgVMsg := info01DbgV() - err = hvbNode.AddMessage(info01DbgVMsg) - panicErr(err) - info01DbgVMsg.AddReceiver(pcNode) - - info02DbgTMsg := info02DbgT() - err = hvbNode.AddMessage(info02DbgTMsg) - panicErr(err) - info02DbgTMsg.AddReceiver(pcNode) - - hvbTXVCUCmdMsg := hvbTXVCUCmd() - err = vcuNode.AddMessage(hvbTXVCUCmdMsg) - panicErr(err) - hvbTXVCUCmdMsg.AddReceiver(hvbNode) - - nvbRXDiagnosisMsg := nvbRXDiagnosis() - err = hvbNode.AddMessage(nvbRXDiagnosisMsg) - panicErr(err) - - hvbRXCurLimMsg := hvbRXCurLim() - err = hvbNode.AddMessage(hvbRXCurLimMsg) - panicErr(err) - hvbRXCurLimMsg.AddReceiver(chargerNode) - hvbRXCurLimMsg.AddReceiver(vcuNode) - - hvbRXStatusMsg := hvbRXStatus() - panicErr(hvbNode.AddMessage(hvbRXStatusMsg)) - hvbRXStatusMsg.AddReceiver(chargerNode) - hvbRXStatusMsg.AddReceiver(vcuNode) -} - -func panicErr(err error) { - if err != nil { - panic(err) - } -} - -func info01DbgV() *acmelib.Message { - msg := acmelib.NewMessage("INFO_01_DbgV", 8) - msg.SetCANID(288) - - muxSig, err := acmelib.NewMultiplexerSignal("BMS_eDbgV", 256, 48) - panicErr(err) - - groupID := -1 - for i := 0; i < 255; i++ { - tmpIdx := i % 3 - - if tmpIdx == 0 { - groupID++ - } - - sig, err := acmelib.NewStandardSignal(fmt.Sprintf("BMS_VDbgV%3d", i), float16Type) - panicErr(err) - - sig.SetPhysicalValues(0, 4.95, 0, 0.001) - sig.SetUnit(voltageUnit) - sig.SetDesc(fmt.Sprintf("Cell %d voltage.", i)) - - err = muxSig.InsertSignal(sig, tmpIdx*16, groupID) - panicErr(err) - } - - msg.AppendSignal(muxSig) - - return msg -} - -func info02DbgT() *acmelib.Message { - msg := acmelib.NewMessage("INFO_01_DbgV", 8) - msg.SetCANID(289) - - muxSig, err := acmelib.NewMultiplexerSignal("BMS_eDbgT", 128, 48) - panicErr(err) - - groupID := -1 - for i := 0; i < 127; i++ { - tmpIdx := i % 3 - - if tmpIdx == 0 { - groupID++ - } - - sig, err := acmelib.NewStandardSignal(fmt.Sprintf("BMS_TDbgT%3d", i), float16Type) - panicErr(err) - - sig.SetPhysicalValues(-40, 105, -273.15, 0.01) - sig.SetUnit(celsiusDegUnit) - sig.SetDesc(fmt.Sprintf("Thermistor %d temperature.", i)) - - sig.AddAttributeValue(genSigStartVal, 23315) - - err = muxSig.InsertSignal(sig, tmpIdx*16, groupID) - panicErr(err) - } - - return msg -} - -func hvbTXVCUCmd() *acmelib.Message { - msg := acmelib.NewMessage("HVB_TX_VCUCmd", 8) - msg.SetCANID(336) - - enum := acmelib.NewSignalEnum("status") - err := enum.AddValue(acmelib.NewSignalEnumValue("DISABLED", 0)) - panicErr(err) - err = enum.AddValue(acmelib.NewSignalEnumValue("ENABLED", 1)) - panicErr(err) - - invReqSig, err := acmelib.NewEnumSignal("VCU_bHvbInvReq", enum) - panicErr(err) - invReqSig.SetDesc("Requested closing Inverter conductors by VCU") - err = msg.InsertSignal(invReqSig, 0) - panicErr(err) - - clrErrSig, err := acmelib.NewStandardSignal("VCU_ClrErr", flagType) - panicErr(err) - err = msg.InsertSignal(clrErrSig, 6) - panicErr(err) - - balReqSig, err := acmelib.NewEnumSignal("VCU_bBalReq", enum) - panicErr(err) - balReqSig.SetDesc("Enables pack balancing.") - err = msg.InsertSignal(balReqSig, 8) - panicErr(err) - - allVTReqSig, err := acmelib.NewEnumSignal("VCU_bAllVTReq", enum) - panicErr(err) - balReqSig.SetDesc("Enables pack all V & T message.") - err = msg.InsertSignal(allVTReqSig, 14) - panicErr(err) - - return msg -} - -func nvbRXDiagnosis() *acmelib.Message { - msg := acmelib.NewMessage("HVB_RX_Diagnosis", 8) - msg.SetCANID(512) - - sigNames := []string{ - "HVB_Diag_Flash", "HVB_Diag_eeprom", "HVB_Diag_RAM", - "HVB_Diag_CAN", "HVB_Diag_UART", - "HVB_Diag_cell_sna", "HVB_Diag_vcu_can_sna", "HVB_Diag_bat_curr_sna", "HVB_Diag_inv_vlt_sna", "HVB_Diag_bat_vlt_sna", - "HVB_Diag_cell_ut", "HVB_Diag_cell_ot", "HVB_Diag_cell_uv", "HVB_Diag_cell_ov", "HVB_Diag_bat_uv", "HVB_Diag_imd_sna", "HVB_Diag_imd__low_r", - "HVB_Diag_bat_curr_oc", "HVB_Diag_inv_vlt_ov", - "HVB_Recovery_Active", - } - - sigStartBits := []int{ - 0, 1, 2, - 4, 5, - 16, 17, 18, 19, 20, - 32, 33, 34, 35, 36, 37, 38, - 40, 41, - 56, - } - - for i, name := range sigNames { - sig, err := acmelib.NewStandardSignal(name, flagType) - panicErr(err) - err = msg.InsertSignal(sig, sigStartBits[i]) - panicErr(err) - } - - return msg -} - -func hvbRXCurLim() *acmelib.Message { - msg := acmelib.NewMessage("HVB_RX_CurrentLimits", 8) - msg.SetCANID(514) - - chargeCurLim, err := acmelib.NewStandardSignal("HVB_ChargeCurLimits", float16Type) - panicErr(err) - chargeCurLim.SetUnit(milliAmpereUnit) - chargeCurLim.SetPhysicalValues(0, 1310.7, 0, 0.02) - chargeCurLim.SetDesc("Maximum potential charging power limit. even in case of a protection this values is shown what might possible if no protection is on") - err = msg.InsertSignal(chargeCurLim, 7) - panicErr(err) - - dischargeCurLim, err := acmelib.NewStandardSignal("HVB_DischargeCurLimits", float16Type) - panicErr(err) - dischargeCurLim.SetUnit(milliAmpereUnit) - dischargeCurLim.SetPhysicalValues(0, 1310.7, 0, 0.02) - dischargeCurLim.SetDesc("Maximum discharging power limit. even in case of a protection this values is shown what might possible if no protection is on") - err = msg.InsertSignal(dischargeCurLim, 23) - panicErr(err) - - pwrHvb, err := acmelib.NewStandardSignal("HVB_pwrHvb", float16Type) - panicErr(err) - pwrHvb.SetUnit(kiloWattUnit) - pwrHvb.SetPhysicalValues(-1310.72, 1310.68, 0, 0.04) - pwrHvb.SetDesc("instantaneous net power (+ for input, - for output)") - err = msg.InsertSignal(pwrHvb, 39) - panicErr(err) - - return msg -} - -func hvbRXStatus() *acmelib.Message { - msg := acmelib.NewMessage("HVB_RX_CurrentLimits", 8) - msg.SetCANID(515) - - stSysEnum := acmelib.NewSignalEnum("HVB_stSys_enum") - stSysEnum.SetMinSize(8) - panicErr(stSysEnum.AddValue(acmelib.NewSignalEnumValue("OFF", 0))) - panicErr(stSysEnum.AddValue(acmelib.NewSignalEnumValue("STARTUP", 1))) - panicErr(stSysEnum.AddValue(acmelib.NewSignalEnumValue("ON", 2))) - panicErr(stSysEnum.AddValue(acmelib.NewSignalEnumValue("SHUTDOWN", 3))) - panicErr(stSysEnum.AddValue(acmelib.NewSignalEnumValue("ERROR", 5))) - - stSysSig, err := acmelib.NewEnumSignal("HVB_stSys", stSysEnum) - panicErr(err) - stSysSig.SetDesc("present system main state (State Machine)") - panicErr(msg.InsertSignal(stSysSig, 7)) - - stInv, err := acmelib.NewStandardSignal("HVB_stInv", unit8Type) - panicErr(err) - stInv.SetDesc("present state for Inverter") - panicErr(msg.InsertSignal(stInv, 15)) - - return msg -} diff --git a/plugins/dm1/dm1.go b/plugins/dm1/dm1.go new file mode 100644 index 0000000..1abee50 --- /dev/null +++ b/plugins/dm1/dm1.go @@ -0,0 +1,133 @@ +package dm1 + +import ( + "fmt" + "strings" + + "github.com/FerroO2000/acmelib" +) + +const dm1MsgNamePrefix = "dm1" + +var fmiValues = map[string]int{ + "high_severity": 0, + "low_severity": 1, + "erratic": 2, + "v_above_normal": 3, + "v_below_normal": 4, + "i_above_normal": 5, + "i_below_normal": 6, + "system_not_responding_properly": 7, + "abnormal_frequency": 8, + "abnormal_update_rate": 9, + "abnormal_rate_of_change": 10, + "other_failure_mode": 11, + "failure": 12, + "out_of_calibration": 13, + "special_instruction": 14, + "data_valid_above_normal_range0": 15, + "data_valid_above_normal_range1": 16, + "data_valid_below_normal_range0": 17, + "data_valid_below_normal_range1": 18, + "received_network_data_error": 19, + "data_drifted_high": 20, + "data_drifted_low": 21, + "condition_exists": 31, +} + +func generateSIN(messages []*acmelib.Message) *acmelib.EnumSignal { + sinEnum := acmelib.NewSignalEnum("sin_enum") + sinEnum.SetMinSize(8) + + valIdx := 0 + signalNames := make(map[string]bool) + for _, msg := range messages { + tmpMsgName := msg.Name() + splNames := strings.Split(tmpMsgName, "_") + + if splNames[0] == dm1MsgNamePrefix { + continue + } + + for _, sig := range msg.Signals() { + valName := strings.ReplaceAll(sig.Name(), " ", "_") + if _, ok := signalNames[valName]; ok { + continue + } + signalNames[valName] = true + + tmpVal := acmelib.NewSignalEnumValue(valName, valIdx) + if err := sinEnum.AddValue(tmpVal); err != nil { + panic(err) + } + valIdx++ + } + } + + sin, err := acmelib.NewEnumSignal("sin", sinEnum) + if err != nil { + panic(err) + } + + return sin +} + +func generateFMI() *acmelib.EnumSignal { + fmiEnum := acmelib.NewSignalEnum("fmi_enum") + + for valName, valIdx := range fmiValues { + tmpVal := acmelib.NewSignalEnumValue(valName, valIdx) + if err := fmiEnum.AddValue(tmpVal); err != nil { + panic(err) + } + } + + fmi, err := acmelib.NewEnumSignal("fmi", fmiEnum) + if err != nil { + panic(err) + } + + return fmi +} + +func generateOccCounter() *acmelib.StandardSignal { + occSigType, err := acmelib.NewIntegerSignalType("uint_8", 8, false) + if err != nil { + panic(err) + } + + occ, err := acmelib.NewStandardSignal("occ_counter", occSigType) + if err != nil { + panic(err) + } + + return occ +} + +func GenerateDM1Messages(bus *acmelib.Bus) (*acmelib.Bus, error) { + messages := []*acmelib.Message{} + for _, node := range bus.Nodes() { + messages = append(messages, node.Messages()...) + } + + for _, node := range bus.Nodes() { + msgName := fmt.Sprintf("%s_%s", dm1MsgNamePrefix, node.Name()) + + dm1 := acmelib.NewMessage(msgName, 8) + if err := dm1.InsertSignal(generateSIN(messages), 0); err != nil { + return nil, err + } + if err := dm1.InsertSignal(generateFMI(), 8); err != nil { + return nil, err + } + if err := dm1.InsertSignal(generateOccCounter(), 16); err != nil { + return nil, err + } + + if err := node.AddMessage(dm1); err != nil { + return nil, err + } + } + + return bus, nil +}