当前位置:网站首页>Vector CANape - How to Send Receive CAN Message in CANape
Vector CANape - How to Send Receive CAN Message in CANape
2022-07-26 17:13:00 【CDamogu】
背景概要
背景
为何说这是一篇价值10W+的文章?
因为当时曾寻找过第三方开发一款基于CANape的标定系统,第三方给出的价格是15W,当时也为此工具琢磨了很多,最终从无到有的开发出了基于CANape的标定系统,当然,这篇文章将会给你带来很多启发。
作者
Liuwanqiang 2020/11/27
Write This Artical to Record my notes,Whenever I forget the detail in Operated CANape.
目标
在 CANape 中实现 CAN 报文的发送接收Target
报文接收
接收的方式有两种 Device | New Device | New from database
- Device New
通过Device Configuration创建一个Monitor类的CAN节点,然后输入驱动设备名(自定义英文),至于comment看个人喜好。

- 点击
Next - 取消勾选
use database for signal definition - 点击
Next - 点选
Ok

- 如上图所示,勾选响应节点
- 点击闪电标志开始录取报文
- Devie New from database
如果你掌握了第一种方法,那么第二种直接从数据库建立,前提是你已经拥有了项目的DBC文件,直接如下图所示点击Ok,然后操作类似

优点就是你可以解析收到的CAN报文
报文发送
对于CAN报文的发送分为两种:
- 没有DBC文件,随机发送某自定义
CAN ID
举例:发送 CAN ID 为0x100的 CAN Message ,数据场为1,2,3,4,5 。Tools | Function and script 打开函数编辑器,在 Script 下面建立如下脚本并编译
//API
Device.SendMessage(messageID,value0,value1,)
//比如我在上述收发时候创建了DMGCanMsgSend的Device
DMGCanMsgSend.SendMessage(0x100,1,2,3,4,5)

通过编译后可做一个带有按键的面板,每次点击按键触发 CAN 报文发送。
tip
建立面板与数据、脚本间的链接,即通过面板的输入值来改变发送函数的ID、数据场

warning 注意
建立全局变量,通过全局变量让脚本与面板能够打开沟通的桥梁,从而解决面板与脚本数据间的沟通
- 有 DBC 文件,实现周期或随机发送 CAN 数据。
基本思路是创建 CAN 报文发送函数,在测量配置窗口周期性调用函数,从而实现 CAN 报文周期性发送。
举例: 依然在 Function and Script 窗口的 Function 下新建发送数据的全局变量
边栏推荐
- VIM multiline operation
- After vs code is formatted, the function name will be automatically followed by a space
- 2022 Henan Mengxin League game (3): Henan University
- 国际象棋机器人夹断7岁男孩手指,原因是「棋手违反安全规则」?
- Cross site scripting attack (XSS)
- Just this time! Talk about the technical solutions of distributed system in detail
- [day3] reconstruction of roads
- URL jump vulnerability
- Sign up now | oar hacker marathon phase III midsummer debut, waiting for you to challenge
- [Digital IC] understand Axi Lite protocol in simple terms
猜你喜欢
随机推荐
二层管理型交换机如何设置IP
How to assemble a registry?
【云原生】 iVX 低代码开发 引入腾讯地图并在线预览
Overview of the agenda of the keynote speech of apachecon Asia, an international celebrity vs a local open source star
JS 函数作用域 变量声明提升 作用域链 不加var的变量,是全局变量
COSCon'22城市/学校/机构出品人征集令
Spark统一内存划分
8、 Topic communication: topic substitution and monitoring
PMP考生必读,7月30日考试防疫要求都在这里
Machine learning by Li Hongyi 2. Regression
[Digital IC] understand Axi Lite protocol in simple terms
Laozi cloud and Fuxin Kunpeng achieved a major breakthrough in 3D ofd 3D format documents for the first time
【集训Day1】Spy dispatch
4、 Service communication principle, code implementation
点击劫持攻击
Relative path and absolute path
AI zhetianchuan ml integrated learning
浅析接口测试
Gan (generative adversarial network, GaN) generative countermeasure network
重磅!《2022中国开源发展蓝皮书》正式发布


![[template] segment tree 1](/img/60/9f73d00223c8878ffd8513b3b9adf7.jpg)






