当前位置:网站首页>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 .
边栏推荐
- MapReduce工作机制
- CANoe仿真功能之自动化序列(Automation Sequences )
- CAPL脚本中关于相对路径/绝对路径操作的几个傻傻分不清的内置函数
- [one click] it only takes 30s to build a blog with one click - QT graphical tool
- Mapreduce实例(九):Reduce端join
- MySQL数据库优化的几种方式(笔面试必问)
- May brush question 27 - figure
- Day 5 of MySQL learning
- Segmentation sémantique de l'apprentissage profond - résumé du code source
- MapReduce working mechanism
猜你喜欢
Oom happened. Do you know the reason and how to solve it?
MapReduce instance (V): secondary sorting
Mapreduce实例(四):自然排序
面渣逆袭:Redis连环五十二问,图文详解,这下面试稳了
MapReduce instance (IV): natural sorting
【深度學習】語義分割-源代碼匯總
在CANoe中通过Panel面板控制Test Module 运行(初级)
面试突击62:group by 有哪些注意事项?
leetcode-14. Longest common prefix JS longitudinal scanning method
Keep these four requirements in mind when learning single chip microcomputer with zero foundation and avoid detours
随机推荐
[one click] it only takes 30s to build a blog with one click - QT graphical tool
O & M, let go of monitoring - let go of yourself
五月刷题27——图
《ASP.NET Core 6框架揭秘》样章发布[200页/5章]
May brush question 01 - array
MapReduce instance (VIII): Map end join
[flask] crud addition and query operation of data
Use of activiti7 workflow
Cooperative development in embedded -- function pointer
[Yu Yue education] reference materials of complex variable function and integral transformation of Shenyang University of Technology
Mapreduce实例(六):倒排索引
Programmation défensive en langage C dans le développement intégré
C#/. Net phase VI 01C Foundation_ 01: running environment, process of creating new C program, strict case sensitivity, meaning of class library
Hero League rotation map automatic rotation
MapReduce instance (IX): reduce end join
Teach you how to write the first MCU program hand in hand
Research and implementation of hospital management inpatient system based on b/s (attached: source code paper SQL file)
Design and implementation of online shopping system based on Web (attached: source code paper SQL file)
嵌入式開發中的防禦性C語言編程
Une grande vague d'attaques à la source ouverte