Page 1 of 1

CAN Filter Changes on the Fly.

Posted: Fri Oct 11, 2024 10:50 am
by jay_dee
Hi,
To ensure I capture the latest CAN data from a fast and busy datastream, I am setting the Mask to check all bits (2047) and Filter for a specific single ID,
Then progmaticaly changing the filter value and stepping through the three message ID's I require.
It seems a bit cumbersome but I cleanly get all messages updated.
(I can already see that with my method if one messge stopped being transmitted the system would brick, but i can add a work around for this)

Question: When I set the RX Filter (SetRxFilter 0), does this clear the RX buffer of old data?
Or should I also check the Rx Buffer first, as I believe this will clear the RX buffer.

CAN Macro is attached.
Thansk, j.

Re: CAN Filter Changes on the Fly.

Posted: Tue Nov 26, 2024 10:54 am
by BenR
Hello,

Sorry for the delay in getting back to you.

Changing the RxFilter will not remove any already received messages from the buffer.

Re: CAN Filter Changes on the Fly.

Posted: Tue Nov 26, 2024 12:46 pm
by jay_dee
Thanks Ben,
Are you aware of any command that will flush the buffer?
Does the Check RX buffer command? I have no real idea but I thought it may read the hardware buffer (MCP2515/ECAN) into a local FC macro software buffer?
J.