6.2.4. Filter received CAN messages
The device offers the option of configuring message filters. This allows you to reduce the transmission load and
ensure that the CAN bus only transmits certain CAN messages.
In the CAN Receive tab of the CANlink wireless 4000 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 be filtered 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.
Some examples are described in more detail below.
INFORMATION
To check if a CAN identifier transmits 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 to be 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 a CAN identifier 0x123 are received. CAN messages with a different CAN identifier are filtered
out and forwarded to the next online CAN object.
Table 45. Example 1: Filter mask for CAN messages
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.
Table 46. Example 2: Filter mask for CAN messages
Online CAN object Binary
11-bit CAN identifier (hex): 0x123
001 0010 0011
CANlink wireless 4000 Device Manual