CAN Filter Changes on the Fly.

Use this section to discuss your embedded Flowcode projects.
Post Reply
jay_dee
Posts: 164
http://meble-kuchenne.info.pl
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 63 times
Been thanked: 46 times

CAN Filter Changes on the Fly.

Post 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.
Attachments
CANRx0_V4-1.fcm
(8.7 KiB) Downloaded 125 times

BenR
Matrix Staff
Posts: 1909
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 494 times
Been thanked: 672 times

Re: CAN Filter Changes on the Fly.

Post 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.

jay_dee
Posts: 164
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 63 times
Been thanked: 46 times

Re: CAN Filter Changes on the Fly.

Post 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.

Post Reply