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.