FFCAN Filter and Filter Mask

Discuss issues and ideas you have to configuring displays with PowerVision
mbowdich
Posts: 209
Joined: Tue Oct 05, 2010 10:54 am

FFCAN Filter and Filter Mask

Post by mbowdich » Mon Jul 18, 2016 1:59 pm

PV Studio 2.8.10491

How is the filter mask and filter implemented specifically? Through testing, it appears to act differently than I expect. It seems quite easy to break it so that no data passes the filter, even if every possible numeric value of the byte (assume 8 bit filter) is sent.

Examples (8 bit filter):

Filter 0x01 / Mask 0xFF / Result: Passes data when byte 1 = 0x01
Filter 0x01 / Mask 0x01 / Result: Passes data when bit 0 of byte 1 = 1 (ignores bits 1-7)
Filter 0x03 / Mask 0xFF / Result: Passes data when byte 1 = 0x03
Filter 0x03 / Mask 0x03 / Result: Passes data when bits 0 and 1 of byte 1 = 1 (ignores bits 2-7)
Filter 0x00 / Mask 0x03 / Result: Passes data when bits 0 and 1 of byte 1 = 0 (ignores bits 2-7)

This seems fine. However, the below example causes some issues:

Filter 0x03 / Mask 0x01 / Result: Passes no data - In this example, I would expect bit 1 of the filter to be ignored and data to pass based solely when bit 0 = 1.

The result appears the same if the value for the filter is greater than the value for the mask. I would expect the mask to be "evaluate when 1, ignore when 0".
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: FFCAN Filter and Filter Mask

Post by stalley » Mon Jul 18, 2016 3:32 pm

Hello mbowdich,

This is a great question! I'm sure there are other PowerVision Configuration Studio users who had a similar experience using the Filter/Mask.

It is my understanding that the Mask is used to determine the bits of interest, just as you indicated. The value of the Filter is then compared to the value of the bits of interest in the data. The number of bits need to be enough to accommodate the value of the filter.

Regards,
Sara Talley
Software Engineer
Enovation Controls