Filtering CAN ID.

A free API for the transfer of data packages according to ISO-TP (ISO 15765-2)
Post Reply
geethusara
Posts: 2
Joined: Wed 30. Dec 2020, 06:58

Filtering CAN ID.

Post by geethusara » Thu 31. Dec 2020, 08:04

Hello,

How to filter CAN ID using either PCAN-Basic or ISOTP filter API?

I tried using the following code for PCAN Basic:
res = m_PCAN.FilterMessages(PCAN_HANDLE_USBBUS1, 0x7DA, 0x7DA, PCAN_MESSAGE_STANDARD)

its showing :
Read CAN frame: CANID=0x0001 MSGTYPE=0x80 LEN=4 DATA=[00 00 00 00], TS=1197528406764.'
26032 ; Filtering CAN frames: '0x1' is rejected.'
but this is not send by the ECU.

Thanks in advance and Regards,
geethusara

M.Heidemann
Sales & Support
Sales & Support
Posts: 427
Joined: Fri 20. Sep 2019, 13:31

Re: Filtering CAN ID.

Post by M.Heidemann » Thu 31. Dec 2020, 11:18

Hello,

IN PCAN-ISO TP specifically:

Please have a look at the parameter "PCANTP_PARAMETER_FILTER_CAN_ID", which will whitelist CAN-IDs
that have been added to the Whitelist using the function "AddFiltering_2016", please see the ISO_TP documentation regarding this:

https://www.peak-system.com/produktcd/P ... an_eng.pdf
isotp.PNG
isotp.PNG (85.6 KiB) Viewed 114 times
isotp0.PNG
isotp0.PNG (43.2 KiB) Viewed 113 times


Using PCANBasic:

Make sure you properly configure your filter and that you close the filter once configured.

This is also mentioned in the PCANBasic documentation:
PCANBasic_Filter.PNG
PCANBasic_Filter.PNG (55.47 KiB) Viewed 114 times
Please also see the examples given on that page.

Please also see the PCANBasic Parameter Documentation regarding this, specifically see chapter "PCAN_Message_Filter" starting on page 41:
PCANBasic_Filter_0.PNG
PCANBasic_Filter_0.PNG (65.29 KiB) Viewed 114 times
The chapters "PCAN_ACCEPTANCE_FILTER_11BIT" and "PCAN_ACCEPTANCE_FILTER_29BIT" starting on page 48:
PCANBasic_Filter_1.PNG
PCANBasic_Filter_1.PNG (93.75 KiB) Viewed 114 times
And futhermore the Appendix "Acceptance Code and Mask Calculation" starting on page 75


Please report back to us, if this was helpful to you.
Attachments
PCANBasic_Filter.PNG
PCANBasic_Filter.PNG (55.47 KiB) Viewed 114 times

Post Reply