Acceptance Filtering Ixxat USB-to-CAN V2 compact Dropping Legitimate Messages
ICanSocket2* pCanSocket
ICanChannel2* pCanChn;
[...]
// Open the first channel in non-exclusive mode
if (pCanSocket->CreateChannel(FALSE, &pCanChn) != VCI_OK)
{
ReleaseAll();
return;
}
// Initialize the channel
if (pCanChn->Initialize(2560, 2560, 0, CAN_FILTER_INCL) != VCI_OK)
{
ReleaseAll();
return;
}
// Set the acceptance filter
UINT32 code;
UINT32 mask;
// Example values
code = 2;
mask = 3;
// Shift by 1 because the filter for the ID starts at the 1st bit. The 0th bit is for RTR filtering.
UINT32 dwCode = code << 1;
UINT32 dwMask = mask << 1;
if (d_ptr_->pCanChn->SetAccFilter(CAN_FILTER_EXT, dwCode, dwMask) != VCI_OK)
{
ReleaseAll();
return;
}
// Activate the CAN channel
if (pCanChn->Activate() != VCI_OK)
{
ReleaseAll();
return;
}
Best regards,
-
正式评论
Hi Noah,
it's an interesting problem. I will try to reproduce it here. But I need some time for this and add then next week more information here.
Best regards,
Peter -
Hi Peter,
Thank you for taking on the problem. I look forward to your next post.
Best regards,
Noah
0 -
Hi Noah,
I try to reproduce it. But I did not see lost data with your filter settings, all messages are received.
I send 204800 messages at 1 MBit with nearly 100% bus load and incremented identifier. And there I get all 51200 expected messages.
Only when I use "printf" to write to the console I lose a lot of data because it's too slow.
I cannot add on this forum site the example. Maybe you create a support ticket, and I send you my demo source code there.
https://support.hms-networks.com/hc/en-us
Best regards,
Peter0 -
Hi Peter,
Thank you for your help. I have opened a ticket to receive your souce code.Best regards,
Noah
0
请先登录再写评论。
评论
4 条评论