configure CAN to send different IDs

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

configure CAN to send different IDs

跳至解决方案
765 次查看
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.

标记 (1)
0 项奖励
回复
1 解答
748 次查看
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 项奖励
回复
2 回复数
735 次查看
MaMM
Contributor III

Thanks a lot. Both solutions work perfectly.

Miguel.

0 项奖励
回复
749 次查看
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 项奖励
回复