Skip to Main Content Skip to Search
Product Documentation

filterAllowOnly - Configure message filter to allow only specified messages

Syntax

filterAllowOnly(canch, 'name')
filterAllowOnly(canch, ids, 'type')

Description

filterAllowOnly(canch, 'name') configures the filter on the channel canch, to pass only messages with the specified name.

filterAllowOnly(canch, ids, 'type') configures the filter on the channel canch, to pass only messages of the specified type with the specified identifier.

Tips

Input Arguments

canch

The CAN channel on which you want to filter messages.

name

the name of the CAN message that you want to allow. You can specify a single name as a string or a cell array of message names.

ids

The CAN message ID or IDs that you want to allow. You can specify:

  • Single value, such as 600

  • Multiple values, such as [600,610]

  • Range of values, such as [600:800]

  • Multiple ranges, such as [200:400, 600:800]

type

The identifier type by which to filter messages. CAN messages are 'Standard' and 'Extended'.

Examples

To filter a database defined message with name 'EngineMsg', type:

canch = canChannel('Vector','CANCaseXL 1',1);
canch.Database = canDatabase('candatabase.dbc');
filterAllowOnly(canch,'EngineMsg')

To filter messages by identifier, type:

canch = canChannel('Vector','CANCaseXL 1',1);
filterAllowOnly(canch,[602 612],'Standard');

See Also

filterAllowAll | filterBlockAll | hex2dec

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS