This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Set range of CAN identifiers to block via acceptance filter


filterBlockRange(canch, rangestart, rangeend)

    Note:   You cannot set filters on an NI device channel.


filterBlockRange(canch, rangestart, rangeend) blocks messages within a given range by setting an acceptance filter. You can use this function with Vector devices only.

Input Arguments


The CAN channel that you want to set the filter for.


The first identifier of the range of message IDs that the filter starts blocking at.


The last identifier of the range of message IDs that the filter stops blocking at.


You can set the filter to block or accept messages within a specific range.

canch = canChannel('Vector','CANCaseXL 1',1)
filterBlockRange(canch, 500, 750)


  • You can configure message filtering only when the CAN channel is offline.

  • CAN message filters initialize to fully open.

  • filterReset makes the acceptance filters fully open.

  • filterBlockRange supports only standard (11-bit) CAN identifiers.

  • You must set the values from rangestart through rangeend in increasing order.

  • filterBlockRange and filterAcceptRange work together by blocking and allowing ranges of CAN messages within a single filter. You can perform both operations multiple times in sequence to custom configure the filter as desired.

Introduced in R2009a

Was this topic helpful?