CanBus v1.2 message delay and HEX structure

I have 2 questions that I havn’t been able to find answers for:

  1. Can I just use CAN.sendMsgBuf one after another or do I need a delay after it? If I do use a delay, does it interfere with transmitting at the right times on the 500kbps bus?



    It is better to add delay between each message see the code for sendMsgBuf. It returns a byte CAN_OK if messages sends successfully.

[code]

/*********************************************************************************************************
** Function name: sendMsgBuf
** Descriptions: Send message by using buffer read as free from CANINTF status
** Status has to be read with readRxTxStatus and filtered with checkClearTxStatus
*********************************************************************************************************/
byte MCP_CAN::sendMsgBuf(byte status, unsigned long id, byte ext, byte rtrBit, byte len, volatile const byte *buf)
{
byte txbuf_n=statusToTxSidh(status);

if ( txbuf_n==0 ) return CAN_FAILTX; // Invalid status

mcp2515_modifyRegister(MCP_CANINTF, status, 0); // Clear interrupt flag
mcp2515_write_canMsg(txbuf_n, id, ext, rtrBit, len, buf);

return CAN_OK;
}
[/code]

  1. I am structuring the message “buff” for each ID as I recorded it. Should the buff be structured as I have it in HEX? or should I input decimal and the shield takes care of translating? MY code is below for anyone that might see something that I’m doing wrong. Thanks for the help.

    I don’t get your this query. I hope the first one will help you.