Hello,
You can set hardware filters in the delivery hardware via a serial command,
this is documented in the HELP-Filefor the example 06_CAN_TO_SER_COMMAND
provided with the Development Package.

- RS-232 Filters.PNG (139.86 KiB) Viewed 7174 times
The documentation also gives a brief insight on how these filters are used.
If you only want to send specific messages that are within a certain range, this is a valid approach.
However if you need more flexibility, you might want to handle this by adjusting the firmware-code.
I assume you want to stick with the example 06_CAN-TO_SER_COAMMND:
If you want to filter specific messages via code,
you'll have to modify the function "ProcessMsgFromCan" in the "pcan-rsr-232.c"-file to acommendate
the conditions that determine the CAN-messages being sent.
If you want examples for how these conditions can be defined, have a look at the example "04_CAN_TO_SER_ASCII",
as it shows how specific ID are written to RS-232 based on their ID:
Code: Select all
// catch ID 00000650h to send on serial as ascii
if ( RxMsg.Id == 0x650 && RxMsg.Type == CAN_MSG_EXTENDED)
{
b8_t textbuff[30];
u32_t textlen;
// convert a 15-bit signal to ASCII text
textlen = snprintf ( &textbuff[0], 30, "RPM = %d\n", RxMsg.Data16[0] & 0x7FFF);
// send on serial to terminal
SER_Write ( SER_PORT1, &textbuff[0], textlen);
}
If your conditions are met, you can convert the message as shown in "ProcessMsgFromCan" and write it to Rs-232 via "SER_Write".
For further questions feel free to contact me again.
Best Regards
Marvin