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 pass acceptance filter


filterAcceptRange(canch, rangestart, rangeend)

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


filterAcceptRange(canch, rangestart, rangeend) sets the acceptance filter for standard identifier CAN messages. It allows messages within the given range on the CAN channel canch to pass. rangestart and rangeend establish the beginning and end of the acceptable range. You can use this function with Vector devices only.


    • 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.

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

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

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

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 accepts.


The last identifier of the range of message IDs that the filter accepts.


canch = canChannel('Vector','CANCaseXL 1',1)


When you call filterAcceptRange on an open or reset filter, it automatically blocks the entire standard CAN identifier range, allowing only the desired range to pass. Subsequent calls to filterAcceptRange open additional ranges on the filter without blocking the ranges previously allowed.

Introduced in R2009a

Was this topic helpful?