Specifications
5 CAN I/O Support for FIFO
5-46
Example 6
The next example shows the use of the CAN acceptance filters. First the Read
depth parameter of the FIFO Read block is set back to a value of 2. Then the
identifier of the second standard message is changed from 114 to 188. The goal
is to filter any CAN messages with an identifier larger than 127 what would
mean that the receive FIFO would never contain the CAN message with
identifier 188. Additionally the FIFO Filter block, filtering CAN message with
identifier 114 is changed to filter the message with identifier 188.
For this the Acceptance Filters parameter of CAN port 2 in the FIFO Setup
block has to be set accordingly:
[2047-127, 0, 0, 0]
By rebuilding and re-executing the target application the following can be
observed:
•Scope with Id 6 shows 0 for all elements of the vector leaving the
corresponding FIFO Filter block. The message with identifier 188 is never
received.
•Scope with Id 3 shows one of the data traces always being zero.
•Scope with Id 7 shows a value of 1 which reflects that the Read depth could
be reduced to 1, because only one message per millisecond reaches the
receive FIFO now.
You can display the model by typing, in the MATLAB command window, either
is xpccanpcififo6.mdl or xpccan104fifo6.mdl.