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.

TMS320F2800137: CAN trans size

Part Number: TMS320F2800137

Tool/software:

hi expert"

when i init the can module,trans length is 8;but i send data length is five

The last three digits of the data sent are random values,as follow

The number of data sent is random, and the initialization setting trans length is 8. How to solve the problem(Do not display the last three bit) ?

  • CAN_sendMessage API either transmits 0 or 8 bytes of data.  If message length is >0, then it sends 8 bytes.  If you want to send message length that is between 1 to 8, use API CAN_sendMessage_updateDLC instead.  Data would still be sent as 8 bytes but DLC (actual length of message) will be sent and received as part of message object and the receiving node can use the DLC value as an indication of how many bytes of data is valid.

    Regards,

    Joseph

  • the receiving node can use the DLC value as an indication of how many bytes of data is valid.

    which function used in lib?

  • Youjun,

    The DLC information gets transmitted as part of the CAN frame.  In the receiving node, use function CAN_readMessage.  This function calls CAN_readDataReg and it uses the DLC information to read out the number of bytes corresponding the DLC value.

    Regards,

    Joseph