Acceptance filter
R2026bCAN identifier filter value
Model Configuration Pane: Hardware Implementation / Hardware board settings / Target hardware resources / Groups / CAN
Description
Specify the CAN identifier value used to filter incoming CAN messages. The CAN blocks compare the received message identifier with the specified value to determine whether the message is accepted. The acceptance filter works together with the Acceptance mask parameter to define the message filtering behavior. A message is accepted when: (Received ID AND Acceptance mask) = = (Acceptance filter AND Acceptance mask)
The acceptance mask determines which identifier bits are 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
255 (default) | integerEnter the acceptance filter as a decimal integer representing the CAN identifier to match.
255(default)Default filter value. When the acceptance mask is 0 (default), this value has no effect because no bits are checked.
- Custom value
Specify the CAN identifier to accept. For standard (11-bit) IDs, valid values range from 0 to 2047. For extended (29-bit) IDs, valid values range from 0 to 536870911. The value must be specified in decimal. Use
hex2dec()in MATLAB to convert from hexadecimal.
Examples
Recommended Settings
| Application | Setting |
|---|---|
| Debugging | No recommendation |
| Traceability | No impact |
| Efficiency | Set to target message ID |
| Safety precaution | Set to target message ID |
Programmatic Use
| Parameter: CAN.AcceptanceFilter0 (filter 1), CAN.AcceptanceFilter1 (filter 2), CAN.AcceptanceFilter2 (filter 3), CAN.AcceptanceFilter3 (filter 4) |
| Type: character vector |
| Values: non-negative integer (as string) |
| Default: '255' |
Version History
Introduced in R2019b