NI-Embedded CAN for RIO

Content Type
Programming Language
Current manual

CAN Set Filter Mode VI

CAN Set Filter Mode VI

Owning Palette: Embedded CAN for RIO VIs

Sets the mode of the filter. Use this VI and the CAN Set Filter Value VI to create Acceptance Filters. Acceptance Filters sort the incoming CAN frames for the CompactRIO with the built-in CAN port hardware and the single-board RIO hardware. Use this filter to reduce the burden of frame storage in the NI-Embedded CAN for RIO software.

Refer to the CAN protocol for more information about Acceptance Filters.

Details  

interface object in specifies the refnum of a CAN Interface Object. Use the CAN Create Interface VI to create this Interface Object.
filter mode specifies the mode of the filter to use.

0Disabled
132-bit (Default)
216-bit
38-bit
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
interface object out returns the refnum of the CAN Interface Object.
error out contains error information. This output provides standard error out functionality.

CAN Set Filter Mode Details

In the NI-Embedded CAN for RIO software, you can define an Acceptance Filter to sort the incoming CAN frames. If the incoming CAN frames meet the acceptance conditions of the filter, the software stores the frames in the received FIFO. If the incoming CAN frames do not meet the acceptance conditions, the software discards the frames.

To define a filter, you need to define the mode and configure the frame for the filter. Complete the following steps to define a mode for a filter.

  1. In this VI, right-click filter mode and select Create»Control from the shortcut menu. Select a mode for your filter according to the hardware type and your needs.

    NI Single-Board RIO hardware supports the following modes: Disabled mode, 32-bit mode, 16-bit mode, and 8-bit mode. The CompactRIO with built-in CAN port hardware supports the Disabled mode and 32-bit mode.

    Select a mode according to your needs and the function of the mode. National Instruments recommends that you use the 32-bit mode to filter an incoming CAN frame with an extended identifier, because only 32-bit mode enables you to apply the filter to all of the 29 bits. To filter a frame with a standard identifier, National Instruments recommends that you use the 32-bit mode or the 16 -bit mode. Both modes enable you to apply the filter to all of the 11 bits. You can select from the following modes.
    • Disabled Mode—The software stores all incoming CAN frames.
    • 32-Bit Mode
      • Extended CAN Frames—The filter applies to all of the 29 bits and the remote transmission request (RTR).
      • Standard CAN Frames—The filter applies to all of the 11 bits and the RTR.
    • 16-Bit Mode
      • Extended CAN Frames—The filter applies to the upper 14 bits from bit 28 to bit 15.
      • Standard CAN Frames—The filter applies to all of the 11 bits and the RTR.
    • 8-Bit Mode
      • Extended CAN Frames—The filter applies to the upper eight bits from bit 28 to bit 21.
      • Standard CAN Frames—The filter applies to the upper eight bits from bit 10 to bit 3.
  2. In the CAN Set Filter Value VI, right-click filter index and select Create»Constant or Create»Control from the shortcut menu. Set the filter number that you want to configure.

    NI-Embedded CAN for RIO supports different numbers of filters in different modes. The following table shows the maximum filter number for each mode. In the Disabled mode, you cannot create a filter, so the software stores all the incoming CAN frames. If the hardware supports multiple filters, the software stores the incoming CAN frames when the frames meet the acceptance conditions of any filter.

    Hardware Type Disabled 32-bit 16-bit 8-bit
    Single-Board RIO N/A 2 4 8
    CompactRIO with Built-In CAN Port N/A 4 N/A N/A
Was this information helpful?