CANoe快速入门.ppt

上传人:豆**** 文档编号:26004796 上传时间:2022-07-15 格式:PPT 页数:97 大小:3.70MB
返回 下载 相关 举报
CANoe快速入门.ppt_第1页
第1页 / 共97页
CANoe快速入门.ppt_第2页
第2页 / 共97页
点击查看更多>>
资源描述

《CANoe快速入门.ppt》由会员分享,可在线阅读,更多相关《CANoe快速入门.ppt(97页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、 2007. HiRain Technologies. All rights reserved.Slide: 2CANoe概述概述pCAN总线开发工具p测试p分析p仿真p记录 2007. HiRain Technologies. All rights reserved.Slide: 3CANoe在总线开发中的作用(在总线开发中的作用(1)Phase 1simul.nodensimul.node2Simulated bussimul.node1Kl 15Virtual total system 2007. HiRain Technologies. All rights reserved.Slid

2、e: 4CANoe在总线开发中的作用(在总线开发中的作用(2)Phase 2simul.node2simulated rest-of-busrealnode1Kl 15simul.nodenVirtual subystemReal subsystemphys. bus 2007. HiRain Technologies. All rights reserved.Slide: 5CANoe在总线开发中的作用(在总线开发中的作用(3)Phase 3realnode2realnode1Kl 15Real total systemrealnodenPhysical busAnalysis(in rea

3、l-time) 2007. HiRain Technologies. All rights reserved.Slide: 6p硬件接口卡&“狗”pCANcardXLpCANcaseXLp收发器pCANcab (CANpiggy)p251, 1041, 1054pLINcab (LINpiggy)p7259CAN卡卡 2007. HiRain Technologies. All rights reserved.Slide: 7CANoe组成组成p功能强大、操作简单pCANoep数据库支持pCANdb+ Editorp可编程pCAPLp虚拟仪表pPanel Editor & Panel Desi

4、gner 2007. HiRain Technologies. All rights reserved.Slide: 8CANoe工程环境工程环境 2007. HiRain Technologies. All rights reserved.Slide: 9多总线多总线p软件p硬件p控制面板pVector HardwareqLicense-Overview 2007. HiRain Technologies. All rights reserved.Slide: 10设置(设置(1)p硬件pCAN卡类型(编号)p收发器类型p应用程序通道p应用程序pLicense信息 2007. HiRain

5、Technologies. All rights reserved.Slide: 11设置(设置(2)pCANoep通道设置pConfiguration-OptionspConfiguration Settings-Channel Usage 2007. HiRain Technologies. All rights reserved.Slide: 12灵活复杂灵活复杂HW channelsChannel1 Channel2 Channel1 Channel2 PiggyBack1 PiggyBack2CANcardXL #1CANcaseXLCANcardXL #2HardwareCANal

6、yzer1 CANalyzer2. CANoe1 CANoe2 CANoe1 for LIN.App channelsApplication 2007. HiRain Technologies. All rights reserved.Slide: 13从复杂到简单从复杂到简单pCANoep波特率设置pConfiguration-Hardware Configuration 2007. HiRain Technologies. All rights reserved.Slide: 14基本术语基本术语报文(消息)与信号报文(消息)与信号报文:engine data (ID 100)ID 100

7、B0B1B2CRC信号发动机温度(第二字节,0-6位)未用(第二字节,第七位)发动机转速(第一,二字节)转换规则发动机转速 :rpm=1*Bit value (0 xFF 代表错误)发动机温度: C =2* Bit value 50 (0 x7F 代表错误) 2007. HiRain Technologies. All rights reserved.Slide: 15基本术语基本术语环境变量与系统变量环境变量与系统变量p环境变量p节点的I/O信号p可用于面板或真实I/Op系统变量p节点内部参数p或需要观测的某个数值p例如:系统变量1 = 报文1.信号1 报文2.信号2 2007. HiRai

8、n Technologies. All rights reserved.Slide: 16欢迎进入欢迎进入CANoe的世界的世界pCANoepCANdb+ EditorpCAPLpPanel Editor & Panel Designer 2007. HiRain Technologies. All rights reserved.Slide: 17欢迎进入欢迎进入CANoe的世界的世界pCANoep8大窗口pTrace WindowpBus Statistics WindowpStatistics WindowpData WindowpGraphic WindowpWrite Windowp

9、Simulation SetuppMeasurement Setup 2007. HiRain Technologies. All rights reserved.Slide: 18CANoe窗口介绍(窗口介绍(1)pTrace Windowp报文ID和报文名称(数据库)p信号(数据库)p时间(相对值或绝对值)p通道pDLCpDir(Tx或Rx)p更多内容见p右键点击窗口空白处-Configuration-Columns 2007. HiRain Technologies. All rights reserved.Slide: 19蒙太奇(蒙太奇(1)p在CANoe中添加数据库pView-Si

10、mulatioin Setup 2007. HiRain Technologies. All rights reserved.Slide: 20蒙太奇(蒙太奇(2)p符号化显示与十进制/十六进制切换Global switches: Hex/Dec and Numeric/Symbolic toggles 2007. HiRain Technologies. All rights reserved.Slide: 21CANoe窗口介绍(窗口介绍(1)清空Trace窗口暂停Trace窗口时间显示切换报文显示切换 2007. HiRain Technologies. All rights reser

11、ved.Slide: 22CANoe窗口介绍(窗口介绍(2)pData Windowp数据库!p信号名称p信号值(Value)p信号单位p原始值(Raw Value)pBar图 2007. HiRain Technologies. All rights reserved.Slide: 23CANoe窗口介绍(窗口介绍(2)pData Windowp添加信号p右键单击空白处pAdd Signalsp选择需要的信号 2007. HiRain Technologies. All rights reserved.Slide: 24CANoe窗口介绍(窗口介绍(3)pGraphics Windowsp数

12、据库!p显示信号曲线p不同的颜色和线形p右键单击空白处p选择Configurationp放大、缩小、平移 2007. HiRain Technologies. All rights reserved.Slide: 25CANoe窗口介绍(窗口介绍(3)pGraphics Windowsp添加信号p右键单击空白处pAdd Signalsp选择需要的信号 2007. HiRain Technologies. All rights reserved.Slide: 26CANoe窗口介绍(窗口介绍(4)pStatistics Windowp显示报文出现频率p显示错误帧出现频率p统计报告p右键单击空白处

13、pConfigurationpActivep生成统计报告(Write Window)Message frequencyID 2007. HiRain Technologies. All rights reserved.Slide: 27CANoe窗口介绍(窗口介绍(5)pBus Statistics Windowp总线负载p数据帧p错误帧pCAN卡控制器状态 2007. HiRain Technologies. All rights reserved.Slide: 28CANoe窗口介绍(窗口介绍(6)pWrite WindowpCAN卡控制器状态pLicense信息p统计报告pCAPL输出窗

14、口pPrintf = Write 2007. HiRain Technologies. All rights reserved.Slide: 29蒙太奇(蒙太奇(3)pDesktoppCreate New DesktoppRename Desktop 2007. HiRain Technologies. All rights reserved.Slide: 30蒙太奇(蒙太奇(4)p固定窗口 2007. HiRain Technologies. All rights reserved.Slide: 31CANoe窗口介绍(窗口介绍(7)pMeasurement SetuppView-Measu

15、rement Setupp每个模块对应一个窗口p增加新模块(窗口)p插入功能块p数据记录 2007. HiRain Technologies. All rights reserved.Slide: 32CANoe窗口介绍(窗口介绍(7)p新增模块(窗口) 2007. HiRain Technologies. All rights reserved.Slide: 33CANoe窗口介绍(窗口介绍(7)p插入功能块pCAPL节点p发生器模块p回放模块p触发模块p过滤器模块 2007. HiRain Technologies. All rights reserved.Slide: 34CANoe窗口

16、介绍(窗口介绍(7)p过滤器模块p通道过滤(Channel Filter)p报文过滤(Filter)p变量过滤(Variables) 2007. HiRain Technologies. All rights reserved.Slide: 35CANoe窗口介绍(窗口介绍(7)p数据记录p默认状态关闭p多种记录文件类型p多种记录配置方式 2007. HiRain Technologies. All rights reserved.Slide: 36CANoe窗口介绍(窗口介绍(7)p记录文件p右键点击文件图标-Logging file configuration 2007. HiRain T

17、echnologies. All rights reserved.Slide: 37CANoe窗口介绍(窗口介绍(7)p记录配置方式p双击Logging模块p全部记录p单次记录p触发记录 2007. HiRain Technologies. All rights reserved.Slide: 38蒙太奇(蒙太奇(5)p 数据记录的目的是为了离线分析pMode-To Offline 2007. HiRain Technologies. All rights reserved.Slide: 39CANoe窗口介绍(窗口介绍(8)pSimulation SetuppView-Simulation

18、Setupp发生器p交互式发生器pCAPL节点 2007. HiRain Technologies. All rights reserved.Slide: 40CANoe窗口介绍(窗口介绍(8)p发生器模块 2007. HiRain Technologies. All rights reserved.Slide: 41CANoe窗口介绍(窗口介绍(8)p发生器模块 2007. HiRain Technologies. All rights reserved.Slide: 42CANoe窗口介绍(窗口介绍(8)p发生器模块 2007. HiRain Technologies. All right

19、s reserved.Slide: 43CANoe窗口介绍(窗口介绍(8)p交互式发生器模块 2007. HiRain Technologies. All rights reserved.Slide: 44欢迎进入欢迎进入CAPL的世界的世界pCAPL (CAN Access Programming Language )p类C语言p仿真p单个节点和整个网络p外部环境p测试p面向事件的编程语言p总线事件p键盘事件p时间事件 2007. HiRain Technologies. All rights reserved.Slide: 45CAPL Browser标题栏菜单条工具条浏览树窗格编译信息窗

20、格状态条全局变量编辑窗格CAPL程序编辑窗格 2007. HiRain Technologies. All rights reserved.Slide: 46CAPL事件事件系统事件PreStartCANoe初始化时执行on preStart Start测量开始时执行on start StopMeasuremet测量结束时执行on stopMeasurement CAN控制器事件BusOff硬件检测到BusOff时执行on busOff ErrorActive硬件检测到ErrorActive时执行on errorActive ErrorPassive硬件检测到ErrorPassive时执行on

21、 errorPassive WarningLimit硬件检测到WarningLimit时执行on warningLimit CAN消息事件自定义接收到指定的消息时执行on message Message 时间事件自定义定时时间朝过时执行on timer Timer 键盘事件自定义键值指定的键被下时执行on key Key 错误帧事件ErrorFrame硬件每次检测到错误帧时执行on errorFrame 环境变量事件自定义指定的环境变量值改变时执行on envVar EnvVar 2007. HiRain Technologies. All rights reserved.Slide: 47C

22、APL基本语法基本语法p类C语言,语法与C语言基本相同p注释p/放置在需要注释的语句之前,注释单行p/*注释起始符,其后的内容被注释p*/注释结束符,结束由/*开始的注释p分号程序结束标识p大括号函数体counter = counter+1;if (counter=256) counter=0; stop(); 2007. HiRain Technologies. All rights reserved.Slide: 48消息事件消息事件pon message 123 /对消息123(dec)反应pon message 0 x123 /对消息123(hex)反应pon message Moto

23、rData /对消息MotorData(符号名字)反应pon message CAN1.123 /对CAN 通道1收到消息123反应pon message * /对所有消息反应pon message 100-200 /对100-200间消息反应 2007. HiRain Technologies. All rights reserved.Slide: 49键盘事件键盘事件pon key a /按a键反应pon key /按空格键反应pon key 0 x20 /按空格键反应pon key F1 /按F1键反应pon key Ctrl-F12 /按Ctrl + F12键反应pon key Pag

24、eUP /按PageUp键反应pon key Home /按Home键反应pon key * /按所有键反应 2007. HiRain Technologies. All rights reserved.Slide: 50时间事件时间事件p定时器声明pmsTimer myTimer; /将myTimer 申明ms为单位的变量ptimer myTimer; /将myTimer 申明s为单位的变量p定时器函数psetTimer(myTimer,20);/将定时值设定为20ms,并启动pcancelTimer(myTimer); /停止定时器myTimerp定时器事件pon timer myTime

25、r/对myTimer 设定的时间到反应 2007. HiRain Technologies. All rights reserved.Slide: 51环境变量事件环境变量事件p环境变量函数pgetValue()/获取环境变量的值pputValue()/设置环境变量的值p环境变量事件pon envVar XXX 2007. HiRain Technologies. All rights reserved.Slide: 52数据类型数据类型数据类型数据类型名称名称注释注释无符号整型byte1个字节word2个字节dword4个字节有符号整型int2个字节long4个字节浮点型float8个字节d

26、ouble8个字节CAN报文message定时器timer秒msTimer毫秒单个字符char1个字节 2007. HiRain Technologies. All rights reserved.Slide: 53数据定义数据定义p全局变量和局部变量p变量定义int i;message 0 x123 HiRain;message MotorData Vector; 2007. HiRain Technologies. All rights reserved.Slide: 54完整的完整的CAPL程序程序p三个部分p变量p各种事件p自定义函数on start /过程指令块 on message

27、 xxx /过程指令块 on key 1 /过程指令块 My_function_1(Para_1, Para_2, ) /函数体 My_function_n(Para_1, Para_2, ) /函数体 variables /申明全局变量 2007. HiRain Technologies. All rights reserved.Slide: 55CAPL输出文本输出文本pWrite Windowpwrite函数int h=100;char ch=a;char s1008=“hundred”;write(“Hundred as a number:%d,%x”,h,h);write(“Hund

28、red as a string:%s”,s100);write(“The square root of two is %6.4g”,sqrt(2.0); 2007. HiRain Technologies. All rights reserved.Slide: 56消息处理常用语句消息处理常用语句pif (this.id=100) pmsg.can=2;pmsg.dlc=8;pdword t ; t=this.time;pif(this.dir!=RX) return;pthis.CarSpeed = 200; 2007. HiRain Technologies. All rights res

29、erved.Slide: 57关键字关键字thispthis代表触发事件的对象on message 100 byte byte_0;byte_0 = this.byte(0);.on envVar Switch int val;val = getvalue(this);. 2007. HiRain Technologies. All rights reserved.Slide: 58报文处理报文处理on message 0 x64 if(this.byte(2)=0 xFF) write(“Third byte of the message is invalid”);on message Mo

30、torData if(this.temperature.phys=150) write(“Warning: critical temperature”); 2007. HiRain Technologies. All rights reserved.Slide: 59键盘处理键盘处理on key a message MotorData mMoDa; mMoDa.temperature.phys=60; mMoDa.speed.phys=4300; output(mMoDa);on key b message 100 m100= dlc=1; m100.byte(0)=0 x0B; output

31、(m100); 2007. HiRain Technologies. All rights reserved.Slide: 60定时器处理定时器处理Variablesmessage 0 x555 msg1 = dlc=1; msTimer timer1; on startsetTimer(timer1,100); on timer timer1setTimer(timer1,100); msg1.byte(0)=msg1.byte(0)+1; output(msg1); 2007. HiRain Technologies. All rights reserved.Slide: 61环境变量处理

32、环境变量处理on envVar evSwitch message MotorData msg;msg.bsSwitch = getValue(this);output(msg); 2007. HiRain Technologies. All rights reserved.Slide: 62练习练习1p当CANoe启动时,向Write Window输出一句话,例如“Hello the world!” 2007. HiRain Technologies. All rights reserved.Slide: 63练习练习2p利用发生器模块周期性发送某一报文,例如每隔200ms发送一条Engine

33、Data报文。每当按下a键,在Write Window窗口输出一句话,例如“ XXX EngineData messages have sent.”p注:XXX为已经发送的EngineData报文数量。 2007. HiRain Technologies. All rights reserved.Slide: 64练习练习3p不用发生器模块实现Enginedata报文的周期性发送。p每当按下a键时,EngineData里面EngSpeed信号值为2000;当按下b键盘时, EngineData里面EngSpeed信号值为4000;p如果EngineData里面EngSpeed信号为4000,则

34、发送ABSData报文,同时在Write Window输出“Warning!”p当按下c键时,停止EngineData报文发送。 2007. HiRain Technologies. All rights reserved.Slide: 65欢迎进入欢迎进入CANdb+ Editor的世界的世界pDBC文件编辑工具p启动CANoepFile-Open CANdb Editorp点击 2007. HiRain Technologies. All rights reserved.Slide: 66创建一个新的创建一个新的CAN数据库数据库pFile-Create Database p选择模板,鼠标

35、双击或 按 OK按钮p指定数据库文件类型、 文件名及保存目录p按Save按钮。 一个新数据库创建完成 2007. HiRain Technologies. All rights reserved.Slide: 67创建对象(信号、报文、节点、环境变量和创建对象(信号、报文、节点、环境变量和ECU)p在Overview窗口左边 选择所需创建对象的类型p右键点击对象类型, 在快捷菜单中选择Newp使用配置对话框设置 所创建对象的系统参数值p点击确定按钮, 一个新对象便创建完毕 2007. HiRain Technologies. All rights reserved.Slide: 68复制已有对

36、象复制已有对象pCopy-Pastep选择已有对象Ctrl+cp选择对象类型Ctrl+v 2007. HiRain Technologies. All rights reserved.Slide: 69修改修改/编辑已有对象编辑已有对象p直接双击 2007. HiRain Technologies. All rights reserved.Slide: 70对象链接对象链接(1/2)p信号与报文之间的连接p发送报文与节点之间的连接p鼠标拖拽或Copy-Insert 2007. HiRain Technologies. All rights reserved.Slide: 71对象链接对象链接(

37、2/2)p接收报文与节点之间的连接p通过信号间接定义p双击节点, 选择Mapped Rx Sig.页签p点击Add,选择接收信号点击OKp点击确定 2007. HiRain Technologies. All rights reserved.Slide: 72通信矩阵通信矩阵pView-Communication Matrixp显示信号、消息、及网络节点的关系p以信号为行,网络节点为列p消息名显示于表中,对应了包含的信号与发送/接收的节点 2007. HiRain Technologies. All rights reserved.Slide: 73数值表数值表(1/2)p新建数值表pView

38、-Value Tablesp右键点击空白处, 选择Newp在对话框中输入数值,点击确定p新的数值表创建完成 2007. HiRain Technologies. All rights reserved.Slide: 74数值表数值表(2/2)p分配数值表p数值表可以分配给信号或环境变量 2007. HiRain Technologies. All rights reserved.Slide: 75属性列表属性列表pVector Tool Chain AttributespGeneralpManufacturerpInteraction LayerpGenMsgCycleTimepTranspo

39、rt Protocol and DiagnosticspDiagRequest, DiaResponsepNetwork ManagementpNmBaseAddress, NmStationAdresspTool specificpBusType 2007. HiRain Technologies. All rights reserved.Slide: 76新建属性新建属性pView-Attribute Definitionsp右键点击空白处, 选择Newp在对话框中输入相关参数,点击确定p新的属性创建完成 2007. HiRain Technologies. All rights rese

40、rved.Slide: 77对象属性修改对象属性修改p双击对象 2007. HiRain Technologies. All rights reserved.Slide: 78一致性检查一致性检查pFile- Consistency Check 2007. HiRain Technologies. All rights reserved.Slide: 79数据导出数据导出p选择需要导出的对象p信号,报文,节点,ECU或网络pFile-Export-Export List of Objects 2007. HiRain Technologies. All rights reserved.Slid

41、e: 80创建面板创建面板/虚拟仪表虚拟仪表pPanel Editorp传统的面板编辑器pFile-Open Panel EditorpPanel Designerp新的面板编辑器pFile-Open Panel Designer 2007. HiRain Technologies. All rights reserved.Slide: 81Panel Editor面板区控件区 2007. HiRain Technologies. All rights reserved.Slide: 82面板设置面板设置pOptions-Window settingp定义面板名称p面板尺寸p背景颜色p透明色p

42、控件的缺省字体和颜色pOptions-Change gridp网格大小p网格可视 2007. HiRain Technologies. All rights reserved.Slide: 83控件列表控件列表图标名称 2007. HiRain Technologies. All rights reserved.Slide: 84文本与位图文本与位图p文本p位图 2007. HiRain Technologies. All rights reserved.Slide: 85开关与多态位图开关与多态位图p开关p多态位图 2007. HiRain Technologies. All rights

43、reserved.Slide: 86其它常见的控件其它常见的控件p十六进制p滑动条p仪表p输入/输出显示 2007. HiRain Technologies. All rights reserved.Slide: 87面板使用面板使用p保存面板pFile-Savep使用面板(CANoe)pConfiguration-Panel Configuration添加面板显示面板 2007. HiRain Technologies. All rights reserved.Slide: 88Panel Designer控件窗口控件属性工作区对象窗口 2007. HiRain Technologies.

44、All rights reserved.Slide: 89设置设置pSettings-Controls Propertiesp设置控件的字体、颜色和字号pSettings-Symbol Explorerp设置信号、环境变量和系统变量对应的默认控件 2007. HiRain Technologies. All rights reserved.Slide: 90对象窗口对象窗口p显示信号、环境变量和系统变量p直接拖拽变量到工作区生成控件 2007. HiRain Technologies. All rights reserved.Slide: 91工作区工作区p创建面板p支持同时编辑多个面板 20

45、07. HiRain Technologies. All rights reserved.Slide: 92控件窗口控件窗口p显示控件p双击在工作区产生控件 2007. HiRain Technologies. All rights reserved.Slide: 93控件属性窗口控件属性窗口p显示选中控件的相关设置p点击某项设置后会在下方 出现相关说明 2007. HiRain Technologies. All rights reserved.Slide: 94练习练习1I/O接口应用程序总线接口I/O接口应用程序总线接口影响 2007. HiRain Technologies. All rights reserved.Slide: 95练习练习2 2007. HiRain Technologies. All rights reserved.Slide: 96小提示小提示pMeasurement Setup窗口和Simulation Setup窗口是CANoe的主要窗口,进行数据流规划p几乎窗口中的所有对象均可通过点击鼠标右键来访问交互菜单p所有数据传输到评估模块时,均会在对应窗口以各自的方式进行显示,记录模块除外p配置文件可以保存CANoe中的所有设置;可以使用已有的配置文件作为新任务的基础,进行简单的修改形成新的配置,提高效率

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com