OK,
please note that the function
FilterMessages uses CAN IDs to filter (not bit patterns, aka mask and code). That is, passing the values
0 and
1 as in your code would mean that you want to receive only CAN messages with ID 0x0 and ID 0x1. If you want to receive the ID 0x1b6 you should use the following code:
Code: Select all
self.m_objPCANBasic.FilterMessages(PCAN_USBBUS, 0x1b6 , 0x1b6 , PCANBasic.PCAN_MESSAGE_STANDARD )
PCAN-Basic calculates internally filter acceptance mask and acceptance code patterns using the range of IDs passed to the
FilterMessage function.
Note that each time you call
FilterMessages the filter will be expanded. So, if you want to reconfigure your filter, then you need to close it first, so that it can be reset.