Documentation Center

  • Trials
  • Product Updates

filterAcceptRange

Set range of CAN identifiers to pass acceptance filter

Syntax

filterAcceptRange(canch, rangestart, rangeend)

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

Description

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.

    Notes  

    • 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

canch

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

rangestart

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

rangeend

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

Examples

canch = canChannel('Vector','CANCaseXL 1',1)
filterAcceptRange(canch,600,625)
filterAcceptRange(canch,705,710)

More About

expand all

Tips

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.

See Also

| |

Was this topic helpful?