Routing
This page documents the routing configuration.
Warning
When routing messages between channels, care should be taken to avoid message ID collisions on the destination channel.
The CANedge supports configurable routing of messages from CAN-internal (see internally generated signals), CAN-1, CAN-2, LIN-1, and LIN-2 to CAN-1 and / or CAN-2. E.g. the CAN-internal Heartbeat message can be routed to a physical CAN-bus channel to provide device status.
The routing list can contain up to 32 routing rules. When the CANedge receives a message on CAN-internal, CAN-1, CAN-2, LIN-1, or LIN-2, it is compared to each (enabled) entry in the routing list. If a match is found, the the message is routed to the configured destination-channel[1].
Note
A message can trigger multiple routing rules (e.g. be routed to multiple destination channels).
Note
A (CAN-bus) message can only be routed if both the rx-state of the source-channel and the tx-state of the destination-channel are enabled (see General).
Note
CAN-bus filter prescalers also apply to routing source-messages (see Message Prescaling).
Se routing examples for practical use cases.
Configuration file fields
This section is autogenerated from the Rule Schema file.
Routing routing
Configuration of message routing. Up to 32 routing rules can be defined. Messages received on CAN-internal, CAN-1, CAN-2, LIN-1, and LIN-2 can be routed to CAN-1 and/or CAN-2.
Type |
Min items |
Max items |
---|---|---|
array |
0 |
32 |
Item routing.item
Name routing.item.name
Optional routing rule name.
Type |
Max length |
---|---|
string |
16 |
State routing.item.state
Disabled routing rules are ignored.
Type |
Default |
Options |
---|---|---|
integer |
1 |
Disable: |
Log routing.item.log
Determines if the output (transmit) message is included in the log file.
Type |
Default |
Options |
---|---|---|
integer |
0 |
Disable: |
Source channel routing.item.chn_src
Source message channel.
Type |
Default |
Options |
---|---|---|
integer |
0 |
CAN-internal: |
Source ID-format routing.item.id_format_src
Source message ID-format of source message. If source bus is LIN, then this field is ignored.
Type |
Default |
Options |
---|---|---|
integer |
0 |
Standard (11-bit): |
Source ID (hex) routing.item.id_src
Source message ID-value. Example: 1FF.
Type |
Default |
---|---|
string |
0 |
Destination channel routing.item.chn_dst
Destination message channel.
Type |
Default |
Options |
---|---|---|
integer |
1 |
CAN-1: |
Destination ID-format routing.item.id_format_dst
Destination message ID-format.
Type |
Default |
Options |
---|---|---|
integer |
0 |
Standard (11-bit): |
Destination ID (hex) routing.item.id_dst
Destination message ID-value. Example: 1FF.
Type |
Default |
---|---|
string |
0 |
Configuration explained
This section contains additional information and examples.
In below, routing rule fields are explained in detail.
Name
A rule can be assigned an optional name. The name is not used when processing a rule.
State
The state
field defines if a routing rule is active. Disabled rules are ignored, as if they are not in the list of rules. By disabling a rule (instead of deleting) it can be easily enabled at a later time.
Log
The log
field defines if routed messages are included in the log file. When enabled, a routed message is logged once it has been successfully transmitted on the destination bus (transmission acknowledged).
Note
The received message on the source channel (routed to the destination channel) is logged regardless of the value of this field.
Source channel
The chn_src
field defines the routing rule source channel. Can be both virtual (see internally generated signals) and physical channels.
Source ID-format
The id_format_src
field defines the ID-format of the source message (on the source channel).
Source ID (hex)
The id_src
field defines the ID-value of the source message (on the source channel).
Destination channel
The chn_dst
field defines the routing rule destination channel. The destination channel can be either of the physical CAN-bus channels.
Note
The routing rule is ignore if the source and destination channels are the same.
Destination ID-format
The id_format_dst
field defines the ID-format of the destination message (on the destination channel).
Destination ID (hex)
The id_dst
field defines the ID-value of the destination message (on the destination channel).
Examples
Example: Routing of the CAN-internal Heartbeat signal to physical channels CAN-1 and CAN-2.
The source message is routed to CAN-1 and CAN-2. The destination ID-format and ID-value are set specifically for each destination channel.
Name (optional) |
State |
Log |
Source channel |
Source ID-format |
Source ID |
Destination channel |
Destination ID-format |
Destination ID |
---|---|---|---|---|---|---|---|---|
Heartbeat CAN-1 |
Enable |
Disable |
CAN-internal |
Standard |
2 |
CAN-1 |
Extended |
1F000001 |
Heartbeat CAN-2 |
Enable |
Disable |
CAN-internal |
Standard |
2 |
CAN-2 |
Extended |
1F000002 |
Note
With logging disabled, the routed messages do not generate a log entry when transmitted on the destination channels.
Example: Routing of message from CAN-1 to CAN-2 with logging.
The source message is routed from physical CAN-1 to physical CAN-2. The output message is logged if successfully transmitted on the destination bus (CAN-2).
Name (optional) |
State |
Log |
Source channel |
Source ID-format |
Source ID |
Destination channel |
Destination ID-format |
Destination ID |
---|---|---|---|---|---|---|---|---|
CAN-1 to CAN-2 |
Enable |
Enable |
CAN-1 |
Standard |
1FF |
CAN-2 |
Standard |
1FF |
Example: Routing of message from LIN-1 to CAN-1
Name (optional) |
State |
Log |
Source channel |
Source ID-format |
Source ID |
Destination channel |
Destination ID-format |
Destination ID |
---|---|---|---|---|---|---|---|---|
LIN-1 |
Enable |
Disable |
LIN-1 |
Standard |
A0 |
CAN-1 |
Standard |
A0 |
Note
When source channel is LIN-1/2, the value of source ID-format is unused.