Documentation Center

  • Trials
  • Product Updates

filterBlockRange

Set range of CAN identifiers to block via acceptance filter

Syntax

filterBlockRange(canch, rangestart, rangeend)

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

Description

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

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 starts blocking at.

rangeend

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

Examples

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

canch = canChannel('Vector','CANCaseXL 1',1)
filterBlockRange(canch, 500, 750)
filterAcceptRange(canch,600,625)
filterAcceptRange(canch,705,710)
filterBlockRange(canch,1075,1080)

More About

expand all

Tips

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

See Also

| |

Was this topic helpful?