Main Content

Acceptance Mask

R2026b

CAN identifier bit mask for filtering

Model Configuration Pane: Hardware Implementation / Hardware board settings / Target hardware resources / Groups / CAN

Description

Specify the bit mask that determines which bits of the incoming CAN message identifier are compared against the Acceptance filter value. The acceptance mask works together with the Acceptance filter parameter to define the message filtering behavior. A message is accepted when: (Received ID AND Acceptance mask) = = (Acceptance filter AND Acceptance mask)

Each bit in the mask controls whether the corresponding bit in the identifier is evaluated:

  • Bits set to 1 are compared

  • Bits set to 0 are ignored

When the Inverse filter parameter is enabled for a filter entry, the behavior is reversed, and matching messages are rejected instead of being accepted.

Dependencies

To enable this parameter, set Filter configuration (all interfaces) to Manually specify.

Settings

0 (default) | integer

Enter the acceptance mask as a decimal integer.

0 (default)

A mask of 0 means no bits are checked, effectively accepting all messages regardless of their identifier. This is equivalent to disabling the filter.

Non-zero value

Only messages whose identifier matches the acceptance filter in the masked bit positions are accepted. For standard (11-bit) IDs, valid mask values range from 0 to 2047. For extended (29-bit) IDs, valid mask values range from 0 to 536870911.

Examples

expand all

Set Acceptance mask to 0x7FF to evaluate all identifier bits. In this configuration, the block compares the complete identifier value against the acceptance filter and accepts only messages with an exact match.

Set Acceptance mask to 0x7F0 to evaluate only the upper bits of the identifier and ignore the lower bits. In this configuration, the block accepts a range of messages that share the same upper bits while, differences in the lower bits are ignored.

With the default value (Acceptance mask = 0), the block does not evaluate any identifier bits and accepts all incoming messages regardless of the acceptance filter value.

You can configure acceptance masks for up to four filters.

Recommended Settings

No recommendation.

Programmatic Use

No programmatic use is available.

Version History

Introduced in R2019b