This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280025C: Send different CAN messages with only ID change

Part Number: TMS320F280025C

Dear Champs,

I am asking this for our customer.

If the user just wants to send CAN messages with only ID change, do they still have to setup the message again by CAN_setupMessageObject() and then CAN_sendMessage()

#define TX_ID1         0x210

#define TX_ID2         0x211

 

CAN_setupMessageObject(CANA_BASE, TX_MSG_OBJ_ID, TX_ID1, CAN_MSG_FRAME_EXT, CAN_MSG_OBJ_TYPE_TX, 

                                            0, 0, MSG_DATA_LENGTH);

CAN_sendMessage(CANA_BASE, TX_MSG_OBJ_ID, MSG_DATA_LENGTH, txMsgData);

 

CAN_setupMessageObject(CANA_BASE, TX_MSG_OBJ_ID, TX_ID2, CAN_MSG_FRAME_EXT, CAN_MSG_OBJ_TYPE_TX, 

                                            0, 0, MSG_DATA_LENGTH);

CAN_sendMessage(CANA_BASE, TX_MSG_OBJ_ID, MSG_DATA_LENGTH, txMsgData);

Or is there a simpler method/API for them to do so with just ID changing?

  • Hi Wayne,

    Yes, that is the only way to do it.  CAN_setupMessageObject() would change the message ID in the object so that when CAN_sendMessage() is called, the entire message object with the modified message ID would be processed by the CAN module and generate and transmit the message frame accordingly.

    Regards,

    Joseph