Skip to content

Filter Received CAN Messages

The device offers the option of configuring message filters, so you can reduce the transmission load and ensure the CAN bus only transmits certain CAN messages.

In the CAN Receive tab of the CANlink® wireless 3000 Configurator, you can set filter masks and activate or deactivate individual bits for the comparison function of online CAN objects. You can individually filter up to 8 separate CAN identifiers with unique online CAN objects, and downsample them if necessary. A CAN message that does not match the receive filter of an online CAN object is passed on to the next active online CAN object and checked again. If the number of CAN identifiers to filter is less than eight, you can assign a unique CAN identifier to each online CAN object. Use the filter mask 0x7FF for 11-bit or 0x1FFFFFFF for 29-bit CAN identifiers, to filter individual CAN identifiers separately.

Note

To check whether a CAN identifier matches a certain filter mask, perform the following logical operations bit by bit:

CAN identifier received XOR configured CAN identifier = CAN_ID

CAN_ID AND filter mask = 0

The CAN message is rejected if the result is not 0.

Example 1: 0x123 XOR 0x621 = 0x702; 0x702 AND 0x0F8 = 0 → CAN message accepted.

Example 2: 0x123 XOR 0x631 = 0x721; 0x721 AND 0x0F8 = 0x010 → CAN message rejected.

Tip

Use Downsampling to reduce the number of messages transmitted by the radio interface. The configured value (e.g. 20 x 10 ms for 200 ms) delays the reception or transmission of CAN messages accordingly. A value of 0 x 10 ms disables the delay.

To prevent data loss, only use downsampling with filters for individual CAN identifiers.

Filter Calculation Example 1

CAN messages with the CAN identifier 0x123 are received. CAN messages with a different CAN identifier are filtered out and forwarded to the next online CAN object.

Online CAN object Binary
11-bit CAN identifier (hex): 0x123 001 0010 0011
Resulting filter mask (hex): 0x7ff 111 1111 1111
CAN messages from CAN bus 001 0010 0011

Filter Calculation Example 2

CAN messages with the CAN identifiers 0x123, 0x124, and 0x125 are transmitted. The required filter mask must be determined using an XNOR gate. Other CAN messages that comply with the filter mask (e.g. 0x120, 0x121, 0x122, etc.) are also received. CAN messages with other CAN identifiers are forwarded to the next online CAN object.

Online CAN object Binary
11-bit CAN identifier (hex): 0x123 001 0010 0011
11-bit CAN identifier (hex): 0x124 001 0010 0100
11-bit CAN identifier (hex): 0x125 001 0010 0101
XNOR gate for filter mask 111 1111 1000
Resulting filter mask (hex): 0x7F8 111 1111 1xxx

Filter Calculation Example 3

CAN messages with the CAN identifiers 0x123, 0x124, 0x125, 0x621, and 0x726 are transmitted. The required filter mask must be determined using an XNOR gate. Other CAN messages that comply with the filter mask are also received. CAN messages with other CAN identifiers are not received, but forwarded to the next online CAN object.

Online CAN object Binary
11-bit CAN identifier (hex): 0x123 001 0010 0011
11-bit CAN identifier (hex): 0x124 001 0010 0100
11-bit CAN identifier (hex): 0x125 001 0010 0101
11-bit CAN identifier (hex): 0x621 110 0010 0001
11-bit CAN identifier (hex): 0x726 111 0010 0110
XNOR gate for filter mask 000 1111 1000
Resulting filter mask (hex): 0xF8 xxx 1111 1xxx