Keywords in this article: CAN, LIN, FlexRay, telegram message filtering
Table of Contents for this article
I. CAN message message filtering
The following filtering operations are used in CAN message information: global receive filtering, data stream filtering, window filtering, string filtering, and programmable filtering; these filtering operations are explained in detail below.
1. Global reception filtering
Global receive filtering means to complete the setting of filtering on the hardware controller, this way is limited to support the hardware of the same star and the virtual channel of the same star, other manufacturers' devices are not supported. Before operation, you need to select the hardware channel to the same star device, here take TC1016 as an example.
![Global Receive Filtering](https://www.tosunai.com/wp-content/uploads/2023/12/图片1-2.png)
![bus hardware](https://www.tosunai.com/wp-content/uploads/2023/12/图片2-1-1024x391.png)
2. Data stream filtering (measurement filters)
TSMaster software has a measurement setting window, in which you can combine the data flow direction to realize the effect of filtering, and also supports adding a filter window in front of the window.
The basic idea is that the data flow through a window, the data contained in this window is allowed to pass, other data is not allowed to pass. As shown in the figure below, in the measurement setup window, the message information #2, measurement filters, graphic three windows for topology connection, from the message information window can see that there is a EngineData message under the EngSpeed signal, but in the graphic window is n.a., indicating that it is invalid. This is because a filter has been added to the measurement settings to block the EngineData on channel one.
![stream filtering](https://www.tosunai.com/wp-content/uploads/2023/12/图片3-1024x432.png)
Measurement of the window filter is in the window click on any window selected box right-click and select Insert Filter, you can also directly in the margins of the choice to add and then dragged to the back of another window. Double-click to open the inserted filter, where you can select the channel to be filtered, the filter conditions here to support any message, a single ID, ID range, node filtering, as well as error frame filtering, and finally need to pay attention to is the type of filter you can choose to pass through the type or block type.
3. Message ID Filter
This filter directly click the funnel icon in the message information window to pop up the configuration window, applicable to real-time listening to bus data or message playback when the operation, where theSupports Message ID Filteringand Channel Filtering, it is important to note whether the selection in the lower left corner is pass-through or block-through.
![Message ID Filter](https://www.tosunai.com/wp-content/uploads/2023/12/图片4-1024x391.png)
4. String filtering (recommended to load DBC database)
String filtering is the same as window filtering and supports fuzzy query. The scope of filtering includes the message identifier, the parsed message name, and the physical value (enumerated value) in the message information, and the parsing of the message needs to load the database and bind the corresponding channel in advance. Here it is recommended to load the DBC database.
![String Filtering](https://www.tosunai.com/wp-content/uploads/2023/12/图片5-1024x328.png)
5、Programmable filtration
Programming filter is one of the most complete filter conditions, it filters the conditions including all the member attributes of the message structure body, specifically can be viewed from the TSMaster header file, including the message frame type, send and receive direction, DLC and so on. The use of this filter need to first click on the message information window in the upper right corner of the funnel icon, select the activation of the filter, and then select the installation of the default filter library; after the installation is complete, the default library will pop up the C applet, the applet can be seen, respectively, for the CAN, LIN, FlexRay, Ethernet created a custom function to distinguish between the definition of its structure are in the TSMaster.h header file can be found.
The key point is this:A return of 0 indicates that the eligible message is blocked, while a return of non-zero indicates that the message is windowable.
![Programmable Filtering1](https://www.tosunai.com/wp-content/uploads/2023/12/图片6-1024x418.png)
![Programmable Filter 2](https://www.tosunai.com/wp-content/uploads/2023/12/图片7-1-1024x386.png)
The following is the operation of pass-through filtering for channel one messages. After writing the code, you need to compile the applet, and finally, you can select the corresponding API function in the programmable filter.
![Programmable filtration3](https://www.tosunai.com/wp-content/uploads/2023/12/图片8-1-1024x515.png)
![Programmable filtration4](https://www.tosunai.com/wp-content/uploads/2023/12/图片9-1-1024x320.png)
![](https://www.tosunai.com/wp-content/uploads/2023/12/图片10-1-1024x160.png)
II. LIN Message Filtering
The filtering of LIN telegram messages is done by the following filtering operations.
1. Data stream filtering
Configure the topology of the three windows of the measurement filter, LIN message information #2, and graphics in the measurement setup, and as a result, you can see that after the filter only the frame 0x15 of this message passes through to arrive at the message information window, and at the same time, the value of the SteeringLampState signal in the graphics window is n.a. invalid value. From the message information window, you can see that the original data stream has this signal data.
![LIN message information](https://www.tosunai.com/wp-content/uploads/2023/12/图片11-1-1024x535.png)
2. Message ID window filtering
Window filtering is different from the previous one in that the channel filtering settings are moved to the lower right corner of the filter setting window, and will take effect immediately after activating the enabling filter by selecting only channel 1 or other; in addition, the channel of the added identifier corresponds to the channel configured in the lower right corner, which is different from the window filtering of the CAN as mentioned earlier.
![Window Filtering](https://www.tosunai.com/wp-content/uploads/2023/12/图片12-1-1024x328.png)
3. String filtering (recommended to load DBC database)
The scope of string filtering is also the message identifier, the message name after parsing the message information name, and the physical value (enumeration value) in the message information.
![message identification](https://www.tosunai.com/wp-content/uploads/2023/12/图片13-1.png)
4、Programmable filtration
As shown in the figure below, messages that pass through channel one and have a first message data byte of 0x00 are filtered by programmable.
![Message data byte 1](https://www.tosunai.com/wp-content/uploads/2023/12/图片14-1024x291.png)
![Message data byte 2](https://www.tosunai.com/wp-content/uploads/2023/12/图片15.png)
III. FlexRay Message Message Filtering
The only FlexRay message filters for telegrams are window filtering, string filtering, and programmable filtering.
1、Window filtering
FlexRay window filtering supports adding channel filters and adding corresponding messages from the database.
![flexray window filtering](https://www.tosunai.com/wp-content/uploads/2023/12/图片16-1024x265.png)
2、String filtering
String filtering is used in the same way as CAN and LIN for signal keyword search.
![String Filtering](https://www.tosunai.com/wp-content/uploads/2023/12/图片17-1024x266.png)
3、Programmable filtration
Programmable filtering is also accomplished by making conditional judgments on FR structure members. The following is an example of the range filtering that can be achieved for Slot id.
![Operation of message filtering for different bus messages in TSMaster](https://www.tosunai.com/wp-content/uploads/2023/12/图片18.png)
![Operation of message filtering for different bus messages in TSMaster Programmable filtering2](https://www.tosunai.com/wp-content/uploads/2023/12/图片19-1024x561.png)