Why can't I receive the signal data normally when I use the CAN Receive block

2 vues (au cours des 30 derniers jours)
审言
审言 le 12 Août 2024
Réponse apportée : Sayan le 17 Sep 2024
These are my test configurations:
Results below:
Sample Time: 0.01
Fixed Step Discrete

Réponses (1)

Sayan
Sayan le 17 Sep 2024
Hi 审言,
I assume you are asking about the requirement of using an additional block i.e. "CAN Unpack" block with the "CAN Receive" block to read the received data. The "CAN Unpack" block is used for the following reasons:
  • The "CAN Receive" block receives raw CAN messages. It can not inherently understand or manipulate the data content within these messages. To use the received signals in Simulink the "CAN Unpack" block is used.
  • In the "CAN Unpack" the individual signal from the CAN messages are read with the functionality of selecting start bit, length , byte order etc which can be error-prone and complex if done manually.
  • A CAN message from "CAN Receive" can carry signals from multiple CAN message IDs. With the "CAN Unpack" block the the data for individual IDs can be read. You can refer to the following example model to understand more on its usage with multiple message IDs received from "CAN Receive" block: https://www.mathworks.com/help/vnt/ug/implement-can-network-for-robotic-arm-in-simulink.html
Hope this answers the query.

Produits


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by