Free Form CAN Packet Filters

This forum contains common answers to questions and tutorials produced for the community.
jpurdum
Enovation Controls Development
Enovation Controls Development
Posts: 153
Joined: Mon Jun 21, 2010 11:19 am

Free Form CAN Packet Filters

Post by jpurdum » Wed Sep 15, 2010 6:50 am

In the FreeFromCan screen, we understand the Frame ID (hex) but pls explain again the function of the Filter and Message Filter. It is not clear in the manual.

Variable Packing is where we save the data. Pls confirm
jpurdum
Enovation Controls Development
Enovation Controls Development
Posts: 153
Joined: Mon Jun 21, 2010 11:19 am

Re: Free Form CAN Packet Filters

Post by jpurdum » Wed Sep 15, 2010 6:58 am

For an incoming packet, the filter is used to separate packets beyond just the CAN ID. So, let’s say I’ve devised a way of using the same CAN ID for several different types of messages. And I want to use the first byte in the message to identify what type of message it is. Then for each type of message, I want to layout the remaining variables in the packet differently. Then I would set up a Message for each type, and would set the filter to the values I determined for each type.

So as a simple example, let’s say I have the following two packets I’ve defined (or someone has defined for me) – note they both use the same CAN ID:

CAN ID b1 b2 b3 b4 b5 b6 b7 b8
0x18ff0000 00 aa aa 00 00 00 00 00
0x18ff0000 01 bb bb cc cc 00 00 00

where 0xaaaa is a value I put in one variable
and 0xbbbb and 0xcccc go into two more variables

For an outgoing packet, the filter value is simply stuffed into bytes 1 through n depending on the size of the filter.

Variable Packing is where you define the fields in the packet and pick the variables to which the data is written for incoming or the variables from which data is pulled for outgoing messages.

So, for the example above, my screen looks like:
For the first message (filter = 00)
MessageFilterExample00.JPG
MessageFilterExample00.JPG (64.08 KiB) Viewed 195 times
For the second message:
MessageFilterExample01.JPG
MessageFilterExample01.JPG (62.78 KiB) Viewed 195 times