当前位置:网站首页>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 ~
![]()

边栏推荐
- High concurrency day02 (concurrent package)
- 爬虫基础—代理的基本原理
- shader入门之基础光照知识
- Slackware 14.2 installing KDE 5 plasma
- Summary of Statistics for Interview
- Sword finger offer question brushing record - offer 05 Replace spaces
- SSM整合
- Network knowledge-03 data link layer PPP
- 实操教程:CANoe在CAN总线测试中的应用
- I heard that today's blog can get a badge!
猜你喜欢

网络知识-02 物理层

Paper reading: deep residual shrink networks for fault diagnosis

MySql

组件emit基础

Pytorch learning notes (I)

Fundamentals of crawler - basic principles of agent

用for循环怎么输出数字菱形啊

CAN FD如何应用Vector诊断工具链?

Fundamentals of crawlers - basic principles of multithreading and multiprocessing

Network knowledge-03 data link layer Ethernet
随机推荐
Arrayslist method
Paper reading: deep residual learning in spiking neural networks
爬虫基础—Session和Cookie
Summary of Statistics for Interview
M based on the MIMO channel capacity analysis of MATLAB, different antenna numbers are compared; Non codebook precoding SVD, GMD; Codebook precoding DFT, TXAA and spatial diversity
Fundamentals of crawler - basic principles of agent
WCDMA soft handoff performance matlab simulation m, comparing the average number of activation sets (MasN), activation set update rate (Asur) and call interruption probability (OP) three performance i
Network knowledge-03 data link layer PPP
Matlab simulation of cognitive femtocell performance in m3gpp LTE communication network
Matlab implementation code of image denoising method based on Hidden Markov tree model in wavelet domain
爬虫基础—代理的基本原理
Network knowledge-02 physical layer
Review - 5703 Statistical Inference and Modeling
网络知识-04 网络层-ICMP协议
深度学习笔记 Coursera Deep learning Notes
I heard that today's blog can get a badge!
How to output a digital diamond with a for loop
MySql
一文带你了解SOA接口测试
High concurrency day02 (concurrent package)