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

7 次查看(过去 30 天)

采纳的回答

MathWorks Support Team
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