In Simulink, How to decode CAN data with length greater than 8?

2 ビュー (過去 30 日間)
Wei
Wei 2024 年 8 月 16 日
編集済み: akshatsood 2024 年 8 月 17 日
There is an issue using CAN Unpack to decode CAN message with length greater than 8. Is there any other recommanded way to decode CAN data? For starter, I have used bit extract and bitwise AND Shift Arithmetic to extract bits in simulink. I'm not sure if matlab function in simulink can also handle this if it's possible.

採用された回答

akshatsood
akshatsood 2024 年 8 月 16 日
Dear @Wei
I understand that you want to decode CAN data with a length greater than 8. In my understanding, you can substitute the "CAN Unpack" block with the "CAN FD Unpack" block. CAN FD (Flexible Datarate) is an extension of the original CAN protocol, designed to support higher data rates and larger data payloads. For more information about this block, please visit the following documentation.
I hop this helps.
  2 件のコメント
Wei
Wei 2024 年 8 月 16 日
Using "CAN FD Unpack" can work with constrainted length. That is, '0' to '8', '12', '16', '20', '24', '32', '48', '64'. However, with multi-package CAN data information, the length is an unknown value, which mean it could be a length that is outside of the values allowed in CAN FD Unpack.
Thanks.
akshatsood
akshatsood 2024 年 8 月 17 日
編集済み: akshatsood 2024 年 8 月 17 日
Dear @Wei,
It sounds like you are dealing with a situation where the CAN data length is variable and may not fit within the constraints of standard CAN FD lengths. In such cases, handling multi-frame messages can be a bit complex, as it requires assembling and disassembling messages across multiple CAN frames.
Achieving this in Simulink typically involves designing a model that handles the segmentation and reassembly of messages. The model comprises of Stateflow and MATLAB Function blocks to define the logic of protocol.
You can define states for handling different parts of protocol, such as start of the message, continuation and end of the message. MATLAB Function blocks can be used to implement segmentation and reassembling.
I hope this provides some direction.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVehicle Network Toolbox についてさらに検索

タグ

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by