当前位置:网站首页>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 .
边栏推荐
- Listen to my advice and learn according to this embedded curriculum content and curriculum system
- If a university wants to choose to study automation, what books can it read in advance?
- Mapreduce实例(八):Map端join
- A wave of open source notebooks is coming
- Full stack development of quartz distributed timed task scheduling cluster
- 018.有效的回文
- [NLP] bert4vec: a sentence vector generation tool based on pre training
- Leetcode:608 树节点
- 英雄联盟轮播图自动轮播
- Yarn organizational structure
猜你喜欢
CAPL脚本中关于相对路径/绝对路径操作的几个傻傻分不清的内置函数
Nc17 longest palindrome substring
[deep learning] semantic segmentation: paper reading: (2021-12) mask2former
[CV] target detection: derivation of common terms and map evaluation indicators
工作流—activiti7环境搭建
大学C语言入门到底怎么学才可以走捷径
一大波開源小抄來襲
Design and implementation of film and television creation forum based on b/s (attached: source code paper SQL file project deployment tutorial)
机械工程师和电气工程师方向哪个前景比较好?
max-flow min-cut
随机推荐
CANoe CAPL文件操作目录合集
June brush question 02 - string
CAPL 脚本打印函数 write ,writeEx ,writeLineEx ,writeToLog ,writeToLogEx ,writeDbgLevel 你真的分的清楚什么情况下用哪个吗?
面试突击62:group by 有哪些注意事项?
有软件负载均衡,也有硬件负载均衡,选择哪个?
Global and Chinese markets for hardware based encryption 2022-2028: Research Report on technology, participants, trends, market size and share
Leetcode:608 树节点
Design and implementation of online shopping system based on Web (attached: source code paper SQL file)
Hard core! One configuration center for 8 classes!
MapReduce instance (x): chainmapreduce
机械工程师和电气工程师方向哪个前景比较好?
33岁可以学PLC吗
May brush question 27 - figure
五月刷题27——图
018.有效的回文
五月刷题26——并查集
CAPL 脚本对.ini 配置文件的高阶操作
硬件工程师的真实前途我说出来可能你们不信
Une grande vague d'attaques à la source ouverte
小白带你重游Spark生态圈!