configure CAN to send different IDs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

configure CAN to send different IDs

Jump to solution
772 Views
MaMM
Contributor III

Hi.

I'm trying to send different IDs thorugh the same CAN PORT in simulink (s32k39 board), and I cannot find how to assign different buffers to each ID. If I use the same configuration for different IDs thorugh CAN, I can read the messages but at double rate of the frequency I have selected.

For example, if I configure 100ms as base task time, and I add two simulink blocks to send CAN Messages, I can see on the USB to CAN tool both message but at 200 ms. If I use only one sending block, I can see 1 message at 100ms, so I suppose that another can_buffer must be used, but I cannot find where to change it.

An example of a .mdl with several ID configured thorugh the same port will be appreciatted.

Miguel.

Tags (1)
0 Kudos
Reply
1 Solution
755 Views
Adrian_Gherca
NXP Employee
NXP Employee

Hello,

Here are two methods to send out CAN messages with multiple IDs using the MBDT blocks:

First method:
1) In your configuration project (S32 Configuration Tool or EB tresos), under Can_43_FLEXCAN\CanConfigSet\CanHardwareObject, increase the value of Can Hw Object Count to the desired number of Tx messages:
Adrian_Gherca_2-1737387835414.png

2) In the Simulink model add the same number of Can_Write blocks, each block with a different value for the Pdu ID input:

Adrian_Gherca_3-1737388017462.png

Second method:
1) Make sure that multiple TRANSMIT objects exist in the configuration project under Can_43_FLEXCAN\CanConfigSet\CanHardwareObject. If necessary, press the "+" symbol and create more at the end of the list:

Adrian_Gherca_6-1737388568483.png

2) Select a different Hardware Object for each one of the Can_Write blocks:

Adrian_Gherca_7-1737390660109.png

 


 

 

 

 

 






View solution in original post

0 Kudos
Reply
2 Replies
742 Views
MaMM
Contributor III

Thanks a lot. Both solutions work perfectly.

Miguel.

0 Kudos
Reply
756 Views
Adrian_Gherca
NXP Employee
NXP Employee

Hello,

Here are two methods to send out CAN messages with multiple IDs using the MBDT blocks:

First method:
1) In your configuration project (S32 Configuration Tool or EB tresos), under Can_43_FLEXCAN\CanConfigSet\CanHardwareObject, increase the value of Can Hw Object Count to the desired number of Tx messages:
Adrian_Gherca_2-1737387835414.png

2) In the Simulink model add the same number of Can_Write blocks, each block with a different value for the Pdu ID input:

Adrian_Gherca_3-1737388017462.png

Second method:
1) Make sure that multiple TRANSMIT objects exist in the configuration project under Can_43_FLEXCAN\CanConfigSet\CanHardwareObject. If necessary, press the "+" symbol and create more at the end of the list:

Adrian_Gherca_6-1737388568483.png

2) Select a different Hardware Object for each one of the Can_Write blocks:

Adrian_Gherca_7-1737390660109.png

 


 

 

 

 

 






0 Kudos
Reply