How to configure a given mailbox for multiple CAN message IDs on a TI C2000 device?

조회 수: 7 (최근 30일)
How to configure a given mailbox for multiple CAN message IDs on a TI C2000 device?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2021년 3월 15일
The C28x eCAN Transmit and Receive blocks contain an init callback function in the block properties as shown below:  
The init callback function in the C28x eCAN transmit and receive block performs the validation of the mailbox to check if only one CAN message identifier is configured for each mailbox. If more than one CAN message identifier is configured for the same mailbox then the validation fails and it will return an error that the respective CAN mailbox is already used.  
If you want to configure the same mailbox for multiple CAN message identifiers, the init callback function to perform the validation needs to be cleared by performing the below steps:  
1. Select the C28x eCAN transmit/receive block for which the validation needs to be disabled.  
2. Run the below command from the MATLAB command window:  
set_param(gcb, 'InitFcn', '');
3. This will clear the init call back function of the respective C28x eCAN transmit/receive block as shown below:  
4. Add System Initialize block to the model and add the below custom code to configure the mailbox 0 to enable the Acceptance Mask bit to allow multiple CAN message IDs in the same mailbox:  
5. Similarly, any mailbox can be configured to enable the Acceptance Mask bit to allow multiple CAN message IDs in the same mailbox.  

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by