Skip to main content
RGalvez
Associate
November 10, 2020
Question

Problem with CAN_Read block and CAN Unpack Simulink block

  • November 10, 2020
  • 0 replies
  • 1417 views

Hi everyone,

I'm having compatibility problems with the CAN_Read block from STM32 library and the CAN Unpack from Embedded Coder Simulink library. I need to use CAN_MESSAGE MATLAB type for working with .dbc format.

The IDE field on the rxHeader is set at 4 by the CAN_Read block, while the CAN Extended flag from the CAN Unpack expects 1U when it evaluates the condition for unpacking the received message.

0693W000005Au5WQAS.png 

This code is generated by these blocks:

0693W000005AuCwQAK.png 

I came up with a solution by selecting raw data output from CAN_Read, packing the message and unpacking again with the desired .dbc as in the following example.

0693W000005AuEOQA0.pngThis solves the problem because the unpack resolves conditions according to the packed message with the raw data.

However I assume that the CAN_Read plus direct CAN Unpack generated code isn't meant to be like that. Is there any solution which not imply to use redundant block as the CAN Pack?

Best regards,

Ruben

This topic has been closed for replies.