Channel (same for channel 1 to 8)

This page documents the [channel1], [channel2], …, [channel8] configuration sections.

The device users a range of virtual channels (Channel 1 to Channel 8) to decide what to do with received CAN-bus messages. The channels support message ID filtering, prescaling and routing (logging/interface).

This section documents the configuration of the virtual channels.

When a message is received on the physical interface, it is forwarded to the channels one-by-one (stating with Channel 1) as illustrated below.

../_images/aafig-7606437120b29de0728daf88a1014e4bd8eb5fd4.svg

For each channel the message is tested against the following criteria (in below specific order):

  1. Channel enabled (channelEnb)?

  2. Does message ID type match channel ID type (extendedID)?

  3. If filtering enabled, does the message ID pass the channel filter (filteringEnb, msgID and msgIDMask)?

If all above criteria pass, then the message is accepted by the channel (the following channels are ignored). Else, the message is forwarded to the next channel. If no channel accepts the message, it is ignored.

When accepted by a channel, the message is prescaled according to the configured prescaler value. Finally, the message is router to either logging (written to log file), interface (streamed via USB) or both.

The flow of a message through a single channel (Channel 1) is illustrated below.

../_images/aafig-487ef554f26f4897e0e29b1086554cff4f74d49a.svg

Default

All channels use an identical configuration structure (below default configuration of Channel 1).

[channel1]
channelEnb = true               ; Enable CAN channel
destination = 3                 ; 1 = Logger, 2 = Interface, 3 = Both
extendedID = false              ; Use extended 29 bit message IDs (2.0B)
downSamplePrescaler = 1         ; Down-sampling prescaler (DEC, range: 1-256)
filteringEnb = false            ; Enable below message filtering
msgID = 00000000                ; Message ID filter (HEX)
msgIDMask = 1FFFFFFF            ; Message ID filter mask (HEX) (0 is invalid)

Fields explained

channelEnb

Sets the state of the specific channel.

Type

Options

Boolean

true, false

  • true: Channel is enabled

  • false: Channel is disabled


destination

Configures the routing used by the channel. Messages through a channel can either be logged, streamed (via USB) or both.

Type

Minimum

Maximum

Example

Integer

1

3

1

  • 1: Messages are logged

  • 2: Messages are forwarded to USB-interface

  • 3: Messages are logged and forwarded to USB-interface


extendedID

Configures the ID format used by the channel. Only messages matching the ID format are accepted by the channel.

Type

Options

Boolean

true, false

  • true: Use extended ID format (29-bit)

  • false: Use standard ID format (11-bit)


downSamplePrescaler

The down-sample prescaler is used to limit the number of messages accepted by the channel. Incoming messages are prescaled based on message ID.

Type

Minimum

Maximum

Example

Integer

1

256

1

  • A prescaler value of 1 effectively disables the prescaler and passes all messages (which are accepted by the channel filter).

  • A prescaler value of 2 passes every second message with a specific message ID.

Note

The prescaler mechanism is limited to 10 unique message IDs pr. channel. If more than 10 unique message IDs are received (and passed by the filter) on a specific channel, then only the 10 first received unique message IDs are prescaled - the remaining messages are all passed (as if the prescaler is 1).


filteringEnb

Configures if message ID based filtering is used by the channel.

Type

Options

Boolean

true, false

  • true: Enable filtering

  • false: Disabled filtering (all message IDs passed)

A filter is configured using a message ID-filter field (msgID) and a mask field (msgIDMask), see below.


msgID

Filter message ID (in HEX).

If filteringEnb is true then msgID and msgIDMask are used in combination to define the channel filter. For more information, see examples.

Type

Minimum

Maximum

Example

HEX

0

7FF / 1FFFFFFF[1]

1F4


msgIDMask

Filter message ID mask (in HEX).

If filteringEnb is true then msgID and msgIDMask are used in combination to define the channel filter. For more information, see examples.

Type

Minimum

Maximum

Example

HEX

0

7FF / 1FFFFFFF[1]

7FF


Filters explained

Channel filters can be used to filter out unwanted messages (based on ID) reducing the amount of data to process (log, forward to interface or both).

To enable filtering based on message ID, the field filteringEnb should be set to true. It is possible to configure a filter for each of the 8 virtual channels. In combination, the channels form a hierarchy of message filters (starting with Channel 1).

When enabled, the fields msgID and msgIDMask define a filter. The combination of the two fields allow for both simple and advanced filters.

Note

It is recommended to filter out all unwanted messages. By filtering out unwanted messages, the risk of losing wanted messages is reduced, and the logger will be able to log for a longer period of time before running out of storage memory.

Both the filter message ID and the filter message ID mask work on a bitwise level. A message is accepted by a filter if the following condition is true[2][3]:

(filter_id & filter_mask) == (message_id & filter_mask)

Note

When constructing filters, it is helpful to use a tool supporting conversion between binary, decimal and hexadecimal and which can perform the bitwise AND operation used by the filters.

Configuration of filters are demonstrated by the examples below.


Examples

Below list of examples demonstrate how to use the virtual channels and their filters: