CAN_NODE : Mask Value use case

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User13960
Level 3
Level 3
First like received
Hi All,

Can anyone explain the use case of the CAN_NODE 'Mask Value' please ? What is it masking ?

I want to receive only CAN message with ID 0x61 so I have set the 'Identifier Value' to 0x61.

By default the 'Mask Value' is 0x7FF. Should I change this to 0x61 ?

4594.attach

Thank you very much
PHAB
0 Likes
6 Replies
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

Check the section Receive Acceptance Filtering in the reference manual.
ID_received XOR ID_MO AND MASK needs to evaluate to zero to accept the message.

4605.attach

Regards,
Jesus
0 Likes
User13960
Level 3
Level 3
First like received
Hi Jesus, thanks for the reply (as usual).

I had already read the section Receive Acceptance Filtering in the reference manual but the usage of the Acceptance Mask is not clear.

I've tried various values for the 'Acceptance Mask' but nothing appears to have any affect on received messages.

An example would be extremely helpful if you have one.

Thanks again
PHAB
0 Likes
User13960
Level 3
Level 3
First like received
Hi Jesus,

OK I now understand the 'Mask'.

A received message with an ID equal to the 'Identifier Value' defined in the Message Object will always be accepted. For example, Received ID = 0x061 and Message Object 'Identifier Value' = 0x061.
All other received message ID's will be rejected (assuming a Mask Value of 0x7FF)

However, if you want a wider range of received messages to be accepted by the message object you can use the 'Mask' to let more through. The 'Mask' is a 'bit' level mask.
So if you want received messages with ID's of 0x060 and 0x061 to be accepted, CLEAR the corresponding bit(s) in the 'Mask'. For example...

Message ID's you want accepted
0x060 = 000 0110 0000
0x061 = 000 0110 0001

We don't care if the least significant received ID bit is a zero or a one so we set the least significant bit of the mask to zero...

Mask Value
0x7FE = 111 1111 1110


I still have one question. What is the function of the the "Std_Ext" please ? It is not documented in the CAN_NODE Help.


Thank you very much


PHAB
0 Likes
lock attach
Attachments are accessible only for community members.
User13960
Level 3
Level 3
First like received
The attached Excel file lets you try different CAN message ID's and Masks to see which messages are accepted or ignored.

0 Likes
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

What is the function of the the "Std_Ext" please ?


Standard message identifier has a length of 11 bits. CAN specification 2.0B extended
the message identifier lengths to 29 bits, i.e. the extended identifier. Both frame formats
are part of the ISO 11898-1.

See http://www.copperhilltechnologies.com/can-bus-guide-extended-can-protocol/

Regards,
Jesus
0 Likes
User13960
Level 3
Level 3
First like received
Hi Jesus,

Thank you for your reply. I appreciate there are 11 and 29 bit standards which is selected by the 'Identifier Type (IDE) option, but what is the function of the the "Std_Ext" please ? It is not documented in the CAN_NODE Help. How does it affect masking ? ?

Thank you very much
PHAB
0 Likes