How to reset a received CAN receive or unpack block

1 view (last 30 days)
the CAN receive/unpack block stores the last value until it receives a new one. i need to reset or clear the same once its processed. i need to understand whether data available is from a new received frame or from the old one. other than using the timestamp is there another means to do so???

Answers (1)

Snehal
Snehal on 20 Jun 2025
Hi @Asha,
I see that you are using the CAN receive/unpack blocks in Simulink R2025a and want to understand if the data available is old or recent without using the message timestamp.
You can enable the ‘Output status option from the ‘Output ports parameter of the CAN receive/unpack block to check if the data available in that block is from a new received frame or from the old one. This parameter outputs the message received status: status is 1 if the block receives a new message and 0 if it does not. A new output port (‘status’) is added to the block once this option is enabled.
Additionally, here are some important points to consider:
  1. Avoid relying on just data change checks when tracking if the available data is new or old since values can repeat across messages
  2. Unless necessary, resetting the CAN receive/unpack data manually is not suggested
Refer to the following documentation links for further details:
Hope this helps!

Products


Release

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!