当前位置:网站首页>The replay block of canoe still needs to be combined with CAPL script to make it clear
The replay block of canoe still needs to be combined with CAPL script to make it clear
2022-07-06 09:48:00 【Ant soldier】
Related articles
Learn from scratch CANoe A summary of the contents of the series of articles , Click the jump
This chapter demonstrates the source code download , Click the jump
Preface
Trace logging
Documents are important data for us to analyze problems , I said that before ,CANoe
There are many analysis tools , whatdata
,graphics
etc. , But the most convenient way to analyze problems in daily work isTrace
.But when playing back the match online , It is not possible to play back the selected file directly , You also need to filter the files as necessary
The whole network feels that this knowledge point is taking notes , There is no union CAPL And the actual project , But I think this is very necessary
Demonstrate hardware and software environment Win10 x64 ; CANoe 11 SP2 x64
This chapter demonstrates the source code download , Click the jump
Catalog
First record a paragraph Trace spare
1️⃣ Create project first , And then create a logging block, Let's record a segment first logging file
- Here, select the button to trigger to start recording
- Recording file format selection blf Format , This format is better than ASC Format saves memory
2️⃣ Press down ‘t ’ Start recording , Almost recorded 3 minute , Press again ‘t’ Stop recording
offline mode load logging File analysis `trace( Fast mode )
1️⃣ We have recorded above logging , So let's see how to use this logging To analyze the problem
- Method 1 : Directly press and hold the file and drag it Trace Inside , It will be loaded soon , The most convenient and fast , Recommended use
2️⃣ By hitting offline mode
, Then drag the file into the selection box , Then press Start
Button , It will also be loaded soon , It takes so much time , And drag directly to Trace
What's the difference between
- adopt
offline mode
Dialog box , You can select multiple files to play back at the same time - See that
step
The button is not , There is also a time input box behind , What does that mean , Namely , If I don't want to read it all at once , I want to read first 5ms The data of , It's over , I press againstep
, It loads again 5s The data of . Get it. , According to the time you set , Every time you press step, Just load how much data - The default unit of time frame ms , You can write h, m, s, To represent hours , minute , second , such as 1s, You can Write 1s
Data playback (Replay Block)( Slow mode )
The default configuration ,Run 了 CANoe It triggers Replay Block
1️⃣ Here's the picture ,Replay Block
It's a node , Here we shield all other nodes , Create a Replay Block
node
2️⃣ Here we choose directly logging file , Don't configure others
3️⃣ direct Start , Let's take a look at Run 了 156s, Trace It stopped.
- Why above 156s It stops , Because we record Trcae Just 156s , When you play back , The timestamp starts from zero .
- And the default choice is logging The file is played back only once , You can choose loop playback
Manual trigger Replay Block
Start Option
Don't checkStart replay on measurement start
- Want to trigger Replay , Need to click
Start
Just press the key
Key trigger Replay Block
Repeat playback Replay
- Repeat playback Replay
Filter channel (Channel Mapping)
- The following figure is based on reality ECU, double CAN A section of channel test Trace Screenshot , Playback select two channels
、
- The following figure is based on reality ECU, double CAN A section of channel test Trace Screenshot , Playback all options CAN1 passageway
RX/TX Filter (CAN Option)
- With CAN Bus as an example , Other bus references help file
- No matter recording Trace when , At each node RX still TX; Playback of Trace All are TX
- If you check the RX message , Only the data of the real node is played back , That is to say, recording Trace At the time of the TX Node data is filtered
- If you check the TX message , The data of real nodes and simulation nodes will be played back , That is to say TX message Is to playback all the data
CAPL Script triggers Replay
- The following script is to control Replay Start , Stop several functions , In actual engineering projects , Basically all through CAPL Script control
Replay
To complete the test task
/*@!Encoding:936*/
variables
{
char replayName[32] = "ReplayBlock 1";
}
on key 'b'
{
replayStart( replayName);
writeReplayState( replayName);
}
on key 'e'
{
replayStop( replayName);
writeReplayState( replayName);
}
on key 's'
{
replaySuspend( replayName);
writeReplayState( replayName);
}
on key 'r'
{
replayResume( replayName);
writeReplayState( replayName);
}
void writeReplayState( char name[])
{
switch ( replayState( name))
{
case 0:
write( "Replay Block %s is stopped", replayName);
break;
case 1:
write( "Replay Block %s is running", replayName);
break;
case 2:
write( "Replay Block %s is suspended", replayName);
break;
default:
write( "Error: Replay Block %s has an unknown state!", replayName);
break;
};
}
Node filtering during data playback
- In actual projects , Whether it's the data from the vehicle test or not , Or bench test data , All need data cleaning to be used for playback and analysis , The functions described above are not enough , Even rarely used
- The data from the vehicle test will definitely contain the target ECU Of , Playback process , We have to kick the target ECU The data of , There are roughly two common methods ,
- One is if ASC Formatted data (blf It can also be changed to ASC), Yes, you can use scripts (Python /c++ etc. ) Clean the file , The specific project has realized
- The other is when replaying messages , Record another message , Add filter nodes during recording , The following code demonstrates this method
1, Here's the picture , We created Logging Block
And join in Event Filter
2, Here's the picture , This Trace There are only two nodes in total (Light and Engine), Then we'll put Engine Node data is filtered
3, Here's the picture , Let's configure logging Trigger mode , For the sake of unity Replay Block and Logging Block And stop at the same time , Let's write a little CAPL Timing under script control , In fact, this is also the general practice in actual engineering projects ( Simplify the code here , Tell the core logic )
4, Here's the picture , By pressing the key ‘h’
/*@!Encoding:936*/
variables
{
char replayName[32] = "ReplayBlock 1";
char loggingName[32] = "Logging";
msTimer ReplayState ;
}
on timer ReplayState
{
if(replayState(replayName) == 0)//replay end
{
stopLogging(loggingName);// stop it logging
}
else
{
setTimer(ReplayState,100); //100ms
}
}
on key 'h'
{
replayStart( replayName); // Start playback
setTimer(ReplayState,100); //100ms
startLogging(loggingName); // Start recording
}
5, Run After starting the project , Press the button ‘h’, And then wait Run complete , See the recorded logging -2022xxx file . Drag directly to Trace in , See we put Engine Node messages are filtered out , Then this message , Can be used for our Replay Block
Logging File Type conversion
- blf File format , It takes up a small amount of memory but cannot be used txt open , You can't use scripts to parse
- asc File format , Large memory consumption , But you can use txt Open it directly , Then delete or change some node data of the file as required
- CANoe You can directly logging File format conversion
End |
summary
- Have the most simple life , The furthest dream , Even if it's freezing tomorrow , Lu Yao's horse died !
- Wechat partners can pay attention Langge on-board diagnosis , A small circle in the industry , In the group
SkyDrive data
,Source code
,There are all kinds of gods
Free time communication technology , Talk about job opportunities .- If this blog is helpful to you , please “ give the thumbs-up ” “ Comment on ”“ Collection ” One key, three links Oh ! It's not easy to code words , Everyone's support is my driving force to stick to it .
边栏推荐
- 英雄联盟轮播图自动轮播
- 嵌入式中的合作开发--函数指针
- Design and implementation of online shopping system based on Web (attached: source code paper SQL file)
- 五月集训总结——来自阿光
- Combined search /dfs solution - leetcode daily question - number of 1020 enclaves
- leetcode-14. Longest common prefix JS longitudinal scanning method
- 018.有效的回文
- 《ASP.NET Core 6框架揭秘》样章发布[200页/5章]
- 小白带你重游Spark生态圈!
- YARN组织架构
猜你喜欢
MapReduce instance (VI): inverted index
[NLP] bert4vec: a sentence vector generation tool based on pre training
【深度学习】语义分割:论文阅读:(CVPR 2022) MPViT(CNN+Transformer):用于密集预测的多路径视觉Transformer
大学想要选择学习自动化专业,可以看什么书去提前了解?
Nc17 longest palindrome substring
[deep learning] semantic segmentation - source code summary
Design and implementation of film and television creation forum based on b/s (attached: source code paper SQL file project deployment tutorial)
Lua script of redis
为拿 Offer,“闭关修炼,相信努力必成大器
Publish and subscribe to redis
随机推荐
I2C summary (single host and multi host)
Webrtc blog reference:
大学C语言入门到底怎么学才可以走捷径
英雄联盟轮播图自动轮播
MapReduce working mechanism
Selection of software load balancing and hardware load balancing
Solve the problem of too many small files
Oom happened. Do you know the reason and how to solve it?
Hero League rotation map automatic rotation
竞赛vscode配置指南
《ASP.NET Core 6框架揭秘》样章发布[200页/5章]
[deep learning] semantic segmentation: thesis reading (neurips 2021) maskformer: per pixel classification is not all you need
Global and Chinese markets for modular storage area network (SAN) solutions 2022-2028: Research Report on technology, participants, trends, market size and share
Day 5 of MySQL learning
软件负载均衡和硬件负载均衡的选择
为什么要数据分层
018. Valid palindromes
CANoe下载地址以及CAN Demo 16的下载与激活,并附录所有CANoe软件版本
MapReduce instance (V): secondary sorting
有软件负载均衡,也有硬件负载均衡,选择哪个?