如何使用“留言”功能使用消息 ID 检查不同 CAN 上特定消息可用性的事件
我正在 CANoe 中离线运行超过 15 个 CANS 的测量日志数据文件。我想在运行离线日志文件时检查来自不同 CAN 总线的特定 CAN 消息可用性。 我尝试使用“on Message *”事件,只执行一次,因为我想将该结果保存到文本文件中。 问题是每次执行其他条件时。 对于给定的问题有任何简单的解决方案吗?
谢谢
Variable
dword CANFD_01= 0x1A55549B
int MessageExecuted = 0;
dword readHandle = 0;
dword readHandle_01 = 0;
on start
{
setFilePath(path, 1);
readHandle = openFileWrite("Result.txt",0);
readHandle_01 = openFileWrite("Result_02.txt",0);
}
on message *
{
if(MessageExecuted == 1) return;
{
if(this.id == CANFD_01)
{
i = snprintf(buffer, elcount(buffer),"CANFD_01 is there \n");
filePutString(buffer, elcount(buffer), readHandle);
}
else
{
i = snprintf(buffer, elcount(buffer),"CANFD_01s not there with ID: %d\n",this.id);
filePutString(buffer, elcount(buffer), readHandle_01);
}
MessageExecuted = 1;
}
}
I am having measurement log data file offline running in CANoe with more than 15 CANS. I want to check the specific CAN message availability from different CAN bus while running the offline logfile.
I tried to use “on Message * “event, executing only once as I want to save that result in to text file.
Problem is every time its executing else condition.
Is there any easy solution for the given problem?
Thank you
Variable
dword CANFD_01= 0x1A55549B
int MessageExecuted = 0;
dword readHandle = 0;
dword readHandle_01 = 0;
on start
{
setFilePath(path, 1);
readHandle = openFileWrite("Result.txt",0);
readHandle_01 = openFileWrite("Result_02.txt",0);
}
on message *
{
if(MessageExecuted == 1) return;
{
if(this.id == CANFD_01)
{
i = snprintf(buffer, elcount(buffer),"CANFD_01 is there \n");
filePutString(buffer, elcount(buffer), readHandle);
}
else
{
i = snprintf(buffer, elcount(buffer),"CANFD_01s not there with ID: %d\n",this.id);
filePutString(buffer, elcount(buffer), readHandle_01);
}
MessageExecuted = 1;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想要确认 15 个不同 CAN 网络中的特定帧 ID。以下内容对您有用吗?
You want to confirm a specific frame ID across 15 different CAN networks. Does the following work for you?