Hallo zusammen,
wenn ich Botschaften (11 bit identifier) von CAN1 nach CAN2 weiterleiten möchte klappt das soweit. Wenn jedoch auf CAN1 Botschaften mit sog. extended Identifiern (29 Bit) vorhanden sind, werden diese nicht weitergeleitet.
Nach Prüfung ist mir aufgefallen, dass in der Datei can_user.c die Funktion CAN_UserInit() einen Filter enthält:
CAN_FilterAdd ( CAN_BUS1, CAN_MSGTYPE_STANDARD, 0x000, 0x7FF);
Wenn ich es richtig verstehe, werden also alle Botschaften mit ID [0x0, 0x7FF] durchgelassen. Meine Erwartung war, dass wenn ich die Zeile durch folgende ersetze, auch die anderen Botschaften berücksichtigt werden:
CAN_FilterAdd ( CAN_BUS1, CAN_MSGTYPE_EXTENDED, 0x000, 0x1FFFFFFF);
Klappt aber leider nicht (es werden dann gar keine Botschaften mehr geroutet..). Was mach' ich falsch?
CAN Extended Identifier routing
Re: CAN Extended Identifier routing
Hello,
per default the reception of all 11bit ID's are blocked. Reception of 11bit needs to be enabled using
CAN_FilterAdd().
Per default the reception of all 29bit IDs is enabled. There is no messagefilter avaliabe for 29bit ID's.
CAN_FilterAdd(), parameter3 (fromID),and parameter 4 (toID) only accept 11bit identifiers.
Regards, GB
per default the reception of all 11bit ID's are blocked. Reception of 11bit needs to be enabled using
CAN_FilterAdd().
Per default the reception of all 29bit IDs is enabled. There is no messagefilter avaliabe for 29bit ID's.
CAN_FilterAdd(), parameter3 (fromID),and parameter 4 (toID) only accept 11bit identifiers.
Regards, GB
Re: CAN Extended Identifier routing
Hello Mr. Bohlen,
thanks for your quick and helpful reply. After checking the C-code again I think I found my mistake. The main loop (taken from an PEAK example) had this if statement:
Kind Regards.
thanks for your quick and helpful reply. After checking the C-code again I think I found my mistake. The main loop (taken from an PEAK example) had this if statement:
Code: Select all
if (RxMsg.msgtype == CAN_MSGTYPE_STANDARD)
Re: CAN Extended Identifier routing
Hello peak,
is there now a way to filter extended ids?
Best regards.
is there now a way to filter extended ids?
Best regards.
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: CAN Extended Identifier routing
Hello,
No, this was not implemented.
However you can filter extended-IDs using conditions within your code
itself, see the example 05_Signals to see how one would go about only processing
certain extended messages.
Best Regards
Marvin
No, this was not implemented.
However you can filter extended-IDs using conditions within your code
itself, see the example 05_Signals to see how one would go about only processing
certain extended messages.
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team