本文主要是介绍【DBC专题】-8-经典CAN2.0 DBC快速切换为CANFD DBC,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
目录
1 Classical CAN2.0 DBC快速切换为CANFD DBC
1.1 Classical CAN2.0 DBC的模板文件内容
1.2 CANFD DBC的模板文件内容
1.3 基于Classical CAN2.0 DBC快速切换/修改为CANFD DBC
1.4 基于CANFD DBC快速切换/修改为Classical CAN2.0 DBC
END
优质博文推荐阅读(单击下方链接,即可跳转):
1、Vector工具链
2、CAN Matrix DBC
3、CAN Matrix Arxml
1 Classical CAN2.0 DBC快速切换为CANFD DBC
一个DBC是Classical CAN2.0 DBC还是CANFD DBC取决于它使用的Template模板:常见的Classical CAN2.0 DBC使用的“CANTemplate.dbc”模板;CANFD DBC使用的“CAN_FD Template.dbc”模板。
现在我们来看一下两个Classical CAN2.0 DBC和CANFD DBC的Template模板差异。
1.1 Classical CAN2.0 DBC的模板文件内容
VERSION ""NS_ : NS_DESC_CM_BA_DEF_BA_VAL_CAT_DEF_CAT_FILTERBA_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_:BA_DEF_ "BusType" STRING ;
BA_DEF_DEF_ "BusType" "CAN";
1.2 CANFD DBC的模板文件内容
VERSION ""NS_ : NS_DESC_CM_BA_DEF_BA_VAL_CAT_DEF_CAT_FILTERBA_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_:BA_DEF_ BO_ "CANFD_BRS" ENUM "0","1";
BA_DEF_ "DBName" STRING ;
BA_DEF_ "BusType" STRING ;
BA_DEF_ BU_ "NodeLayerModules" STRING ;
BA_DEF_ BU_ "ECU" STRING ;
BA_DEF_ BU_ "CANoeJitterMax" INT 0 0;
BA_DEF_ BU_ "CANoeJitterMin" INT 0 0;
BA_DEF_ BU_ "CANoeDrift" INT 0 0;
BA_DEF_ BU_ "CANoeStartDelay" INT 0 0;
BA_DEF_ BO_ "VFrameFormat" ENUM "StandardCAN","ExtendedCAN","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","StandardCAN_FD","ExtendedCAN_FD";
BA_DEF_DEF_ "CANFD_BRS" "1";
BA_DEF_DEF_ "DBName" "";
BA_DEF_DEF_ "BusType" "";
BA_DEF_DEF_ "NodeLayerModules" "";
BA_DEF_DEF_ "ECU" "";
BA_DEF_DEF_ "CANoeJitterMax" 0;
BA_DEF_DEF_ "CANoeJitterMin" 0;
BA_DEF_DEF_ "CANoeDrift" 0;
BA_DEF_DEF_ "CANoeStartDelay" 0;
BA_DEF_DEF_ "VFrameFormat" "StandardCAN";
BA_ "BusType" "CAN FD";
BA_ "DBName" "CANFD";
1.3 基于Classical CAN2.0 DBC快速切换/修改为CANFD DBC
通过1.1和1.2章节的对比您可以清楚的发现,Classical CAN2.0 DBC和CANFD DBC二者Template模板的差异在DBC文件内容的末尾。
用文本编辑工具(记事本,Notepad++…)打开Classical CAN2.0 DBC,找到“BA_DEF_DEF_ "BusType" "CAN";”标签,用下列标签手动替换,并保存DBC文件。这样一个Classical CAN2.0 DBC就能快速变成一个CANFD DBC。
BA_DEF_ BO_ "CANFD_BRS" ENUM "0","1";
BA_DEF_ "DBName" STRING ;
BA_DEF_ BU_ "NodeLayerModules" STRING ;
BA_DEF_ BU_ "ECU" STRING ;
BA_DEF_ BU_ "CANoeJitterMax" INT 0 0;
BA_DEF_ BU_ "CANoeJitterMin" INT 0 0;
BA_DEF_ BU_ "CANoeDrift" INT 0 0;
BA_DEF_ BU_ "CANoeStartDelay" INT 0 0;
BA_DEF_ BO_ "VFrameFormat" ENUM "StandardCAN","ExtendedCAN","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","StandardCAN_FD","ExtendedCAN_FD";
BA_DEF_DEF_ "CANFD_BRS" "1";
BA_DEF_DEF_ "DBName" "";
BA_DEF_DEF_ "BusType" "";
BA_DEF_DEF_ "NodeLayerModules" "";
BA_DEF_DEF_ "ECU" "";
BA_DEF_DEF_ "CANoeJitterMax" 0;
BA_DEF_DEF_ "CANoeJitterMin" 0;
BA_DEF_DEF_ "CANoeDrift" 0;
BA_DEF_DEF_ "CANoeStartDelay" 0;
BA_DEF_DEF_ "VFrameFormat" "StandardCAN";
BA_ "BusType" "CAN FD";
BA_ "DBName" "CANFD";
1.4 基于CANFD DBC快速切换/修改为Classical CAN2.0 DBC
将1.3章节反过来,一个CANFD DBC就能快速变成一个Classical CAN2.0 DBC。但要注意,DLC大于8的Message,以及帧类型(CANFD标准帧和CANFD扩展帧)的调整:
- 一个CANFD DBC中既有CANFD帧,也有经典CAN帧,“CANFD扩展帧和标准帧”帧类型调整为“经典CAN扩展帧和标准帧”,需要避免“CANFD扩展帧和标准帧的CANID”与“经典CAN扩展帧和标准帧的CANID”一样的情况;
- 对于DLC大于8的“CANFD扩展帧和标准帧”调整为“经典CAN帧扩展帧和标准帧”,需要拆分成多个经典CAN帧(拆分后,各帧分配一个独有的ID);
- CANFD帧独有的Attribute属性需要被删除。
推荐阅读(单击下方文字即可跳转至对应博文):
《Autosar从入门到精通-实战篇》总目录_培训教程持续更新中...
《Autosar_BSW高阶配置》总目录_培训教程持续更新中...
《Autosar_MCAL高阶配置》总目录_培训教程持续更新中...
END
获取更多“汽车电子资讯”和“工具链使用”,
请关注“汽车电子助手”,做您的好助手。
这篇关于【DBC专题】-8-经典CAN2.0 DBC快速切换为CANFD DBC的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!