MCP_CAN library - Query

I am using the library from here : GitHub - coryjfowler/MCP_CAN_lib: MCP_CAN Library

All well but just a query: In case I want to set the Priority value in the sendCAN_Msg() can I set it ?

I am right now using it like this :

byte sndStat = CAN0.sendMsgBuf(0x1CFF01F2, 1, 2, data);

In the above the format is this : sendMsgBuf(ExtendedID,1,Data length, data). Was wondering if the '1' denotes Priority ?

Thanks for any help !

Mogaraghu:
I am using the library from here : GitHub - coryjfowler/MCP_CAN_lib: MCP_CAN Library

All well but just a query: In case I want to set the Priority value in the sendCAN_Msg() can I set it ?

I am right now using it like this :

byte sndStat = CAN0.sendMsgBuf(0x1CFF01F2, 1, 2, data);

In the above the format is this : sendMsgBuf(ExtendedID,1,Data length, data). Was wondering if the '1' denotes Priority ?

Thanks for any help !

the '1' here is used to let the chip know that the CAN ID used is of extended type.

and you must have read about now CAN works with regards to messaging priority!

Quoting an extract from wikipedia (CAN bus - Wikipedia)

"...the lower the numerical ID and hence the higher the message priority..."

sherzaad:
the '1' here is used to let the chip know that the CAN ID used is of extended type.

and you must have read about now CAN works with regards to messaging priority!

Quoting an extract from wikipedia (CAN bus - Wikipedia)

"...the lower the numerical ID and hence the higher the message priority..."

Sure. This is my understanding. Got a bit confused by the configuration fields provided in a instrument that I am working with … see the image below. It has a specific field for Priority and reason why I asked. And I have not been able to check it out with different values is because right now the set up is just that instrument and my MCU based CAN shield. ( I am new to this CAN stuff, so ….!!)

Thanks!

Mogaraghu:
Sure. This is my understanding. Got a bit confused by the configuration fields provided in a instrument that I am working with … see the image below. It has a specific field for Priority and reason why I asked. ....

did you check the App manual (https://www.sunhydraulics.com/sites/default/files/media_library/tech_resources/XMD%20Mobile%20App%20User%20Manual.pdf)

page 18-19 describes what 'priority' means

"Priority designates the order in which messages will be sent (3-7)"

sherzaad:
did you check the App manual (https://www.sunhydraulics.com/sites/default/files/media_library/tech_resources/XMD%20Mobile%20App%20User%20Manual.pdf)

page 18-19 describes what 'priority' means

"Priority designates the order in which messages will be sent (3-7)"

I am glad you navigated to the right document. Yes I must have read it so many times... but the number 3-7 is what got me. Actually in the case of the XMD amplifier it has only two two transmission channels and whatsthe significance of 3-7

Thanks

Mogaraghu:
I am glad you navigated to the right document. Yes I must have read it so many times... but the number 3-7 is what got me. Actually in the case of the XMD amplifier it has only two two transmission channels and whatsthe significance of 3-7

Thanks

It's there.... in plain english (at least that's my undersanding):

"Priority designates the order in which messages will be sent (3-7)"

my guess is that if messages you create with priority '3' are transmitted first (or as soon as possible), then '7' would mean message has the lowest priority.

No sure if that has anything to do with the RAW CAN ID's transmitted.... possible got to do with the message content

sherzaad:
It's there.... in plain english (at least that's my undersanding):

"Priority designates the order in which messages will be sent (3-7)"

my guess is that if messages you create with priority '3' are transmitted first (or as soon as possible), then '7' would mean message has the lowest priority.

No sure if that has anything to do with the RAW CAN ID's transmitted.... possible got to do with the message content

:slight_smile: Sure I got it.

But what I miss is the exact number range of 3-7. Maybe it will be clear if I pore over the original CAN spec document or it must be some kind classified number range :wink: