当前位置:网站首页>Practical tutorial: application of canoe in CAN bus test
Practical tutorial: application of canoe in CAN bus test
2022-07-19 07:38:00 【Yixing Technology】
With new energy 、 Development of concepts such as intelligent networking , vehicle CAN The bus environment becomes complex and chaotic ,CAN Unstable node quality will pose a great threat to the OEMs , therefore CAN Bus testing has become a guarantee CAN An important means of network security operation .

and CANoe As a network simulation that supports multiple buses 、 test 、 The diagnosis 、 And analytical tools , Its rich and diverse functions and configuration options are recognized worldwide 90% The above OEM And suppliers . today , Let's have a chat with you ,CANoe stay CAN Application in bus test .
01
CANoe Function is introduced
stay CANoe in ,Test As one of its main functions , Occupy a functional area alone , from Test Units and Test Modules Two measuring components .
Test Units Need to be in Test Configuration Window , coordination vTESTStudio Use , Use its graphical interface to create test cases , At the same time, it can cooperate with CAPL perhaps C# Code implementation automated testing , We will not introduce too much in this article .
Test Modules You have in Test Setup for Test Module Window .CANoe Support test modules in three different language formats :CAPL、XML and .NET. Users can choose their familiar language to edit the test module according to their own needs .

Test Modules It is the execution unit for testing . Test module from test execution to test result generation , Finally, it can be presented by a test report . The test module includes several test cases (Test Case), Test cases are the core of testing , Include all testing activities . These test activities consist of test steps (Test Step) form , The test steps are relatively small test blocks in the test module , It is used to indicate the test point to which the test sequence is currently executed .

02
CANoe Operation process
Now let's CAPL Test Module As an example, briefly introduce the creation process of the test project .
▷ stay CANoe Select... From the main interface 【Test】→【Test Setup】, open TestSetup for Test Modules window , You can configure a custom test module .
▷ stay Test Setup for Test Modules window , In the blanks single click Right mouse button And select from the menu 【New Test Environment】, You can create a new test environment .

▷ Right click 【Test Environment】, choice 【Insert CAPL Test Module】 To insert one CAPL Test module , The default test module name is Test 1.

▷ mouse Right click New test module Test 1, choice 【Configuration】, open CAPL Test Module Configuration Dialog box . stay Common tab in , You can modify 【Module name】, And in 【Test script】 Add the prepared .can file .

![]()
thus , The test module has been configured , Double click the test module to open it CAPL Test module window .
The configuration of the test project is relatively simple , But the focus of automated test engineering is to add .can How to write a document .
.can The file is for CAPL language-written ,CAPL yes Vector The company specializes in CANoe Programming language for development environment design , Grammatically and conceptually with C Language is similar to . about CAN For bus testing , and CANoe Matching ,Vector The company provides a more comprehensive 、 Professional ECU Testing tools , Including physical layer and data link layer tests . If available CANscope and VH6501 And other tools to verify the node in the circuit design 、 Physical level performance , And the consistency of communication parameters .
03
CANoe stay CAN Application in
Next, let's briefly introduce our work in CAN Some use cases that will be executed in bus testing .
01 Physical layer test
stay CAN Bus physical layer test , We usually test the terminal resistance 、 High and low voltage communication range 、 Explicit and implicit voltage, etc . And test the terminal resistance and high and low voltage communication range , We will use multimeter and programmable power supply .
CANoe Provides RS232 Communication related API, Therefore, we can cooperate with the instructions of multimeter and program-controlled power supply , Develop a set of CANoe, It can pass through a series of functions , Realize the measurement of terminal resistance and the automatic setting of high and low power supply voltage , So as to achieve the purpose of automated testing . For the test of explicit and implicit voltage , We will use CANscope.CANoe It has customized a series of control and measurement API, It can directly measure the explicit and implicit voltage .
More physical layer related tests will not be introduced one by one , What is intercepted in the picture is help Some of the API For your reference .


