当前位置:网站首页>零基础学习CANoe Panel(8)—— 数据/文本编辑控件(Hex/Text Editor )
零基础学习CANoe Panel(8)—— 数据/文本编辑控件(Hex/Text Editor )
2022-07-24 10:41:00 【蚂蚁小兵】
- 我是蚂蚁小兵,专注于车载诊断领域,尤其擅长于对CANoe工具的使用
- 寻找组织 ,答疑解惑,摸鱼聊天,博客源码,点击加入【相亲相爱一家人】
- 零基础学习CANoe Panel设计目录汇总,点击跳转
前言
- 相比
Input/Output Box,Hex/Text Editor可以用来显示更多的数据,主要用来显示byte/int数组类型,也可以用来显示string - 演示软硬件环境
Windows11 x64;CANoe 11 SP2 x64
目录

数据/文本编辑控件(Hex/Text Editor )
- Hex/Text Editor 控件支持的数据类型有string 和数组。


控件显示布局(Editor Layout )
symbol类型是Data(byte arrary)
1️⃣ 如果Editor 绑定的symbol类型是Data,则Editor Layout属性我们可以只选择only Hex Field
- 而且设置的时候,我们还应该根据我们每行想要显示的字节数来设置(
Columns/Letter per Line),比如标准CAN报文 我们可以设置为8,正好可以显示一整条报文 - 两个字节之间自动通过
空格间隔

2️⃣ 我们简单模拟下实时刷新某条报文
/*@!Encoding:936*/
variables
{
byte ByteData[16];
int i ;
msTimer timer_demo;
}
on key 'a'
{
setTimer(timer_demo,1000);
}
on timer timer_demo
{
for(i=0;i<elcount(ByteData);i++)
ByteData[i]= random(0xFF);
sysSetVariableData (sysvar::Panel::Editor_ByteArrary,ByteData,elcount(ByteData));
setTimer(timer_demo,1000);
}
3️⃣ 运行CANoe ,按下按键‘a’,panel 周期刷新数据。

symbol类型是Int arrary
1️⃣ 如果绑定的symbol的数据类型是Int Arrary
- 则Editor 控件每行只能显示一个 整形数(占4个字节,且通过空格隔开),且是16进制显示的。
Columns/Letter per Line属性这个时候就不能在设置了,固定死了

2️⃣ 下图代码是系统变量Editor_IntArrary赋值,
- 重点,代码中定义的临时
变量IntArrary数组的大小一定和系统变量Editor_IntArrary定义的数组大小一致,否则设置不成功的。
/*@!Encoding:936*/
on key 'b'
{
IntArrary[0]= 0x11111111;
IntArrary[1]= 0x22222222;
IntArrary[2]= 0x33333333;
IntArrary[3]= 0x44444444;
sysSetVariableLongArray (sysvar::Panel::Editor_IntArrary,IntArrary,elcount(IntArrary));
}
3️⃣ 运行CANoe 按下按键‘b’,显示结果如下:

symbol类型是string
1️⃣ 如果绑定的symbol的数据类型是string,则Editor Layout属性可以只选择Only Text Filed
- 我们可以用Editor 控件来实时显示我们的测试过程的log信息,下面我们把读取到的DTC 信息显示在Panel中。
- 注意这个控件只支持英文输出,且不会自动换行,需要指定每行多少个字节(
Columns/Letter per Line)
2️⃣ 一段小代码演示下 symbol类型是string,editor控件的显示效果
- 需要严格按照(
Columns/Letter per Line )设置的每行字节数来格式输出。否则无法像图中的那样有格式
/*@!Encoding:936*/
on key 'c'
{
char tempText[0x500];
int i;
dword DTC[3] = {
0xD08998,0xD01123,0xD05695};
char Descriable[3][20]={
"Power High","Power Lower","Crc Error"};
byte Status[3] = {
0x09,0x2B,0x2F};
// 类似于表格头
snprintf(tempText,elCount(tempText),"%8s%16s%12s","DTC","Descriable","Status");
for(i=0;i<3;i++)
{
snprintf(tempText,elCount(tempText),"%s%8X%16s%12X",tempText,DTC[i],Descriable[i],Status[i]);
}
sysSetVariableString (sysvar::Panel::Editor_String,tempText);
}
3️⃣ 运行CANoe 按下按键‘b’,显示结果如下:


总结


- 要有最朴素的生活,最遥远的梦想,即使明天天寒地冻,路遥马亡!
- 如果这篇博客对你有帮助,请 “点赞” “评论”“收藏”一键三连 哦!码字不易,大家的支持就是我坚持下去的动力。
边栏推荐
- Will not be rejected! Learn the distributed architecture notes sorted out by Alibaba Daniel in 35 days, with a salary increase of 20K
- Partition data 1
- Differential restraint system -- 1 and 2 -- May 27, 2022
- Figure model 2-2022-5-13
- Real time weather API
- CMS vulnerability recurrence - ultra vires vulnerability
- PC Museum (1) 1970 datapoint 2000
- 谷歌联合高校研发通用模型ProteoGAN,可设计生成具有新功能的蛋白质
- Erlang学习01
- binlog、iptables防止nmap扫描、xtrabackup全量+增量备份以及redlog和binlog两者的关系
猜你喜欢

App automation and simple environment construction

zoj-Swordfish-2022-5-6

5个最佳WordPress广告插件

Figure model 2-2022-5-13

After the QT program minimizes the tray, a msgbox pops up. Click OK and the program exits. The problem is solved

MySQL - 唯一索引

Sentinel 三种流控模式

Volcanic engine: open ByteDance, the same AI infrastructure, a system to solve multiple training tasks

MySQL - 多列索引

Sentinel flow control quick start
随机推荐
Overview of basic knowledge of binary tree
SQL Server 2012 download and installation detailed tutorial
App automation and simple environment construction
[correcting Hongming] what? I forgot to take the "math required course"!
ZOJ 2770 differential restraint system -- 2 -- May 20, 2022
js函数调用下载文件链接
[carving master learning programming] Arduino hands-on (59) - RS232 to TTL serial port module
Machine learning quiz (10) using QT and tensorflow to create cnn/fnn test environment
第五章 修改实现(IMPL)类
MySQL - normal index
Erlang learning 01
UVM——双向通信
机器学习小试(10)使用Qt与Tensorflow创建CNN/FNN测试环境
PC博物馆(1) 1970年 Datapoint 2000
Sentinel 三种流控模式
Differential restraint system -- 1 and 2 -- May 27, 2022
Volcanic engine: open ByteDance, the same AI infrastructure, a system to solve multiple training tasks
MySQL - update data records in tables
MySQL - 全文索引
[personal summary] end of July 17, 2022