02 Data link layer test
For data link layer testing , We usually test bit time 、 Sampling point and message DLC and ID etc. .
Bit time is also used Scope To complete , The sampling point uses VH6501 To complete . In our previous article, we introduced how to test sampling points , In the process of writing automated test scripts , In fact, it quotes CANoe The script in the example project , Interested readers can look at the previous article Bus interference artifact ——VH6501, Or from CANoe Check the script logic in the example project of .CANoe For the same VH6501 Integrated a series of API, Can be obtained from help Document view .

03 automated testing
as for CANoe Automatic test system , I have to introduce its two functions ,Test Feature Set(TFS) and Test Service Library(TSL).
TFS yes CANoe Extended series of test functions , Including constraint and condition setting functions 、 Signal test function 、 Wait for the indicator function 、 Test the control function 、 Test report function and so on .
and TSL Is in TFS Based on the basic function , Provide some special functions , For example, detection function 、 Status report function 、 And detect control functions, etc , It can efficiently solve some special testing problems , For example, the message mentioned above ID and DLC Test of . These two function category functions can be passed help Check the usage of specific functions contained in the document .


stay CAPL Test Module in ,.can After the test cases in the document are written , need Construct a test execution function ,CANoe When actually running the test project , Test according to the content and order of the test execution function , And generate the corresponding test report .
![]()

After the test is completed ,CANoe Test reports will be generated automatically , By clicking 【OpenTest Report】 Button to view the report .CANoe The test report generated by the test module of has the following two formats .
1. CANoe Test Report Viewer( Recommended format ): Use CANoe The test report viewer can more intuitively view and search the content of the test report . It provides a filter 、 grouping 、 Functions such as navigation and user-defined views , It is more convenient to view the test report , Analyzing test results is more professional ;
2. XML/HTML Format ( Previous formats ): This format is more general , Even if not installed CANoe Users of can also directly view , So this format has strong versatility .
Users can go to CANoe Select... From the main interface 【File】→【Options】 Get into Options Dialog box , adopt 【General】→【Test Feature Set】→【Reporting File Format】 Choose the appropriate report format .
![]()

After the test execution is complete , Users can view saved log data , You can verify the correctness of the test results .
The above is what we share with you CANoe stay CAN Application in bus test , Any questions or automated test requirements , You can contact us at any time , Thanks for reading ~
![]()

边栏推荐
- Network knowledge-04 network layer ICMP Protocol
- Typescript (TS loader, tsconfig.json and lodash)
- 听说今天发博客能领徽章!
- Paper reading: deep residual shrink networks for fault diagnosis
- High concurrency day02 (concurrent package)
- 网络知识-03 数据链路层-以太网
- 用for循环怎么输出数字菱形啊
- Network knowledge-05 transport layer UDP
- 组件emit基础
- Servlet notes
猜你喜欢

Typescript (I)

2021-10-25 浏览器兼容遇到的问题

Review of 4246 Algorithms for Data Science

M analysis of anti-interference performance of high-speed frequency hopping communication system based on Simulink

Edit close automatically generate configuration file when saving

HMI概念设计的未来在哪里?

MySQL正则表达式^和$用法

Network knowledge-04 network layer ICMP Protocol

Review of Linear Algebra

爬虫基础—爬虫的基本原理
随机推荐
网络知识-02 物理层
AB Testing Review
Pytorch learning diary (III)
JS does not use async/await to solve the problem of data asynchrony / synchronization
Prevent blackmail attacks through data encryption schemes
Maxwell简介&使用
Product Case Interviews
Review of 4705 NLP
Download, configuration and basic use of C language compiler
Network knowledge-05 transport layer TCP
网络知识-03 数据链路层-PPPoE
Classes and objects
Redis(二) - Jedis
MySql
MySql02 函数substr mod 视图view
Network knowledge-02 physical layer
Review of Linear Algebra
How to output a digital diamond with a for loop
Review - 5703 Statistical Inference and Modeling
Nanny level one-stop service - self correlation to construct parent-child relationship (@jsonbackreference and @jsonmanagedreference solve circular dependency)